Commit 84cceddd authored by eteri's avatar eteri

caddy: improve caddy configuration

parent 16ccc2c1
$${caddy-configuration:ip}:$${caddy-configuration:port}
\ No newline at end of file
[buildout]
parts =
caddy-service
caddy-configuration
publish-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[directory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
bin = $${buildout:directory}/bin
srv = $${buildout:directory}/srv
var = $${buildout:directory}/var
run = $${:var}/run
log = $${:var}/log
#www = $${:srv}/www
#ssl = $${:etc}/ssl
#################################
# caddy service
#################################
[caddy-service]
recipe = slapos.recipe.template
url = ${template-caddy-service:output}
output = $${directory:services}/caddy
mode = 0700
virtual-depends =
$${caddy-configuration:ip}
[caddy-configuration]
recipe = slapos.recipe.template
url = ${template-Caddyfile:output}
output = $${directory:etc}/Caddyfile
mode = 0600
access_log = $${directory:log}/caddy-access.log
error_log = $${directory:log}/caddy-error.log
ip = $${slap-network-information:global-ipv6}
local_ip = $${slap-network-information:local-ipv4}
port = 9443
[publish-connection-information]
recipe = slapos.cookbook:publish
url = $${caddy-configuration:ip}
\ No newline at end of file
......@@ -2,11 +2,14 @@
extends =
../../component/caddy/buildout.cfg
../../stack/slapos.cfg
../../component/dash/buildout.cfg
parts =
golang19
slapos-cookbook
instance-profile
template-caddy-service
template-caddy
caddy
[instance-profile]
......@@ -25,6 +28,27 @@ directory = ${buildout:directory}/go.work
src = ${:directory}/src
bin = ${:directory}/bin
[template-caddy-service]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template-caddy-service.sh.in
md5sum = 61da5aea191595962ab020b4197b5390
output = ${buildout:directory}/template-caddy-service.sh.in
mode = 0644
[template-caddy]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-caddy.cfg.in
md5sum = 06ae4dccd5c8557ddb51be8adbb1d6c0
output = ${buildout:directory}/instance-caddy.cfg.in
mode = 0644
[template-Caddyfile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/Caddyfile.in
md5sum = 0bc8e72f2748e22446f850f157321a8c
output = ${buildout:directory}/Caddyfile.in
mode = 0644
[caddy]
recipe = slapos.recipe.cmmi
path = ${caddy-repository:location}
......@@ -35,3 +59,4 @@ make-binary = cd ${:path}/caddy && ${:go} install -v
environment =
PATH=${pkgconfig:location}/bin:${golang19:location}/bin:${buildout:bin-directory}:%(PATH)s
GOPATH=${gopath:directory}
path-to-bin = ${gopath:bin}/caddy
\ No newline at end of file
#!${dash-output:dash}
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec ${caddy:path-to-bin}
-conf $${caddy-configuration:output}
\ No newline at end of file
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