From 6bf2f0ee998cdb2240b9b80c273e8be8a1a7eac5 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Thu, 23 Feb 2023 21:48:37 +0000 Subject: [PATCH] [WIP] Ergo IRCd + Gamja for chat --- ergo/config.yml | 20 ++++++++++++++++++++ ergo/gamja-config.json | 6 ++++++ nginx/chat-live-umm-gay.conf | 29 +++++++++++++++++++++++++++++ nginx/live-umm-gay.conf | 21 ++++----------------- 4 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 ergo/config.yml create mode 100644 ergo/gamja-config.json create mode 100644 nginx/chat-live-umm-gay.conf diff --git a/ergo/config.yml b/ergo/config.yml new file mode 100644 index 0000000..bce2fc1 --- /dev/null +++ b/ergo/config.yml @@ -0,0 +1,20 @@ +network: + name: live.umm.gay + +server: + name: chat.live.umm.gay + + listeners: + "127.0.0.1:3002": + websocket: true + + websockets: + allowed-origins: + - "https://chat.live.umm.gay" + - "https://live.umm.gay" + + casemapping: "permissive" + enforce-utf8: true + +accounts: + authentication-enabled: false diff --git a/ergo/gamja-config.json b/ergo/gamja-config.json new file mode 100644 index 0000000..0bd14af --- /dev/null +++ b/ergo/gamja-config.json @@ -0,0 +1,6 @@ +{ + "server": { + "url": "wss://chat.live.umm.gay/webirc", + "auth": "disabled" + } +} diff --git a/nginx/chat-live-umm-gay.conf b/nginx/chat-live-umm-gay.conf new file mode 100644 index 0000000..81ea2f8 --- /dev/null +++ b/nginx/chat-live-umm-gay.conf @@ -0,0 +1,29 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name chat.live.umm.gay; + + ssl_certificate /etc/letsencrypt/live/chat.live.umm.gay/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/chat.live.umm.gay/privkey.pem; + + location / { + root /srv/www/chat.live.umm.gay; + } + + location /webirc { + proxy_pass http://127.0.0.1:3002/; + + proxy_http_version 1.1; + proxy_read_timeout 600s; + 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; + } +} diff --git a/nginx/live-umm-gay.conf b/nginx/live-umm-gay.conf index d5987cd..2611504 100644 --- a/nginx/live-umm-gay.conf +++ b/nginx/live-umm-gay.conf @@ -1,8 +1,3 @@ -map $http_upgrade $connection_upgrade { - default upgrade; - '' close; -} - server { listen 443 ssl http2; listen [::]:443 ssl http2; @@ -12,19 +7,11 @@ server { ssl_certificate /etc/letsencrypt/live/live.umm.gay/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/live.umm.gay/privkey.pem; - location / { - proxy_pass http://127.0.0.1:3000/; - } - location ^~ /api/wish-server/ { proxy_pass http://127.0.0.1:3001/; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header Host $host; - proxy_connect_timeout 1d; - proxy_send_timeout 1d; - proxy_read_timeout 1d; + } + + location ^~ / { + proxy_pass http://127.0.0.1:3000/; } }