From 33b41a66c3c3908800a613637e6750218e4d0808 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sat, 12 Oct 2024 07:24:34 -0400 Subject: [PATCH] ejabberd: Set mod_mam default to always This helps various clients to use MAM. Fixes: #2338 Tests: - Functional tests for ejabberd pass. - Install ejabberd and enable MAM. Check that default is set to always in the configuration. - Without this change, install ejabberd and enable MAM. Then restart plinth with this change. The configuration is changed from never to always. After several minutes, ejabberd is running again. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/ejabberd/__init__.py | 6 +++++- plinth/modules/ejabberd/privileged.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plinth/modules/ejabberd/__init__.py b/plinth/modules/ejabberd/__init__.py index 20e2ee88d..d4409d16b 100644 --- a/plinth/modules/ejabberd/__init__.py +++ b/plinth/modules/ejabberd/__init__.py @@ -50,7 +50,7 @@ class EjabberdApp(app_module.App): app_id = 'ejabberd' - _version = 8 + _version = 9 def __init__(self) -> None: """Create components for the app.""" @@ -159,6 +159,10 @@ class EjabberdApp(app_module.App): 'turn-ejabberd').get_configuration() update_turn_configuration(configuration, force=True) + if old_version and old_version < 9 and privileged.mam('status'): + # Re-enable to change configuration + privileged.mam('enable') + class EjabberdTurnConsumer(TurnConsumer): """Component to manage Coturn configuration for ejabberd.""" diff --git a/plinth/modules/ejabberd/privileged.py b/plinth/modules/ejabberd/privileged.py index 6f177c4c6..a682a073e 100644 --- a/plinth/modules/ejabberd/privileged.py +++ b/plinth/modules/ejabberd/privileged.py @@ -261,7 +261,7 @@ def mam(command: str) -> bool | None: 'mod_mam': { 'db_type': 'mnesia', # default is 'mnesia' (w/o set default_db) - 'default': 'never', # policy, default 'never' + 'default': 'always', # helps various clients to use mam 'request_activates_archiving': False, # default False 'assume_mam_usage': False, # for non-ack'd msgs, default False 'cache_size': 1000, # default is 1000 items