feat: duckdns finally working

This commit is contained in:
Haletran 2026-03-02 15:31:24 +01:00
parent f50eccd6ac
commit 60bf7df899
15 changed files with 124 additions and 18 deletions

View file

@ -17,6 +17,8 @@
name:
- htop
- vim
- just
- unzip
state: present
- name: Include Docker installation tasks
@ -24,3 +26,6 @@
- name: Copy the project to the VM
include_tasks: tasks/copy-to-vm.yml
- name: Start all services
include_tasks: tasks/start.yml

View file

@ -0,0 +1,22 @@
---
- name: Configure ft_chatons base VM
hosts: ft_chatons
become: yes
tasks:
- name: Delete old project
file:
path: "/home/{{ ansible_user }}/projects/ft_chatons"
state: absent
- name: Copy the project to the VM
include_tasks: tasks/copy-to-vm.yml
- name: Ensure project directory exists
file:
path: "/home/{{ ansible_user }}/projects/ft_chatons"
state: directory
mode: '0755'
become: no
- name: Re all services
include_tasks: tasks/restart.yml

View file

@ -0,0 +1,29 @@
- name: re duckdns
command: just re duckdns
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: re caddy
command: just re caddy
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: re doh
command: just re doh
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: re postgresql
command: just re postgresql
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: re keycloak
command: just re keycloak
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: re git
command: just re git
args:
chdir: /home/bapasqui/projects/ft_chatons

View file

@ -0,0 +1,29 @@
- name: Start duckdns
command: just start duckdns
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: Start caddy
command: just start caddy
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: Start doh
command: just start doh
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: Start postgresql
command: just start postgresql
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: Start keycloak
command: just start keycloak
args:
chdir: /home/bapasqui/projects/ft_chatons
- name: Start git
command: just start git
args:
chdir: /home/bapasqui/projects/ft_chatons

View file

@ -3,8 +3,8 @@ services:
container_name: caddy
image: library/caddy
ports:
- "8081:80"
#- "443:443"
- "80:80"
- "443:443"
volumes:
- caddy-caddyfiles:/etc/caddy
- caddy-data:/data

View file

@ -1,4 +1,6 @@
{
local_certs
default_bind 0.0.0.0
}
import sites/*.caddy

View file

@ -1,4 +1,4 @@
http://diagrams.ft-chatons.local {
diagrams.chatons.duckdns.org {
root * /srv/diagrams
file_server
}

View file

@ -1,3 +1,3 @@
http://keycloak.ft-chatons.local {
keycloak.chatons.duckdns.org {
reverse_proxy keycloak:8080
}

View file

@ -1,4 +1,4 @@
http://outils.ft-chatons.local {
outils.chatons.duckdns.org {
header X-Chatons "miaou"
respond /healthcheck "OK"

View file

@ -1,4 +1,4 @@
http://doh.ft-chatons.local {
http://doh.chatons.duckdns.org {
tls internal

View file

@ -1,3 +1,3 @@
http://vogsphere.ft-chatons.local {
vogsphere.chatons.duckdns.org {
reverse_proxy gitea:3000
}

11
core/duckdns/compose.yml Normal file
View file

@ -0,0 +1,11 @@
services:
duckdns:
image: linuxserver/duckdns:latest
container_name: duckdns
environment:
PUID: "1000"
PGID: "1000"
TZ: "Europe/Paris"
SUBDOMAINS: "chatons"
TOKEN: "7b3c8e72-17b9-4b80-a81b-628d1e74127e"
restart: always

View file

@ -1,4 +1,4 @@
#!/usr/bin/env
#!/usr/bin/env bash
DRAWIO_VERSION="29.5.2"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
DOMAIN_NAME="http://outils.ft-chatons.local:8080"
DIAGRAM_DOMAIN_NAME="http://diagrams.ft-chatons.local:8080"
DOMAIN_NAME="https://outils.chatons.duckdns.org"
DIAGRAM_DOMAIN_NAME="https://diagrams.chatons.duckdns.org"
GREEN='\033[0;32m'
RED='\033[0;31m'
@ -23,9 +23,9 @@ test_endpoint() {
local tmp
tmp=$(mktemp)
local curl_args=(-s -o "$tmp" -w "%{http_code}" "$url")
local curl_args=(-s -k -o "$tmp" -w "%{http_code}" "$url")
if [ "$follow_redirects" = "true" ]; then
curl_args=(-s -L -o "$tmp" -w "%{http_code}" "$url")
curl_args=(-s -k -L -o "$tmp" -w "%{http_code}" "$url")
fi
local code
@ -75,7 +75,7 @@ test_endpoint_auth() {
local tmp
tmp=$(mktemp)
local curl_args=(-s -o "$tmp" -w "%{http_code}" -u "$username:$password" "$url")
local curl_args=(-s -k -o "$tmp" -w "%{http_code}" -u "$username:$password" "$url")
local code
code=$(curl "${curl_args[@]}" 2>/dev/null || echo "000")

18
startup
View file

@ -1,30 +1,36 @@
#!/usr/bin/env
#!/usr/bin/env bash
case "$1" in
vm)
qemu-system-x86_64 \
-enable-kvm -cpu host -smp 4 -m 4G \
-device e1000,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
-netdev user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::80-:80,hostfwd=tcp::443-:443 \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
-hda ft_chatons.qcow2
;;
command)
vm-command)
ansible -i ansible/inventory ft_chatons -a "$2"
;;
setup)
vm-setup)
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
;;
vm-re)
ansible-playbook -i ansible/inventory ansible/playbooks/start-chatons.yml -K
;;
connect)
ssh -p 2222 bapasqui@localhost
;;
start)
just start duckdns
just start caddy
just start doh
just start postgresql
just start keycloak
just start git
;;
down)
just down duckdns
just down caddy
just down doh
just down postgresql
@ -32,6 +38,7 @@ case "$1" in
just down git
;;
clean)
just clean duckdns
just clean caddy
just clean doh
just clean postgresql
@ -39,10 +46,11 @@ case "$1" in
just clean git
;;
restart)
just re duckdns
just re caddy
just re doh
just re postgresql
just re git
#just re keycloak
just re keycloak
;;
esac