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