mirror of
https://github.com/Mailu/Mailu.git
synced 2025-03-17 20:57:54 +02:00
Merge #1014
1014: Fixed hardcoded antispam and antivirus host addresses r=mergify[bot] a=ajgon ## What type of PR? enchancement ## What does this PR do? Adds configurable parameters `HOST_ANTISPAM` and `HOST_ANTIVIRUS` for `core/dovecot` and `services/rspamd`, instead of using hardcoded container names. ### Related issue(s) - closes #978 Co-authored-by: Igor Rzegocki <igor@rzegocki.pl> Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com>
This commit is contained in:
commit
f3f0c3190b
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
tee >(rspamc -h antispam:11334 -P mailu learn_ham /dev/stdin) \
|
||||
| rspamc -h antispam:11334 -P mailu -f 13 fuzzy_add /dev/stdin
|
||||
tee >(rspamc -h ${ANTISPAM_ADDRESS} -P mailu learn_ham /dev/stdin) \
|
||||
| rspamc -h ${ANTISPAM_ADDRESS} -P mailu -f 13 fuzzy_add /dev/stdin
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
tee >(rspamc -h antispam:11334 -P mailu learn_spam /dev/stdin) \
|
||||
>(rspamc -h antispam:11334 -P mailu -f 11 fuzzy_add /dev/stdin)
|
||||
tee >(rspamc -h ${ANTISPAM_ADDRESS} -P mailu learn_spam /dev/stdin) \
|
||||
>(rspamc -h ${ANTISPAM_ADDRESS} -P mailu -f 11 fuzzy_add /dev/stdin)
|
||||
|
@ -24,6 +24,7 @@ def start_podop():
|
||||
os.environ["FRONT_ADDRESS"] = system.resolve_address(os.environ.get("HOST_FRONT", "front"))
|
||||
os.environ["REDIS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_REDIS", "redis"))
|
||||
os.environ["ADMIN_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ADMIN", "admin"))
|
||||
os.environ["ANTISPAM_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ANTISPAM", "antispam:11334"))
|
||||
if os.environ["WEBMAIL"] != "none":
|
||||
os.environ["WEBMAIL_ADDRESS"] = system.resolve_address(os.environ.get("HOST_WEBMAIL", "webmail"))
|
||||
|
||||
|
@ -147,6 +147,7 @@ optional port number. Those variables are:
|
||||
- ``HOST_AUTHSMTP``: the container that is running the authenticated SMTP server for the webnmail (default: ``smtp``, port 10025)
|
||||
- ``HOST_ADMIN``: the container that is running the admin interface (default: ``admin``)
|
||||
- ``HOST_ANTISPAM``: the container that is running the antispam service (default: ``antispam:11334``)
|
||||
- ``HOST_ANTIVIRUS``: the container that is running the antivirus service (default: ``antivirus:3310``)
|
||||
- ``HOST_WEBMAIL``: the container that is running the webmail (default: ``webmail``)
|
||||
- ``HOST_WEBDAV``: the container that is running the webdav server (default: ``webdav:5232``)
|
||||
- ``HOST_REDIS``: the container that is running the redis daemon (default: ``redis``)
|
||||
|
@ -165,4 +165,5 @@
|
||||
HOST_ADMIN: "admin.mailu-mailserver.svc.cluster.local"
|
||||
HOST_WEBDAV: "webdav.mailu-mailserver.svc.cluster.local:5232"
|
||||
HOST_ANTISPAM: "antispam.mailu-mailserver.svc.cluster.local:11332"
|
||||
HOST_ANTIVIRUS: "antivirus.mailu-mailserver.svc.cluster.local:3310"
|
||||
HOST_REDIS: "redis.mailu-mailserver.svc.cluster.local"
|
||||
|
@ -3,6 +3,6 @@ clamav {
|
||||
attachments_only = true;
|
||||
symbol = "CLAM_VIRUS";
|
||||
type = "clamav";
|
||||
servers = "antivirus:3310";
|
||||
servers = "{{ ANTIVIRUS_ADDRESS }}";
|
||||
}
|
||||
{% endif %}
|
||||
|
@ -9,9 +9,12 @@ from socrate import system, conf
|
||||
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
|
||||
|
||||
# Actual startup script
|
||||
|
||||
os.environ["FRONT_ADDRESS"] = system.resolve_address(os.environ.get("HOST_FRONT", "front"))
|
||||
os.environ["REDIS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_REDIS", "redis"))
|
||||
|
||||
if os.environ.get("ANTIVIRUS") == 'clamav':
|
||||
os.environ["ANTIVIRUS_ADDRESS"] = system.resolve_address(os.environ.get("HOST_ANTIVIRUS", "antivirus:3310"))
|
||||
|
||||
for rspamd_file in glob.glob("/conf/*"):
|
||||
conf.jinja(rspamd_file, os.environ, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
|
||||
|
1
towncrier/newsfragments/979.feature
Normal file
1
towncrier/newsfragments/979.feature
Normal file
@ -0,0 +1 @@
|
||||
Fixed hardcoded antispam and antivirus host addresses
|
Loading…
x
Reference in New Issue
Block a user