add: start of doh ex06
This commit is contained in:
parent
3474548912
commit
2ad9b6bf9c
|
|
@ -1,9 +0,0 @@
|
||||||
FROM alpine:3.21
|
|
||||||
|
|
||||||
RUN apk add --no-cache wget unzip
|
|
||||||
|
|
||||||
COPY config/ /caddyfiles/
|
|
||||||
COPY init.sh /init.sh
|
|
||||||
RUN chmod +x /init.sh
|
|
||||||
|
|
||||||
CMD ["/init.sh"]
|
|
||||||
8
core/caddy/config/sites/unbound.caddy
Normal file
8
core/caddy/config/sites/unbound.caddy
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
http://doh.ft-chatons.local {
|
||||||
|
|
||||||
|
tls internal
|
||||||
|
|
||||||
|
handle /dns-query {
|
||||||
|
reverse_proxy doh:8053
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cp -r /caddyfiles/. /etc/caddy/
|
|
||||||
echo "Caddyfiles copied."
|
|
||||||
|
|
||||||
if [ -z "$DRAWIO_VERSION" ]; then
|
|
||||||
echo "ERROR: DRAWIO_VERSION is not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Downloading diagrams.net v${DRAWIO_VERSION}..."
|
|
||||||
mkdir -p /srv/diagrams
|
|
||||||
|
|
||||||
wget -v \
|
|
||||||
"https://github.com/jgraph/drawio/releases/download/v${DRAWIO_VERSION}/draw.war" \
|
|
||||||
-O /tmp/drawio.war
|
|
||||||
|
|
||||||
echo "Extracting..."
|
|
||||||
unzip -q /tmp/drawio.war -d /srv/diagrams/
|
|
||||||
rm /tmp/drawio.war
|
|
||||||
echo "Done."
|
|
||||||
8
core/doh/compose.yml
Normal file
8
core/doh/compose.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
services:
|
||||||
|
doh:
|
||||||
|
container_name: doh
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy:
|
||||||
|
name: proxy
|
||||||
|
external: true
|
||||||
18
justfile
18
justfile
|
|
@ -3,18 +3,26 @@ default:
|
||||||
|
|
||||||
## Start the compose of the param
|
## Start the compose of the param
|
||||||
start container="":
|
start container="":
|
||||||
docker compose -f core/{{container}}/compose.yml up -d
|
#!/bin/sh
|
||||||
|
if [ "{{container}}" = "caddy" ]; then
|
||||||
|
bash core/tools/caddy-init.sh
|
||||||
|
fi
|
||||||
|
docker compose -f core/{{container}}/compose.yml up -d
|
||||||
|
|
||||||
## Stop the compose of the param
|
## Stop the compose of the param
|
||||||
down container="caddy":
|
down container="":
|
||||||
docker compose -f core/{{container}}/compose.yml down
|
docker compose -f core/{{container}}/compose.yml down
|
||||||
|
|
||||||
## Restart all the compose
|
## Delete all container, volumes, etc...
|
||||||
re: down
|
clean container="": (down container)
|
||||||
docker volume rm $(docker volume ls -q) || true
|
docker volume rm $(docker volume ls -q) || true
|
||||||
docker system prune -af
|
docker system prune -af
|
||||||
docker volume prune -f
|
docker volume prune -f
|
||||||
just start caddy
|
|
||||||
|
|
||||||
|
## Restart all the compose
|
||||||
|
re container="": (down container) (clean container)
|
||||||
|
just start {{container}}
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
bash core/tools/test-caddy
|
bash core/tools/test-caddy
|
||||||
|
|
|
||||||
25
run
25
run
|
|
@ -1,25 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
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)
|
|
||||||
ansible -i ansible/inventory ft_chatons -a "$2"
|
|
||||||
;;
|
|
||||||
setup)
|
|
||||||
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {vm|command|setup} [command]"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
33
startup
Normal file
33
startup
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env
|
||||||
|
|
||||||
|
local opt=$1
|
||||||
|
|
||||||
|
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)
|
||||||
|
ansible -i ansible/inventory ft_chatons -a "$2"
|
||||||
|
;;
|
||||||
|
setup)
|
||||||
|
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
||||||
|
;;
|
||||||
|
start)
|
||||||
|
just start caddy
|
||||||
|
just start doh
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
just stop caddy
|
||||||
|
just stop doh
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
just re caddy
|
||||||
|
just re doh
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Loading…
Reference in a new issue