From f4195f1ced042cfc9cf1be2e6e356ffb7030aec5 Mon Sep 17 00:00:00 2001 From: ianux Date: Sun, 5 May 2024 16:00:02 +0200 Subject: [PATCH 1/3] add unix socket scheme and fix RQ_QUEUES --- modoboa/core/commands/templates/settings.py.tpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index 8231bd8a7..0961ce799 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -253,6 +253,9 @@ REDIS_HOST = 'localhost' REDIS_PORT = 6379 REDIS_QUOTA_DB = 0 REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB) +# To use unix socket, use this scheme instead +# REDIS_HOST must point to the socket path +# REDIS_URL = 'unix://{}?db={}'.format(REDIS_HOST, REDIS_QUOTA_DB) # RQ @@ -260,12 +263,14 @@ RQ_QUEUES = { 'dkim': { 'HOST': REDIS_HOST, 'PORT': REDIS_PORT, - 'DB': 0, + 'DB': REDIS_QUOTA_DB, + 'URL': REDIS_URL, }, 'modoboa': { 'HOST': REDIS_HOST, 'PORT': REDIS_PORT, - 'DB': 0, + 'DB': REDIS_QUOTA_DB, + 'URL': REDIS_URL, }, } From 28d19e03ee820e8e0fd450792f47b3d4509370ea Mon Sep 17 00:00:00 2001 From: ianux Date: Sun, 5 May 2024 16:01:09 +0200 Subject: [PATCH 2/3] add redis socket use --- doc/upgrade.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/upgrade.rst b/doc/upgrade.rst index c5e1c0dfc..10546a141 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -766,6 +766,15 @@ Add the following settings to your ``settings.py`` file: REDIS_QUOTA_DB = 0 REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB) +Or, if Redis listen on unix socket: + +.. sourcecode:: python + + REDIS_HOST = '/path/to/redis/socket' + REDIS_PORT = 6379 + REDIS_QUOTA_DB = 0 + REDIS_URL = 'unix://{}?db={}'.format(REDIS_HOST, REDIS_QUOTA_DB) + Once done, you can start the policy daemon using the following commands: .. sourcecode:: bash From ff90ea2cbaec655a6b75e9473bd79fedc974d17f Mon Sep 17 00:00:00 2001 From: ianux Date: Wed, 8 May 2024 17:51:37 +0200 Subject: [PATCH 3/3] specify not to use with installer --- doc/upgrade.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/upgrade.rst b/doc/upgrade.rst index 10546a141..8fb5c3a50 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -766,7 +766,7 @@ Add the following settings to your ``settings.py`` file: REDIS_QUOTA_DB = 0 REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB) -Or, if Redis listen on unix socket: +Or, if Redis listen on unix socket and you are not using the Modoboa installer: .. sourcecode:: python