1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-27 00:41:00 +02:00

Enable dynamic resolution of hostnames

This commit is contained in:
Florent Daigniere
2022-12-08 12:46:31 +01:00
parent 1a67921b7c
commit 4e3874b0c1
23 changed files with 94 additions and 164 deletions

View File

@ -6,18 +6,13 @@ import logging as log
import requests
import sys
import time
from socrate import system, conf
from socrate import system,conf
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
system.set_env()
# Actual startup script
os.environ["REDIS_ADDRESS"] = system.get_host_address_from_environment("REDIS", "redis")
os.environ["ADMIN_ADDRESS"] = system.get_host_address_from_environment("ADMIN", "admin")
if os.environ.get("ANTIVIRUS") == 'clamav':
os.environ["ANTIVIRUS_ADDRESS"] = system.get_host_address_from_environment("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)))