Commit e67ba43c by Łukasz Nowak Committed by Łukasz Nowak

caddy-frontend: Protect against losing custom_domain

In some cases domain can come from "outside" of the profile, and be filled
with "garbage", so if custom_domain is set, do not overwrite it.
1 parent 10ba7376
......@@ -30,7 +30,7 @@ md5sum = 99ec567c429ff82571d08818eaaed390
[template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
md5sum = d2e0132dded2f65e3590c72a154f6dd6
md5sum = 3faad78c80b0e9235849f0b5346eebbc
[template-slave-configuration]
filename = templates/custom-virtualhost.conf.in
......
......@@ -117,7 +117,9 @@ output = {{ plugin_directory }}/${:name}
{% if enable_cache and 'url' in slave_instance %}
{% if 'domain' in slave_instance %}
{% do slave_instance.__setitem__('custom_domain', slave_instance.get('domain')) %}
{% if not slave_instance.get('custom_domain') %}
{% do slave_instance.__setitem__('custom_domain', slave_instance.get('domain')) %}
{% endif %}
{% endif %}
{% do slave_instance.__setitem__('backend_url', slave_instance.get('url')) %}
{% do slave_instance.__setitem__('https_backend_url', slave_instance.get('https-url', slave_instance.get('url'))) %}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!