Skip to content

Commit 185d3da

Browse files
ralyodioclaude
andcommitted
fix(caddy): generate the chat.<host> 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 <[email protected]>
1 parent 55d517f commit 185d3da

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

setup.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ ASK_ADDR="${ASK_ADDR:-127.0.0.1:8081}" # agentbbs on-demand-TLS ask endpoint (
3333
HTTP_ADDR="${HTTP_ADDR:-127.0.0.1:8088}" # agentbbs /verify endpoint (join@ email confirmation links)
3434
FILES_WEB_ADDR="${FILES_WEB_ADDR:-127.0.0.1:8092}" # agentbbs web file browser (Caddy fronts files.${DOMAIN#*.})
3535
FILES_DOMAIN="${FILES_DOMAIN:-files.${DOMAIN#*.}}" # web file browser host (default: files.<root-of-DOMAIN>)
36+
CHAT="${CHAT:-1}" # set 0 to drop the chat.<root> Caddy route to The Lounge web IRC client
37+
CHAT_DOMAIN="${CHAT_DOMAIN:-chat.${DOMAIN#*.}}" # The Lounge web IRC host (default: chat.<root-of-DOMAIN>)
38+
CHAT_ADDR="${CHAT_ADDR:-127.0.0.1:9000}" # The Lounge loopback (the thelounge docker container publishes this)
3639
GO_VERSION="${GO_VERSION:-1.26.4}"
3740
POD_IMAGE="${POD_IMAGE:-docker.io/library/ubuntu:24.04}"
3841
FETCH_ASSETS="${FETCH_ASSETS:-1}" # set 0 to skip the DOOM/Freedoom arcade assets
@@ -700,6 +703,21 @@ ${FILES_DOMAIN} {
700703
}
701704
"
702705

706+
# Web IRC client (${CHAT_DOMAIN}): Caddy fronts The Lounge, which runs as a
707+
# separately-provisioned docker container (thelounge/thelounge) publishing
708+
# ${CHAT_ADDR}. setup.sh does NOT manage the container — only this route, so a
709+
# deploy that regenerates the Caddyfile no longer drops chat (it used to). Needs
710+
# A record ${CHAT_DOMAIN} -> this host. Returns 502 if the container isn't up.
711+
CHAT_SITE=""
712+
if [ "$CHAT" = "1" ]; then
713+
CHAT_SITE="
714+
${CHAT_DOMAIN} {
715+
encode zstd gzip
716+
reverse_proxy ${CHAT_ADDR}
717+
}
718+
"
719+
fi
720+
703721
cat > /etc/caddy/Caddyfile <<CADDY
704722
{
705723
email ${ACME_EMAIL}
@@ -743,7 +761,7 @@ ${DOMAIN} {
743761
file_server
744762
}
745763
}
746-
${GIT_SITE}${NEWS_SITE}${IRC_SITE}${MAIL_SITE}${FILES_SITE}
764+
${GIT_SITE}${NEWS_SITE}${IRC_SITE}${MAIL_SITE}${FILES_SITE}${CHAT_SITE}
747765
# Free per-user homepages at <name>.${DOMAIN} (needs wildcard DNS
748766
# *.${DOMAIN} -> this host). On-demand TLS mints a cert only when agentbbs's
749767
# ask endpoint confirms <name> is a registered member, so random subdomains

0 commit comments

Comments
 (0)