diff options
Diffstat (limited to 'roles')
-rw-r--r-- | roles/reverseproxy/tasks/config.yml | 6 | ||||
-rw-r--r-- | roles/reverseproxy/tasks/dirs.yml | 8 | ||||
-rw-r--r-- | roles/reverseproxy/templates/Caddyfile.j2 | 22 | ||||
-rw-r--r-- | roles/reverseproxy/vars/main.yml | 30 |
4 files changed, 33 insertions, 33 deletions
diff --git a/roles/reverseproxy/tasks/config.yml b/roles/reverseproxy/tasks/config.yml index 707eb68..9cec8d8 100644 --- a/roles/reverseproxy/tasks/config.yml +++ b/roles/reverseproxy/tasks/config.yml @@ -24,17 +24,17 @@ - name: Installation de conversejs copy: src: conversejs/ - dest: /var/lib/caddy/chat.casperlefantom.net/ + dest: "/var/lib/caddy/chat.{{ maindomain }}/" # No modes - name: Installation du robots.txt copy: src: robots.txt - dest: /var/lib/caddy/chat.casperlefantom.net + dest: "/var/lib/caddy/chat.{{ maindomain }}" mode: 0644 - name: Installation du index.html template: src: index.html.j2 - dest: /var/lib/caddy/chat.casperlefantom.net + dest: "/var/lib/caddy/chat.{{ maindomain }}/index.html" mode: 0644 diff --git a/roles/reverseproxy/tasks/dirs.yml b/roles/reverseproxy/tasks/dirs.yml index a3ee1c0..24662e8 100644 --- a/roles/reverseproxy/tasks/dirs.yml +++ b/roles/reverseproxy/tasks/dirs.yml @@ -1,12 +1,12 @@ -- name: Création du répertoire casperlefantom.net +- name: Création du répertoire "{{ maindomain }}" file: - path: /var/lib/caddy/casperlefantom.net + path: "/var/lib/caddy/{{ maindomain }}" state: directory mode: 0755 -- name: Création du répertoire chat.casperlefantom.net +- name: Création du répertoire "chat.{{ maindomain }}" file: - path: /var/lib/caddy/chat.casperlefantom.net + path: "/var/lib/caddy/chat.{{ maindomain }}" state: directory mode: 0755 diff --git a/roles/reverseproxy/templates/Caddyfile.j2 b/roles/reverseproxy/templates/Caddyfile.j2 index 65544de..fe9fed6 100644 --- a/roles/reverseproxy/templates/Caddyfile.j2 +++ b/roles/reverseproxy/templates/Caddyfile.j2 @@ -1,7 +1,7 @@ # # {{ ansible_managed }} # -saulnier.im { +{{ secondarydomain }} { file_server header /.well-known/matrix/server { Content-Type application/json @@ -31,11 +31,11 @@ saulnier.im { max_fails 60 } respond /.well-known/matrix/server 200 { - body "{ \"m.server\": \"matrix.saulnier.im:8448\" }" + body "{ \"m.server\": \"matrix.{{ secondarydomain }}:8448\" }" close } respond /.well-known/matrix/client 200 { - body "{\"m.homeserver\": {\"base_url\": \"https://saulnier.im\"},\"m.identity_server\": {\"base_url\": \"https://saulnier.im\"}}" + body "{\"m.homeserver\": {\"base_url\": \"https://{{ secondarydomain }}\"},\"m.identity_server\": {\"base_url\": \"https://{{ secondarydomain }}\"}}" close } @@ -109,7 +109,7 @@ saulnier.im { } {% endfor %} -l.saulnier.im { +l.{{ secondarydomain }} { file_server header { Strict-Transport-Security "max-age=15552000" @@ -121,9 +121,9 @@ l.saulnier.im { } rewrite * /index.php?q={query} - root * /media/nfs1/l.saulnier.im + root * /media/nfs1/l.{{ secondarydomain }} php_fastcgi * localhost:18001 { - root /media/nfs1/l.saulnier.im + root /media/nfs1/l.{{ secondarydomain }} env modHeadersAvailable true lb_policy first # Enable Retries by this setting: @@ -134,7 +134,7 @@ l.saulnier.im { -casperlefantom.net { +{{ maindomain }} { file_server header { Strict-Transport-Security "max-age=15552000" @@ -157,7 +157,7 @@ casperlefantom.net { header_up X-Real-IP {remote} max_fails 60 } - root * /var/lib/caddy/casperlefantom.net + root * /var/lib/caddy/{{ maindomain }} } {% for item in urlchat %} @@ -190,7 +190,7 @@ casperlefantom.net { lb_try_interval 2s } } - root * /var/lib/caddy/chat.casperlefantom.net + root * /var/lib/caddy/chat.{{ maindomain }} } {% endfor %} @@ -218,7 +218,7 @@ casperlefantom.net { Content-Type application/pkix-crl Expires "Tue, 11 Feb 2025 1:37:02 GMT" } - root * /media/nfs1/dl.casperlefantom.net + root * /media/nfs1/dl.{{ maindomain }} } {% endfor %} @@ -233,7 +233,7 @@ casperlefantom.net { X-Permitted-Cross-Domain-Policies "none" -server } - root * /media/nfs1/mirror-2.casperlefantom.net + root * /media/nfs1/mirror-2.{{ maindomain }} } {% endfor %} diff --git a/roles/reverseproxy/vars/main.yml b/roles/reverseproxy/vars/main.yml index 054d15e..486f1a2 100644 --- a/roles/reverseproxy/vars/main.yml +++ b/roles/reverseproxy/vars/main.yml @@ -1,31 +1,31 @@ -redirection: casperlefantom.net +redirection: "{{ maindomain }}" crtversion: "49" agatever: "3.2.4" -websocket: io.casperlefantom.net +websocket: "io.{{ maindomain }}" publicstatic: - - "{{ ansible_hostname }}.casperlefantom.net" - - status-fo.casperlefantom.net + - "{{ ansible_hostname }}.{{ maindomain }}" + - "status-fo.{{ maindomain }}" publicredir: - - www.casperlefantom.net + - "www.{{ maindomain }}" urlfiles: - - files.saulnier.im - - mr.saulnier.im - - mrs.saulnier.im - - matthieu.saulnier.im - - ines.saulnier.im + - "files.{{ secondarydomain }}" + - "mr.{{ secondarydomain }}" + - "mrs.{{ secondarydomain }}" + - "matthieu.{{ secondarydomain }}" + - "ines.{{ secondarydomain }}" urlchat: - - chat.casperlefantom.net + - "chat.{{ maindomain }}" - "{{ websocket }}" - - ines.casperlefantom.net + - "ines.{{ maindomain }}" urldl: - - dl.casperlefantom.net + - "dl.{{ maindomain }}" - "http://uhxfe4e6yc72i6fhexcpk4ph4niueexpy4ckc3wapazxqhv4isejbnyd.onion" urlmirror2: - - mirror-2.casperlefantom.net + - "mirror-2.{{ maindomain }}" - "http://qsi7j4gwqzb7tfqq7t4h7x67j2hcxlybxqksesod7tfjntvbvyoj6zqd.onion" urlcirrus: - - cirrus.casperlefantom.net + - "cirrus.{{ maindomain }}" - "http://hr5nvn34wxtvzkipwsk53u5wo2thqrkmh7sp4f2wcbs664ekqsk5dkqd.onion" |