Merge pull request #3247 from yannfill/redis_socket

Documenting use of Redis socket and fixing configuration
This commit is contained in:
Spitfireap
2024-05-10 10:51:58 +00:00
committed by GitHub
2 changed files with 16 additions and 2 deletions
+9
View File
@@ -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
@@ -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,
},
}