diff --git a/start.sh b/start.sh index bee3f83..27e684b 100644 --- a/start.sh +++ b/start.sh @@ -42,6 +42,19 @@ https://bw.{\$NC_DOMAIN}:443 { CADDY fi +if [ -n "$(dig A +short nextcloud-aio-stalwart)" ] && ! grep -q "mail.$NC_DOMAIN" /Caddyfile; then + cat << CADDY >> /Caddyfile +https://mail.{\$NC_DOMAIN}:443 { + # TLS options + tls { + issuer acme { + disable_http_challenge + } + } +} +CADDY +fi + mkdir -p /data/caddy-imports if ! grep -q "/data/caddy-imports" /Caddyfile; then echo 'import /data/caddy-imports/*' >> /Caddyfile