feat: duckdns finally working
This commit is contained in:
parent
f50eccd6ac
commit
60bf7df899
|
|
@ -17,6 +17,8 @@
|
||||||
name:
|
name:
|
||||||
- htop
|
- htop
|
||||||
- vim
|
- vim
|
||||||
|
- just
|
||||||
|
- unzip
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Include Docker installation tasks
|
- name: Include Docker installation tasks
|
||||||
|
|
@ -24,3 +26,6 @@
|
||||||
|
|
||||||
- name: Copy the project to the VM
|
- name: Copy the project to the VM
|
||||||
include_tasks: tasks/copy-to-vm.yml
|
include_tasks: tasks/copy-to-vm.yml
|
||||||
|
|
||||||
|
- name: Start all services
|
||||||
|
include_tasks: tasks/start.yml
|
||||||
|
|
|
||||||
22
ansible/playbooks/start-chatons.yml
Normal file
22
ansible/playbooks/start-chatons.yml
Normal 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
|
||||||
29
ansible/playbooks/tasks/restart.yml
Normal file
29
ansible/playbooks/tasks/restart.yml
Normal 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
|
||||||
29
ansible/playbooks/tasks/start.yml
Normal file
29
ansible/playbooks/tasks/start.yml
Normal 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
|
||||||
|
|
@ -3,8 +3,8 @@ services:
|
||||||
container_name: caddy
|
container_name: caddy
|
||||||
image: library/caddy
|
image: library/caddy
|
||||||
ports:
|
ports:
|
||||||
- "8081:80"
|
- "80:80"
|
||||||
#- "443:443"
|
- "443:443"
|
||||||
volumes:
|
volumes:
|
||||||
- caddy-caddyfiles:/etc/caddy
|
- caddy-caddyfiles:/etc/caddy
|
||||||
- caddy-data:/data
|
- caddy-data:/data
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
{
|
{
|
||||||
local_certs
|
local_certs
|
||||||
|
default_bind 0.0.0.0
|
||||||
}
|
}
|
||||||
|
|
||||||
import sites/*.caddy
|
import sites/*.caddy
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
http://diagrams.ft-chatons.local {
|
diagrams.chatons.duckdns.org {
|
||||||
root * /srv/diagrams
|
root * /srv/diagrams
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
http://keycloak.ft-chatons.local {
|
keycloak.chatons.duckdns.org {
|
||||||
reverse_proxy keycloak:8080
|
reverse_proxy keycloak:8080
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
http://outils.ft-chatons.local {
|
outils.chatons.duckdns.org {
|
||||||
header X-Chatons "miaou"
|
header X-Chatons "miaou"
|
||||||
|
|
||||||
respond /healthcheck "OK"
|
respond /healthcheck "OK"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
http://doh.ft-chatons.local {
|
http://doh.chatons.duckdns.org {
|
||||||
|
|
||||||
tls internal
|
tls internal
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
http://vogsphere.ft-chatons.local {
|
vogsphere.chatons.duckdns.org {
|
||||||
reverse_proxy gitea:3000
|
reverse_proxy gitea:3000
|
||||||
}
|
}
|
||||||
11
core/duckdns/compose.yml
Normal file
11
core/duckdns/compose.yml
Normal 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
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DRAWIO_VERSION="29.5.2"
|
DRAWIO_VERSION="29.5.2"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DOMAIN_NAME="http://outils.ft-chatons.local:8080"
|
DOMAIN_NAME="https://outils.chatons.duckdns.org"
|
||||||
DIAGRAM_DOMAIN_NAME="http://diagrams.ft-chatons.local:8080"
|
DIAGRAM_DOMAIN_NAME="https://diagrams.chatons.duckdns.org"
|
||||||
|
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
|
|
@ -23,9 +23,9 @@ test_endpoint() {
|
||||||
local tmp
|
local tmp
|
||||||
tmp=$(mktemp)
|
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
|
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
|
fi
|
||||||
|
|
||||||
local code
|
local code
|
||||||
|
|
@ -75,7 +75,7 @@ test_endpoint_auth() {
|
||||||
local tmp
|
local tmp
|
||||||
tmp=$(mktemp)
|
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
|
local code
|
||||||
code=$(curl "${curl_args[@]}" 2>/dev/null || echo "000")
|
code=$(curl "${curl_args[@]}" 2>/dev/null || echo "000")
|
||||||
|
|
|
||||||
18
startup
18
startup
|
|
@ -1,30 +1,36 @@
|
||||||
#!/usr/bin/env
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
vm)
|
vm)
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
-enable-kvm -cpu host -smp 4 -m 4G \
|
-enable-kvm -cpu host -smp 4 -m 4G \
|
||||||
-device e1000,netdev=net0 \
|
-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 \
|
-drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd \
|
||||||
-hda ft_chatons.qcow2
|
-hda ft_chatons.qcow2
|
||||||
;;
|
;;
|
||||||
command)
|
vm-command)
|
||||||
ansible -i ansible/inventory ft_chatons -a "$2"
|
ansible -i ansible/inventory ft_chatons -a "$2"
|
||||||
;;
|
;;
|
||||||
setup)
|
vm-setup)
|
||||||
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
ansible-playbook -i ansible/inventory ansible/playbooks/install.yml -K
|
||||||
|
;;
|
||||||
|
vm-re)
|
||||||
|
ansible-playbook -i ansible/inventory ansible/playbooks/start-chatons.yml -K
|
||||||
;;
|
;;
|
||||||
connect)
|
connect)
|
||||||
ssh -p 2222 bapasqui@localhost
|
ssh -p 2222 bapasqui@localhost
|
||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
|
just start duckdns
|
||||||
just start caddy
|
just start caddy
|
||||||
just start doh
|
just start doh
|
||||||
just start postgresql
|
just start postgresql
|
||||||
just start keycloak
|
just start keycloak
|
||||||
|
just start git
|
||||||
;;
|
;;
|
||||||
down)
|
down)
|
||||||
|
just down duckdns
|
||||||
just down caddy
|
just down caddy
|
||||||
just down doh
|
just down doh
|
||||||
just down postgresql
|
just down postgresql
|
||||||
|
|
@ -32,6 +38,7 @@ case "$1" in
|
||||||
just down git
|
just down git
|
||||||
;;
|
;;
|
||||||
clean)
|
clean)
|
||||||
|
just clean duckdns
|
||||||
just clean caddy
|
just clean caddy
|
||||||
just clean doh
|
just clean doh
|
||||||
just clean postgresql
|
just clean postgresql
|
||||||
|
|
@ -39,10 +46,11 @@ case "$1" in
|
||||||
just clean git
|
just clean git
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
|
just re duckdns
|
||||||
just re caddy
|
just re caddy
|
||||||
just re doh
|
just re doh
|
||||||
just re postgresql
|
just re postgresql
|
||||||
just re git
|
just re git
|
||||||
#just re keycloak
|
just re keycloak
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
Loading…
Reference in a new issue