Commit 946f16f7 authored by Jérome Perrin's avatar Jérome Perrin

caddy-frontend: Make sure etc/log-access.conf is never empty

When there are no shared instances, the file was empty, but caddy
refuses to start when using an import statement on an empty file, with
this error:

```
Error during parsing: Could not read tokens while importing .../etc/log-access.conf: EOF
```

/reviewed-on !545
parent 51c7a651
......@@ -30,7 +30,7 @@ md5sum = 37edefdb9963daa67b01e5d55d97c17d
[template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
md5sum = 61919290d810518eba2e74e821dc9de8
md5sum = f9efdfe7a7e3a78f0b15f414b5469316
[template-slave-configuration]
filename = templates/custom-virtualhost.conf.in
......
......@@ -475,6 +475,13 @@ template = inline:
rendered = ${:file}
[caddy-log-access-header]
# Caddy refuse to start if an `import`ed file is empty, so we prepend a header
# so that the file is never empty.
< = jinja2-template-base
template = inline: # This file contain directives to serve directories with log files
rendered = {{frontend_configuration.get('log-access-configuration')}}
[buildout]
extends =
{{ common_profile }}
......@@ -482,6 +489,7 @@ extends =
parts +=
kedifa-updater
caddy-log-access-header
{% for part in part_list %}
{{ ' %s' % part }}
{% endfor %}
......
T-0/var/log/monitor-httpd-error.log
T-0/var/log/slapgrid-T-0-error.log
T-1/var/log/expose-csr_id.log
T-2/var/log/frontend-access.log
T-2/var/log/frontend-error.log
T-2/var/log/httpd-csr_id/expose-csr_id.log
T-2/var/log/nginx-access.log
T-2/var/log/nginx-error.log
......
......@@ -4,6 +4,7 @@ T-1/var/run/kedifa.pid
T-2/var/run/caddy_graceful_signature
T-2/var/run/caddy_validate_signature
T-2/var/run/caddy_validate_signature.status
T-2/var/run/httpd.pid
T-2/var/run/monitor/monitor-bootstrap.pid
T-2/var/run/nginx.pid
T-2/var/run/nginx_graceful_signature
......
......@@ -4,13 +4,13 @@ T-0/etc/plugin/monitor-bootstrap-status.py: OK
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py: OK
T-2/etc/plugin/buildout-T-2-status.py: OK
T-2/etc/plugin/caddy_cached.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_http.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_https.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_http.py: OK
T-2/etc/plugin/caddy_frontend_ipv4_https.py: OK
T-2/etc/plugin/caddy_frontend_ipv6_http.py: OK
T-2/etc/plugin/caddy_frontend_ipv6_https.py: OK
T-2/etc/plugin/caddy_ssl_cached.py: ERROR
T-2/etc/plugin/check-free-disk-space.py: OK
T-2/etc/plugin/frontend-caddy-configuration-promise.py: ERROR
T-2/etc/plugin/frontend-caddy-configuration-promise.py: OK
T-2/etc/plugin/monitor-bootstrap-status.py: OK
T-2/etc/plugin/monitor-httpd-listening-on-tcp.py: OK
T-2/etc/plugin/nginx-configuration-promise.py: OK
......
......@@ -20,7 +20,7 @@ T-2:crond-{hash}-on-watch RUNNING
T-2:expose-csr_id-{hash}-on-watch RUNNING
T-2:frontend-caddy-safe-graceful EXITED
T-2:frontend-nginx-safe-graceful EXITED
T-2:frontend_caddy-{hash}-on-watch EXITED
T-2:frontend_caddy-{hash}-on-watch RUNNING
T-2:frontend_nginx-{hash}-on-watch RUNNING
T-2:kedifa-login-certificate-caucase-updater-on-watch RUNNING
T-2:kedifa-updater-{hash}-on-watch RUNNING
......
T-0/var/log/monitor-httpd-error.log
T-0/var/log/slapgrid-T-0-error.log
T-1/var/log/expose-csr_id.log
T-2/var/log/frontend-access.log
T-2/var/log/frontend-error.log
T-2/var/log/httpd-csr_id/expose-csr_id.log
T-2/var/log/nginx-access.log
T-2/var/log/nginx-error.log
......
......@@ -4,6 +4,7 @@ T-1/var/run/kedifa.pid
T-2/var/run/caddy_graceful_signature
T-2/var/run/caddy_validate_signature
T-2/var/run/caddy_validate_signature.status
T-2/var/run/httpd.pid
T-2/var/run/monitor/monitor-bootstrap.pid
T-2/var/run/nginx.pid
T-2/var/run/nginx_graceful_signature
......
......@@ -4,13 +4,13 @@ T-0/etc/plugin/monitor-bootstrap-status.py: OK
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py: OK
T-2/etc/plugin/buildout-T-2-status.py: OK
T-2/etc/plugin/caddy_cached.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_http.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_https.py: ERROR
T-2/etc/plugin/caddy_frontend_ipv4_http.py: OK
T-2/etc/plugin/caddy_frontend_ipv4_https.py: OK
T-2/etc/plugin/caddy_frontend_ipv6_http.py: OK
T-2/etc/plugin/caddy_frontend_ipv6_https.py: OK
T-2/etc/plugin/caddy_ssl_cached.py: ERROR
T-2/etc/plugin/check-free-disk-space.py: OK
T-2/etc/plugin/frontend-caddy-configuration-promise.py: ERROR
T-2/etc/plugin/frontend-caddy-configuration-promise.py: OK
T-2/etc/plugin/monitor-bootstrap-status.py: OK
T-2/etc/plugin/monitor-httpd-listening-on-tcp.py: OK
T-2/etc/plugin/nginx-configuration-promise.py: OK
......
......@@ -20,7 +20,7 @@ T-2:crond-{hash}-on-watch RUNNING
T-2:expose-csr_id-{hash}-on-watch RUNNING
T-2:frontend-caddy-safe-graceful EXITED
T-2:frontend-nginx-safe-graceful EXITED
T-2:frontend_caddy-{hash}-on-watch EXITED
T-2:frontend_caddy-{hash}-on-watch RUNNING
T-2:frontend_nginx-{hash}-on-watch RUNNING
T-2:kedifa-login-certificate-caucase-updater-on-watch RUNNING
T-2:kedifa-updater-{hash}-on-watch RUNNING
......
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