add: caddy config
This commit is contained in:
parent
b405eb4a14
commit
fb2fa75f90
0
core/caddy/buildtime.env
Normal file
0
core/caddy/buildtime.env
Normal file
|
|
@ -1,4 +1,5 @@
|
||||||
services:
|
services:
|
||||||
|
caddy:
|
||||||
container_name: caddy
|
container_name: caddy
|
||||||
image: caddy:2.10.2-alpine
|
image: caddy:2.10.2-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
@ -10,7 +11,7 @@ services:
|
||||||
- caddy-data:/data
|
- caddy-data:/data
|
||||||
- caddy-config:/config
|
- caddy-config:/config
|
||||||
networks:
|
networks:
|
||||||
- web
|
- proxy
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
caddy-caddyfiles:
|
caddy-caddyfiles:
|
||||||
|
|
@ -19,5 +20,5 @@ volumes:
|
||||||
caddy-config:
|
caddy-config:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
web:
|
proxy:
|
||||||
name: web
|
name: proxy
|
||||||
|
|
|
||||||
25
core/caddy/config/Caddyfile
Normal file
25
core/caddy/config/Caddyfile
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
outils.localhost {
|
||||||
|
local_certs
|
||||||
|
header X-Chatons "miaou"
|
||||||
|
|
||||||
|
respond /healthcheck "OK"
|
||||||
|
#handle_path or handle are the same except you need to prefix things instead of already having it uri strip_prefix /prefix
|
||||||
|
handle_path /hello/* {
|
||||||
|
respond "Hello {path.0}!"
|
||||||
|
close
|
||||||
|
}
|
||||||
|
handle /date {
|
||||||
|
respond "{http.date} {http.time}"
|
||||||
|
close
|
||||||
|
}
|
||||||
|
handle /ip {
|
||||||
|
respond {{.ClientIP}}
|
||||||
|
|
||||||
|
}
|
||||||
|
handle_path /b64/encode {
|
||||||
|
|
||||||
|
}
|
||||||
|
handle_path /b64/decode {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
1
core/caddy/tools/setup-config
Normal file
1
core/caddy/tools/setup-config
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
11
run
11
run
|
|
@ -1,6 +1,15 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
vm)
|
||||||
|
qemu-system-x86_64 \
|
||||||
|
-nographic -serial mon:stdio \
|
||||||
|
-enable-kvm -cpu host -smp 4 -m 4G \
|
||||||
|
-device e1000,netdev=net0 \
|
||||||
|
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
|
||||||
|
-drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
|
||||||
|
-hda ft_chatons.qcow2
|
||||||
|
;;
|
||||||
command)
|
command)
|
||||||
ansible -i ansible/inventory ft_chatons -a "$2"
|
ansible -i ansible/inventory ft_chatons -a "$2"
|
||||||
;;
|
;;
|
||||||
|
|
@ -8,7 +17,7 @@ case "$1" in
|
||||||
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|delete|status|logs|restart|scale}"
|
echo "Usage: $0 {vm|command|setup} [command]"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue