Commit 70a936fc authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Commonize caddy-wrapper

As caddy is quite hard configured from command line, create share place to store
the configuration.
parent 62115f77
......@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e
[template-apache-frontend]
filename = instance-apache-frontend.cfg
md5sum = 4dd6b303ef4d48d02e50baae2a3b0868
md5sum = c1788e86063b9dffc0c024be06456679
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
......
......@@ -247,9 +247,13 @@ extra-context =
key slave_with_cache_configuration_directory caddy-directory:slave-with-cache-configuration
section frontend_configuration frontend-configuration
[caddy-wrapper-common]
command-line = ${caddy:output}
-conf $${dynamic-apache-frontend-template:rendered}
[apache-frontend]
recipe = slapos.cookbook:wrapper
command-line = ${caddy:output} -conf $${dynamic-apache-frontend-template:rendered}
command-line = $${caddy-wrapper-common:command-line}
wrapper-path = $${directory:service}/frontend_caddy
wait-for-files =
$${ca-frontend:cert-file}
......@@ -279,7 +283,7 @@ error-log = $${directory:log}/frontend-apache-error.log
pid-file = $${directory:run}/httpd.pid
protected-path = /
access-control-string = none
frontend-configuration-verification = ${caddy:output} -validate -conf $${:frontend-configuration} > /dev/null
frontend-configuration-verification = $${caddy-wrapper-common:command-line} -validate > /dev/null
frontend-graceful-command = $${:frontend-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${:pid-file}); fi
# Comunication with ats
......@@ -290,7 +294,7 @@ ssl-cache-through-port = 26012
# Create wrapper for "apachectl conftest" in bin
[configtest]
recipe = slapos.cookbook:wrapper
command-line = ${caddy:output} -conf $${apache-configuration:frontend-configuration} -validate
command-line = $${caddy-wrapper-common:command-line} -validate
wrapper-path = $${directory:bin}/caddy-configtest
[certificate-authority]
......
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