Simplify caddy config

Move double conditional checking of email provision and staging
environment into single check.
This commit is contained in:
Marty Oehme 2021-10-21 14:27:31 +02:00
parent 7eeeec0489
commit 80185e39dd
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -47,19 +47,13 @@
{ {
"subjects": [], "subjects": [],
"issuers": [ "issuers": [
{
{% if caddy_tls_use_staging is sameas true %} {% if caddy_tls_use_staging is sameas true %}
{
"ca": "https://acme-staging-v02.api.letsencrypt.org/directory", "ca": "https://acme-staging-v02.api.letsencrypt.org/directory",
{%- if caddy_email is not undefined and not none %} {% endif %}
{%- if caddy_email is not undefined and not none %}
"email": "{{ caddy_email }}", "email": "{{ caddy_email }}",
{% endif %} {% endif %}
"module": "acme"
}
{% else %}
{
{%- if caddy_email is not undefined and not none %}
"email": "{{ caddy_email }}",
{% endif %}
"module": "acme" "module": "acme"
}, },
{ {
@ -68,7 +62,6 @@
{% endif %} {% endif %}
"module": "zerossl" "module": "zerossl"
} }
{% endif %}
] ]
} }
] ]