feat(rsvp): deploy rsvp.debyl.io, the invite-only party RSVP app

A single Go binary with SQLite, built and loaded as localhost/rsvpd:<VERSION>
by make deploy-remote in ~/src/rsvp-debylio. Both of its listeners are
published on 127.0.0.1 only: Caddy proxies the public one to everyone and the
admin one (/admin, no login) only to caddy_local_networks. A Caddyfile mistake
alone cannot expose admin, and neither can a port mistake alone.

Guests' invite links are the credential and they sit in the URL path, which
shapes the vhost:

- It does not import common_headers. That snippet sets Referrer-Policy
  same-origin, which would replace the app's no-referrer and let a token leak
  in a Referer header.
- Its access log rewrites request>uri to /i/REDACTED and drops the Location
  response header, since every POST 303s back to /i/<token>.
- Caddy's error logger is separate from the site's and wrote the raw URI to
  caddy.log when the upstream was down. The global log now excludes
  http.log.error.rsvp and a filtered rsvp-errors logger takes it instead.
  Verified with zero token occurrences in both logs, locally and live.

The data directory is owned directly by the host uid of the container's uid
10001 (subuid + 10000). Setting it to the podman user and chowning back each run
flipped ownership on every deploy and briefly locked the app out of its
database.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Bastian de Byl
2026-09-13 23:14:46 -04:00
co-authored by Claude Opus 5
parent a9f51b77e1
commit f59ade748b
4 changed files with 135 additions and 0 deletions
@@ -23,6 +23,26 @@
}
format {{ caddy_log_format }}
level {{ caddy_log_level }}
# See rsvp-errors below.
exclude http.log.error.rsvp
}
# {{ rsvp_server_name }}: when a proxied request fails, Caddy's error log
# records the raw request URI -- which for /i/<token> is a working invite
# link. Send those through the same redaction as the site's access log
# instead of the default log above.
log rsvp-errors {
output file /var/log/caddy/rsvp.log {
roll_size {{ caddy_log_roll_size }}
roll_keep {{ caddy_log_roll_keep }}
roll_keep_for {{ caddy_log_roll_keep_for }}
}
format filter {
wrap json
request>uri regexp ^/i/[^/?#]+ /i/REDACTED
request>headers>Referer delete
}
include http.log.error.rsvp
}
}
@@ -193,6 +213,56 @@
}
}
# RSVP - {{ rsvp_server_name }} (public invite links, LAN-only /admin)
#
# Does NOT import common_headers: its Referrer-Policy "same-origin" would
# replace the app's "no-referrer", and invite tokens live in the URL path.
{{ rsvp_server_name }} {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Robots-Tag "noindex, nofollow"
Referrer-Policy "no-referrer"
Content-Security-Policy "default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:; form-action 'self'; frame-ancestors 'none'"
X-Content-Type-Options "nosniff"
-Server
}
# Admin is a second listener with no login. It is only published on
# loopback, and only proxied here for LAN clients -- two independent controls.
@admin_local {
path /admin /admin/*
remote_ip {{ caddy_local_networks | join(' ') }}
}
handle @admin_local {
reverse_proxy 127.0.0.1:{{ rsvp_admin_port }}
}
handle /admin* {
respond "Not found" 404
}
handle {
reverse_proxy 127.0.0.1:{{ rsvp_public_port }}
}
# The invite token is the credential and it is in the URL path, so redact
# it from the request URI and drop the redirect Location (POSTs 303 back to
# /i/<token>) before anything is written. Named "rsvp" so its error logger
# (http.log.error.rsvp) can be redirected in the global options.
log rsvp {
output file /var/log/caddy/rsvp.log {
roll_size {{ caddy_log_roll_size }}
roll_keep {{ caddy_log_roll_keep }}
roll_keep_for {{ caddy_log_roll_keep_for }}
}
format filter {
wrap json
request>uri regexp ^/i/[^/?#]+ /i/REDACTED
request>headers>Referer delete
resp_headers>Location delete
}
}
}
# Uptime Kuma (Debyltech) - {{ uptime_kuma_server_name }}
{{ uptime_kuma_server_name }} {
{{ ip_restricted_site() }}