caddy: access logs, security headers; dns: CAA records

- (logging) snippet: JSON access log at /data/logs/access.log, rotated,
  tokens/OIDC codes and API key headers masked
- (security_headers)/(no_framing): nosniff, Referrer-Policy and
  X-Frame-Options only where the app sets none; drop Server/X-Powered-By
- (static_site): adds a CSP (base-uri, object-src, frame-ancestors,
  form-action) and Permissions-Policy to the four static sites
- CAA records: Let's Encrypt + ZeroSSL on both domains, Amazon on
  thesatelliteoflove.com for links. (CloudFront/ACM), no wildcards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-27 11:52:22 -07:00
1 parent 0afdd670ff
commit 30bc0a46b4
2 files changed
+133 -23

No files matched your search

+102 -23
View File
@@ -8,55 +8,126 @@
}
}
{{ subdomains.pocketid }} {
# JSON access log shared by every site, in the caddy_data volume
# (/data/logs). Read by humans and, later, CrowdSec. Caddy already redacts
# Cookie/Authorization headers; the filter also masks ?token= (Gotify clients
# put their app token in the query string).
(logging) {
log {
output file /data/logs/access.log {
roll_size 50MiB
roll_keep 10
roll_keep_for 720h
}
format filter {
request>uri query {
replace token REDACTED
replace access_token REDACTED
replace code REDACTED
}
request>headers>X-Gotify-Key replace REDACTED
request>headers>X-Api-Key replace REDACTED
}
}
}
# Headers for proxied apps. "?" only sets a header the app didn't send, so
# apps with their own (stricter) values keep them. Server/X-Powered-By are
# dropped so responses don't advertise software versions.
(security_headers) {
header {
?X-Content-Type-Options nosniff
?Referrer-Policy strict-origin-when-cross-origin
-Server
-X-Powered-By
}
}
# Refuse to be framed by other sites (clickjacking). Not for apps that are
# meant to be embedded elsewhere (HeyForm forms).
(no_framing) {
header ?X-Frame-Options SAMEORIGIN
}
# Static sites: everything above plus a CSP. No default-src so existing
# scripts, styles and images keep working; it blocks plugins, <base>
# hijacking, framing and forms posting off-site.
(static_site) {
import logging
import hsts
import security_headers
header {
Content-Security-Policy "base-uri 'self'; object-src 'none'; frame-ancestors 'self'; form-action 'self'"
X-Frame-Options SAMEORIGIN
Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()"
}
}
# Every proxied site: log, HSTS and the shared headers.
(site) {
import logging
import hsts
import security_headers
}
{{ subdomains.pocketid }} {
import site
import no_framing
reverse_proxy pocket-id:1411
}
paper.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy paperlessngx-webserver-1:8000
}
cal.thesatelliteoflove.com {
import hsts
import site
import no_framing
redir /.well-known/caldav /dav.php 302
redir /.well-known/carddav /dav.php 302
reverse_proxy baikal-baikal-1:80
}
{{ subdomains.books }} {
import hsts
import site
import no_framing
reverse_proxy kavita:5000
}
audio.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy audiobookshelf-audiobookshelf-1:80
}
loclog.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy dawarich_app:3000
}
watcher.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy changedetection:5000
}
snippets.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy bytestash:5000
}
git.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy gitea:3000
}
thesatelliteoflove.com {
import hsts
import static_site
# WebFinger for phil@ serves two readers: the fediverse (GoToSocial's account
# domain is this apex) and Tailscale, which finds the tailnet's login
# provider through the OpenID issuer link.
@@ -76,33 +147,38 @@ thesatelliteoflove.com {
}
bookmarks.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy hoarder-web-1:3000
}
social.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy gotosocial:8080
}
models.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy manyfold-app-1:3214
}
gotify.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy gotify:80
}
gotify-assistant.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy igotify-assistant:8080
}
pdg.thesatelliteoflove.com {
import hsts
import static_site
root * /srv/pdg
# "{path}/" keeps the /dir -> /dir/ redirect; "{path}/index.html" is
# needed for "/" itself, which "{path}/" never matches in Caddy 2.11.
@@ -117,7 +193,8 @@ pdg.thesatelliteoflove.com {
}
starpunk.thesatelliteoflove.com {
import hsts
import site
import no_framing
# MCP endpoint and its OAuth protected resource metadata (StarPunk v2.15.0)
@mcp path /mcp /mcp/* /.well-known/oauth-protected-resource /.well-known/oauth-protected-resource/*
handle @mcp {
@@ -129,34 +206,36 @@ starpunk.thesatelliteoflove.com {
}
repair.nerder.land {
import hsts
import static_site
root * /srv/repair
file_server
}
nerder.land {
import hsts
import static_site
root * /srv/nerderland
file_server
}
forms.nerder.land {
import hsts
import site
reverse_proxy heyform-heyform-1:9157
}
listmonk.nerder.land {
import hsts
import site
import no_framing
reverse_proxy listmonk:9000
}
repaircafe.nerder.land {
import hsts
import site
redir /volunteer-signup https://listmonk.nerder.land/subscription/form 301
}
gokapi.thesatelliteoflove.com {
import hsts
import site
import no_framing
reverse_proxy gokapi:53842
}