Flexible filenames for TLS via envvars (flavours 'cert' and 'mail' only)

master
Dennis Twardowsky 7 years ago
parent d4cc142f64
commit 50f9f379e9

@ -22,11 +22,13 @@ if "HOST_ANTISPAM" not in args:
args["HOST_ANTISPAM"] = "antispam:11334" args["HOST_ANTISPAM"] = "antispam:11334"
# TLS configuration # TLS configuration
cert_name = os.getenv("TLS_CERT_FILENAME", default="cert.pem")
keypair_name = os.getenv("TLS_KEYPAIR_FILENAME", default="key.pem")
args["TLS"] = { args["TLS"] = {
"cert": ("/certs/cert.pem", "/certs/key.pem"), "cert": ("/certs/%s" % cert_name, "/certs/%s" % keypair_name),
"letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem", "letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
"/certs/letsencrypt/live/mailu/privkey.pem"), "/certs/letsencrypt/live/mailu/privkey.pem"),
"mail": ("/certs/cert.pem", "/certs/key.pem"), "mail": ("/certs/%s" % cert_name, "/certs/%s" % keypair_name),
"mail-letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem", "mail-letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
"/certs/letsencrypt/live/mailu/privkey.pem"), "/certs/letsencrypt/live/mailu/privkey.pem"),
"notls": None "notls": None

Loading…
Cancel
Save