diff --git a/doc/upgrade.rst b/doc/upgrade.rst index c5e1c0dfc..8fb5c3a50 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 and you are not using the Modoboa installer: + +.. 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 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, }, }