From f118b3636c941fca5d346df3dd94d0a89c25bbb8 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 2 Dec 2025 21:28:32 -0500 Subject: add lounge role --- roles/lounge/templates/error.html | 37 +++++++++++++++++++ roles/lounge/templates/nginx-site-config | 63 ++++++++++++++++++++++++++++++++ roles/lounge/templates/thelounge.service | 11 ++++++ 3 files changed, 111 insertions(+) create mode 100644 roles/lounge/templates/error.html create mode 100644 roles/lounge/templates/nginx-site-config create mode 100644 roles/lounge/templates/thelounge.service (limited to 'roles/lounge/templates') diff --git a/roles/lounge/templates/error.html b/roles/lounge/templates/error.html new file mode 100644 index 0000000..5e2a093 --- /dev/null +++ b/roles/lounge/templates/error.html @@ -0,0 +1,37 @@ + + + + + {{lounge_domain}} currently unavailable + + + +

Web-based chat is currently unavailable (code 502)

+ +

The web-based IRC interface will be available during {{emacsconf_name}} {{emacsconf_year}}. Please check back then. In the meantime, you can also connect to {{irc_network}}:{{irc_port}} with your favorite IRC client and join {{irc_channels}}. + +

This page will refresh when the site is back. You can also check status.emacsconf.org for updates.

+ + + + + + + diff --git a/roles/lounge/templates/nginx-site-config b/roles/lounge/templates/nginx-site-config new file mode 100644 index 0000000..cc6aa4d --- /dev/null +++ b/roles/lounge/templates/nginx-site-config @@ -0,0 +1,63 @@ +upstream backend { + server 127.0.0.1:9000; +} + +proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=thelounge_cache:10m max_size=3g inactive=120m use_temp_path=off; + + +server { + listen 80; + listen [::]:80; + server_name chat.emacsconf.org; + + include snippets/well-known-acme-challenge.conf; + + location /js-licenses.html { root /var/www/{{lounge_domain}}; } + + location / { + return 302 https://$server_name$request_uri; + } +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name {{lounge_domain}}; + + include /etc/nginx/tls/{{emacsconf_domain}}.conf; + + location /js-licenses.html { root /var/www/{{lounge_domain}}; } + error_page 502 /error.html; + location = /error.html { + root /var/www/{{lounge_domain}}; + } + location / { + proxy_pass http://backend; + proxy_http_version 1.1; + proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + + # by default nginx times out connections in one minute + proxy_read_timeout 1d; + } + +} + +#server { +# listen 443 ssl http2; +# listen [::]:443 ssl http2; +# server_name chat.emacsconf.org; +# +# include /etc/nginx/tls/emacsconf.org.conf; +# root /var/www/chat.emacsconf.org; +#} + +server { + listen 80; + listen [::]:80; + server_name chat.emacsconf.com chat.emacsconf.net; + + return 302 $scheme://{{lounge_domain}}$request_uri; +} diff --git a/roles/lounge/templates/thelounge.service b/roles/lounge/templates/thelounge.service new file mode 100644 index 0000000..abc4868 --- /dev/null +++ b/roles/lounge/templates/thelounge.service @@ -0,0 +1,11 @@ +[Unit] +Description=The Lounge IRC Client +After=network.target + +[Service] +ExecStart=/usr/bin/thelounge start +User=thelounge +WorkingDirectory=/var/lib/thelounge + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3