Add a new TLS flavor named 'mail'

This commit is contained in:
kaiyou
2017-11-07 16:16:41 +01:00
parent 5fd29a6593
commit bfa50c5aa7
3 changed files with 7 additions and 1 deletions

View File

@@ -34,10 +34,12 @@ http {
ssl_session_cache shared:SSLHTTP:50m;
add_header Strict-Transport-Security max-age=15768000;
{% if not TLS_FLAVOR == "mail" %}
if ($scheme = http) {
return 301 https://$host$request_uri;
}
{% endif %}
{% endif %}
# In any case, enable the proxy for certbot if the flavor is letsencrypt
{% if TLS_FLAVOR == 'letsencrypt' %}

View File

@@ -2,13 +2,14 @@
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
args["TLS"] = {
"cert": ("/certs/cert.pem", "/certs/key.pem"),
"mail": ("/certs/cert.pem", "/certs/key.pem"),
"letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
"/certs/letsencrypt/live/mailu/privkey.pem"),
"notls": None