From 67b5a603c0b889755db00d0c9cf98ea55f2b1fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Thu, 21 Oct 2021 13:24:49 +0200 Subject: [PATCH] gamja: Use with soju-srht Config.json is now served by soju. --- roles/gamja/files/config.json | 6 ------ roles/gamja/files/gamja.conf | 16 +++++++++++++--- roles/gamja/tasks/main.yml | 8 -------- 3 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 roles/gamja/files/config.json diff --git a/roles/gamja/files/config.json b/roles/gamja/files/config.json deleted file mode 100644 index 64b19f0..0000000 --- a/roles/gamja/files/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "server": { - "url": "wss://gamja.xenrox.net/socket", - "autojoin": "" - } -} diff --git a/roles/gamja/files/gamja.conf b/roles/gamja/files/gamja.conf index bd14096..f5239a8 100644 --- a/roles/gamja/files/gamja.conf +++ b/roles/gamja/files/gamja.conf @@ -7,8 +7,15 @@ server { include /etc/nginx/snippets/https.conf; server_name gamja.xenrox.net; + client_max_body_size 100M; + location / { + if ($http_cookie !~* "sr.ht.unified-login.v1") { + return 302 https://meta.xenrox.net/login?return_to=$scheme://$host$request_uri; + } + root /usr/share/webapps/gamja; + add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';" always; } location /socket { @@ -17,8 +24,11 @@ server { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; + include /etc/nginx/snippets/srht_web.conf; + } + + location /config.json { + proxy_pass https://127.0.0.1:8082; + include /etc/nginx/snippets/srht_web.conf; } } diff --git a/roles/gamja/tasks/main.yml b/roles/gamja/tasks/main.yml index de1b5fa..0708a24 100644 --- a/roles/gamja/tasks/main.yml +++ b/roles/gamja/tasks/main.yml @@ -4,14 +4,6 @@ name: gamja-git state: present -- name: Configure - ansible.builtin.copy: - src: config.json - dest: /usr/share/webapps/gamja/config.json - owner: root - group: root - mode: 0644 - - name: Copy nginx conf ansible.builtin.copy: src: gamja.conf -- 2.44.0