From 185d3da2f93289bed8e2394da3c578c275baea5a Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Tue, 23 Jun 2026 16:07:32 +0000 Subject: [PATCH] fix(caddy): generate the chat. site so deploys stop dropping The Lounge The chat.profullstack.com Caddy block was only ever appended manually, so every setup.sh deploy (which rewrites the whole Caddyfile) silently dropped it and broke https://chat.profullstack.com (fell into the on-demand-TLS catch-all whose ask endpoint denies it -> TLS handshake aborts). Generate it like the mail/news/ files sites (CHAT=1 toggle, CHAT_DOMAIN/CHAT_ADDR). The Lounge container is still provisioned out-of-band; this only owns the route. Co-Authored-By: Claude Opus 4.8 --- setup.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index dbd3bc5..57175db 100755 --- a/setup.sh +++ b/setup.sh @@ -33,6 +33,9 @@ ASK_ADDR="${ASK_ADDR:-127.0.0.1:8081}" # agentbbs on-demand-TLS ask endpoint ( HTTP_ADDR="${HTTP_ADDR:-127.0.0.1:8088}" # agentbbs /verify endpoint (join@ email confirmation links) FILES_WEB_ADDR="${FILES_WEB_ADDR:-127.0.0.1:8092}" # agentbbs web file browser (Caddy fronts files.${DOMAIN#*.}) FILES_DOMAIN="${FILES_DOMAIN:-files.${DOMAIN#*.}}" # web file browser host (default: files.) +CHAT="${CHAT:-1}" # set 0 to drop the chat. Caddy route to The Lounge web IRC client +CHAT_DOMAIN="${CHAT_DOMAIN:-chat.${DOMAIN#*.}}" # The Lounge web IRC host (default: chat.) +CHAT_ADDR="${CHAT_ADDR:-127.0.0.1:9000}" # The Lounge loopback (the thelounge docker container publishes this) GO_VERSION="${GO_VERSION:-1.26.4}" POD_IMAGE="${POD_IMAGE:-docker.io/library/ubuntu:24.04}" FETCH_ASSETS="${FETCH_ASSETS:-1}" # set 0 to skip the DOOM/Freedoom arcade assets @@ -700,6 +703,21 @@ ${FILES_DOMAIN} { } " +# Web IRC client (${CHAT_DOMAIN}): Caddy fronts The Lounge, which runs as a +# separately-provisioned docker container (thelounge/thelounge) publishing +# ${CHAT_ADDR}. setup.sh does NOT manage the container — only this route, so a +# deploy that regenerates the Caddyfile no longer drops chat (it used to). Needs +# A record ${CHAT_DOMAIN} -> this host. Returns 502 if the container isn't up. +CHAT_SITE="" +if [ "$CHAT" = "1" ]; then + CHAT_SITE=" +${CHAT_DOMAIN} { + encode zstd gzip + reverse_proxy ${CHAT_ADDR} +} +" +fi + cat > /etc/caddy/Caddyfile <.${DOMAIN} (needs wildcard DNS # *.${DOMAIN} -> this host). On-demand TLS mints a cert only when agentbbs's # ask endpoint confirms is a registered member, so random subdomains