Commit 1771df7b authored by Jérome Perrin's avatar Jérome Perrin

software/caddy-frontend: review caddy-log-access to not overwrite installed paths

We were using caddy-log-access-header to make sure we have at least one
file to include, but this was implemented in a way that the config file
was overwritten.
Reimplement this by using caddy-log-access-empty to create an empty file
when there are no slaves, caddy-log-access otherwise.
parent 3446030d
...@@ -30,7 +30,7 @@ md5sum = 087bd9404cd120bd7602a9fbfcddc064 ...@@ -30,7 +30,7 @@ md5sum = 087bd9404cd120bd7602a9fbfcddc064
[template-slave-list] [template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in filename = templates/apache-custom-slave-list.cfg.in
md5sum = cbe0ee673bf143cd4b874167b14ad22d md5sum = 29a61267959cc9ba7cdcd96fef41641a
[template-slave-configuration] [template-slave-configuration]
filename = templates/custom-virtualhost.conf.in filename = templates/custom-virtualhost.conf.in
......
...@@ -465,11 +465,11 @@ template = inline: ...@@ -465,11 +465,11 @@ template = inline:
rendered = ${:file} rendered = ${:file}
[caddy-log-access-header] [caddy-log-access-empty]
# Caddy refuse to start if an `import`ed file is empty, so we prepend a header # Caddy refuse to start if an `import`ed file is empty, so we prepend a header
# so that the file is never empty. # so that the file is never empty.
< = jinja2-template-base < = jinja2-template-base
template = inline: # This file contain directives to serve directories with log files template = inline: # This file contain directives to serve directories with log files for shared instances, but no shared instances are defined yet.
rendered = {{frontend_configuration.get('log-access-configuration')}} rendered = {{frontend_configuration.get('log-access-configuration')}}
[buildout] [buildout]
...@@ -481,10 +481,12 @@ extends = ...@@ -481,10 +481,12 @@ extends =
parts += parts +=
kedifa-updater kedifa-updater
kedifa-updater-run kedifa-updater-run
caddy-log-access-header
{% for part in part_list %} {% for part in part_list %}
{{ ' %s' % part }} {{ ' %s' % part }}
{% endfor %} {% endfor %}
{% if 'caddy-log-access' not in part_list %}
caddy-log-access-empty
{% endif %}
publish-caddy-information publish-caddy-information
tunnel-6to4-base-http_port tunnel-6to4-base-http_port
tunnel-6to4-base-https_port tunnel-6to4-base-https_port
......
  • Is that commit required for this MR? If no, I propose to cherry-pick it.

    Edited by Łukasz Nowak
  • It's required, because both caddy-log-access and caddy-log-access-header were installing the same etc/apache-log-access.conf file. caddy-log-access-header was here to generate "something" in etc//apache-log-access.conf even when caddy-log-access is not installed because there are not slave.

    Now we have a if 'caddy-log-access' not in part_list to only install this part when there was no slave already installing etc/apache-log-access.conf.

  • Ok, thanks for the background.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment