diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py index f7040788..def48930 100644 --- a/core/admin/mailu/configuration.py +++ b/core/admin/mailu/configuration.py @@ -83,11 +83,11 @@ class ConfigManager(dict): self.config = dict() def resolve_host(self): - self.config['HOST_IMAP'] = resolve(self.config['HOST_IMAP']) - self.config['HOST_POP3'] = resolve(self.config['HOST_POP3']) - self.config['HOST_AUTHSMTP'] = resolve(self.config['HOST_AUTHSMTP']) - self.config['HOST_SMTP'] = resolve(self.config['HOST_SMTP']) - self.config['HOST_REDIS'] = resolve(self.config['HOST_REDIS']) + self.config['IMAP_ADDRESS'] = resolve(self.config['HOST_IMAP']) + self.config['POP3_ADDRESS'] = resolve(self.config['HOST_POP3']) + self.config['AUTHSMTP_ADDRESS'] = resolve(self.config['HOST_AUTHSMTP']) + self.config['SMTP_ADDRESS'] = resolve(self.config['HOST_SMTP']) + self.config['REDIS_ADDRESS'] = resolve(self.config['HOST_REDIS']) def __coerce_value(self, value): if isinstance(value, str) and value.lower() in ('true','yes'): @@ -111,8 +111,8 @@ class ConfigManager(dict): template = self.DB_TEMPLATES[self.config['DB_FLAVOR']] self.config['SQLALCHEMY_DATABASE_URI'] = template.format(**self.config) - self.config['RATELIMIT_STORAGE_URL'] = 'redis://{0}/2'.format(self.config['HOST_REDIS']) - self.config['QUOTA_STORAGE_URL'] = 'redis://{0}/1'.format(self.config['HOST_REDIS']) + self.config['RATELIMIT_STORAGE_URL'] = 'redis://{0}/2'.format(self.config['REDIS_ADDRESS']) + self.config['QUOTA_STORAGE_URL'] = 'redis://{0}/1'.format(self.config['REDIS_ADDRESS']) # update the app config itself app.config = self diff --git a/core/nginx/conf/nginx.conf b/core/nginx/conf/nginx.conf index 7107a351..0e89324a 100644 --- a/core/nginx/conf/nginx.conf +++ b/core/nginx/conf/nginx.conf @@ -41,10 +41,10 @@ http { # Favicon stuff root /static; # Variables for proxifying - set $admin {{ HOST_ADMIN }}; - set $antispam {{ HOST_ANTISPAM }}; - set $webmail {{ HOST_WEBMAIL }}; - set $webdav {{ HOST_WEBDAV }}; + set $admin {{ ADMIN_ADDRESS }}; + set $antispam {{ ANTISPAM_ADDRESS }}; + set $webmail {{ WEBMAIL_ADDRESS }}; + set $webdav {{ WEBDAV_ADDRESS }}; # Always listen over HTTP listen 80; @@ -168,7 +168,7 @@ http { # Forwarding authentication server server { # Variables for proxifying - set $admin {{ HOST_ADMIN }}; + set $admin {{ ADMIN_ADDRESS }}; listen 127.0.0.1:8000; diff --git a/core/nginx/config.py b/core/nginx/config.py index 78c76345..0e22766e 100755 --- a/core/nginx/config.py +++ b/core/nginx/config.py @@ -14,14 +14,14 @@ with open("/etc/resolv.conf") as handle: content = handle.read().split() args["RESOLVER"] = content[content.index("nameserver") + 1] -args["HOST_ADMIN"] = resolve(args.get("HOST_ADMIN", "admin")) -args["HOST_ANTISPAM"] = resolve(args.get("HOST_ANTISPAM", "antispam:11334")) +args["ADMIN_ADDRESS"] = resolve(args.get("HOST_ADMIN", "admin")) +args["ANTISPAM_ADDRESS"] = resolve(args.get("HOST_ANTISPAM", "antispam:11334")) args["HOST_WEBMAIL"] = args.get("HOST_WEBMAIL", "webmail") if args["WEBMAIL"] != "none": - args["HOST_WEBMAIL"] = resolve(args.get("HOST_WEBMAIL")) + args["WEBMAIL_ADDRESS"] = resolve(args.get("HOST_WEBMAIL")) args["HOST_WEBDAV"] = args.get("HOST_WEBDAV", "webdav:5232") if args["WEBDAV"] != "none": - args["HOST_WEBDAV"] = resolve(args.get("HOST_WEBDAV")) + args["WEBDAV_ADDRESS"] = resolve(args.get("HOST_WEBDAV")) # TLS configuration cert_name = os.getenv("TLS_CERT_FILENAME", default="cert.pem") diff --git a/core/postfix/conf/main.cf b/core/postfix/conf/main.cf index d5d47d19..ea3219a2 100644 --- a/core/postfix/conf/main.cf +++ b/core/postfix/conf/main.cf @@ -65,7 +65,7 @@ virtual_mailbox_maps = ${podop}mailbox # Mails are transported if required, then forwarded to Dovecot for delivery relay_domains = ${podop}transport transport_maps = ${podop}transport -virtual_transport = lmtp:inet:{{ HOST_LMTP }} +virtual_transport = lmtp:inet:{{ LMTP_ADDRESS }} # In order to prevent Postfix from running DNS query, enforce the use of the # native DNS stack, that will check /etc/hosts properly. @@ -104,7 +104,7 @@ unverified_recipient_reject_reason = Address lookup failure # Milter ############### -smtpd_milters = inet:{{ HOST_ANTISPAM }} +smtpd_milters = inet:{{ ANTISPAM_ADDRESS }} milter_protocol = 6 milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} milter_default_action = tempfail diff --git a/core/postfix/start.py b/core/postfix/start.py index 716b3edb..2dd537f7 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -28,8 +28,8 @@ def start_podop(): # Actual startup script os.environ["FRONT_ADDRESS"] = resolve(os.environ.get("HOST_FRONT", "front")) os.environ["ADMIN_ADDRESS"] = resolve(os.environ.get("HOST_ADMIN", "admin")) -os.environ["HOST_ANTISPAM"] = resolve(os.environ.get("HOST_ANTISPAM", "antispam:11332")) -os.environ["HOST_LMTP"] = resolve(os.environ.get("HOST_LMTP", "imap:2525")) +os.environ["ANTISPAM_ADDRESS"] = resolve(os.environ.get("HOST_ANTISPAM", "antispam:11332")) +os.environ["LMTP_ADDRESS"] = resolve(os.environ.get("HOST_LMTP", "imap:2525")) for postfix_file in glob.glob("/conf/*.cf"): convert(postfix_file, os.path.join("/etc/postfix", os.path.basename(postfix_file))) diff --git a/services/rspamd/conf/history_redis.conf b/services/rspamd/conf/history_redis.conf index fee07024..053f9dd2 100644 --- a/services/rspamd/conf/history_redis.conf +++ b/services/rspamd/conf/history_redis.conf @@ -1 +1 @@ -servers = "{{ HOST_REDIS }}"; +servers = "{{ REDIS_ADDRESS }}"; diff --git a/services/rspamd/conf/redis.conf b/services/rspamd/conf/redis.conf index fee07024..053f9dd2 100644 --- a/services/rspamd/conf/redis.conf +++ b/services/rspamd/conf/redis.conf @@ -1 +1 @@ -servers = "{{ HOST_REDIS }}"; +servers = "{{ REDIS_ADDRESS }}"; diff --git a/services/rspamd/start.py b/services/rspamd/start.py index 78e2f37d..34a49604 100755 --- a/services/rspamd/start.py +++ b/services/rspamd/start.py @@ -10,7 +10,7 @@ log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) # Actual startup script os.environ["FRONT_ADDRESS"] = resolve(os.environ.get("HOST_FRONT", "front")) -os.environ["HOST_REDIS"] = resolve(os.environ.get("HOST_REDIS", "redis")) +os.environ["REDIS_ADDRESS"] = resolve(os.environ.get("HOST_REDIS", "redis")) for rspamd_file in glob.glob("/conf/*"): convert(rspamd_file, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))