Files
CatoandClaude Opus 5.5 01e49100ca feat(sites): register the sites engine and its Caddy wiring (#1758)
ADR-0001 build steps 3 and 5 (infrastructure half). apps.conf gains the
`sites` row (port 4042, no domains: Caddy routes to it), so the forge-ops
reconciler deploys bitbaum/sites like any app and the name `sites` is
reserved. sites.caddy holds the preview host, the *.orangecat.ch wildcard and
the customer-domain catch-all, all on-demand TLS behind the engine's ask;
install-sites-caddy.sh installs it only after the engine answers and gives
the same ask answer as hirnli's check for every hirnli host, validates, and
can --undo. Validated against the box's full Caddy config on 2026-11-20.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 00:12:45 +01:00

47 lines
1.3 KiB
Plaintext

# The sites engine's addresses (docs/architecture/adr/ADR-0001-the-sites-platform.md, D3).
# Installed as /etc/caddy/apps.d/zz-sites.caddy by install-sites-caddy.sh —
# edit it here, never on the box.
#
# Caddy matches the most specific address first, so every app's own block
# (heidi.orangecat.ch, all of apps.d) keeps winning, and *.orangecat.ch
# matches one label only (*.hirnli.orangecat.ch stays hirnli's). Only names
# with no block of their own reach the engine.
#
# Certificates are issued on demand, one name at a time, and only when the
# global `ask` (the engine's /_sites/ask, which also answers for hirnli) says
# the name is a published site. /_sites/ask itself is loopback-only: the
# public blocks answer it with 404.
(sites_engine) {
import access_log
encode zstd gzip
@sites_internal path /_sites/ask /_sites/ask/*
respond @sites_internal 404
reverse_proxy 127.0.0.1:4042 {
flush_interval -1
lb_try_duration 20s
lb_try_interval 250ms
}
}
# Unpublished versions: https://sites.orangecat.ch/<site id>/…, never indexed.
sites.orangecat.ch {
import sites_engine
}
# Published sites on their free address.
*.orangecat.ch {
tls {
on_demand
}
import sites_engine
}
# Customers' own domains (site_domains, verified by DNS before the row is written).
https:// {
tls {
on_demand
}
import sites_engine
}