Changed user for dkim management

This commit is contained in:
Spitap
2023-07-21 11:34:16 +02:00
parent 06b13fcce0
commit 41bc987515
5 changed files with 9 additions and 34 deletions
+4 -14
View File
@@ -166,21 +166,11 @@ and add the RQ section bellow the ``#REDIS`` section:
# RQ
RQ_QUEUES = {
'default': {
'dkim': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
},
'high': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
},
'low': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
}
}
Then by default you will need to restart ``uwsgi`` service (``systemctl restart uwsgi`` on Debian).
@@ -192,9 +182,9 @@ Then by default you will need to restart ``uwsgi`` service (``systemctl restart
[program:modoboa-worker]
autostart=true
autorestart=true
command={%python env path%} {% manage.py instance path%} rqworker high default low
command={%python env path%} {% manage.py instance path%} rqworker dkim
directory={%modoboa home dir%}
user=%{modoboa user}
user=%{dkim manager user}
numprocs=1
stopsignal=TERM
@@ -204,7 +194,7 @@ You will find it here ``/srv/modoboa/venv/bin/python`` by default.
You will find it here : ``/srv/modoboa/instance/manage.py``by default.
``Modoboa home dir``: Home dir of the user running modooba.
You will find it here ``/srv/modoboa/`` by default.
``modoboa user`` : User owning modoboa home dir.
``dkim manager user`` : User managing dkim signing (opendkim by default).
You can help you with ``/etc/supervisor/conf.d/policyd.conf`` (by default).
+1 -1
View File
@@ -16,7 +16,7 @@ services:
DEBUG: "True"
REDIS_HOST: redis
command: >
sh -c "cd test_project; python3 manage.py rqworker high default low"
sh -c "cd test_project; python3 manage.py rqworker dkim"
volumes:
- .:/code
+2 -1
View File
@@ -51,7 +51,8 @@ def update_domain_mxs_and_mailboxes(sender, instance, **kwargs):
def create_dkim_key(sender, instance, **kwargs):
if not instance.enable_dkim:
return
django_rq.enqueue(call_command,
queue = django_rq.get_queue('dkim')
queue.enqueue(call_command,
"modo",
"manage_dkim_keys",
f"--domain={instance.name}")
@@ -257,21 +257,11 @@ REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB)
# RQ
RQ_QUEUES = {
'default': {
'dkim': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
},
'high': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
},
'low': {
'HOST': REDIS_HOST,
'PORT': REDIS_PORT,
'DB': 0,
}
}
# Password validation
+1 -7
View File
@@ -240,15 +240,9 @@ REDIS_URL = 'redis://{}:{}/{}'.format(REDIS_HOST, REDIS_PORT, REDIS_QUOTA_DB)
# RQ
RQ_QUEUES = {
'default': {
'dkim': {
'URL': REDIS_URL,
},
'high': {
'URL': REDIS_URL,
},
'low': {
'URL': REDIS_URL,
}
}
# Password validation