mirror of
https://github.com/bitbaum/sites.git
synced 2026-12-04 04:56:58 +01:00
feat/import-export-compare
The apex before www, path kept, method and body kept (308, as apps do). Checked locally: camille.orangecat.ch/catering → 308 https://camille.example/catering once the domain is verified, both hosts serve, the ask approves the domain, and removing the row restores the free address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sites
One engine for every bitbaum data site: a site that is a row in Loki's
database, not a repository of its own. The engine picks the site by the
request's domain, loads its published version, and renders it with
@bitbaum/sitekit.
Design: loki docs/architecture/adr/ADR-0001-the-sites-platform.md.
What it answers
| Address | Shows |
|---|---|
<slug>.orangecat.ch |
the published version of the site with that slug |
| a customer's own domain | the published version of the site it is verified for (site_domains) |
sites.orangecat.ch/<site id>/… |
the working (preview) version, never indexed |
localhost:<port>/ |
sites engine — the deploy's health probe |
/_sites/ask?domain= |
Caddy's on-demand TLS check: 200 only for a host this engine serves, else whatever SITES_ASK_FALLBACK (hirnli's tenant check) says |
/_sites/fonts/… |
the webfont files, copied from @bitbaum/design-tokens into public/ before each build |
Everything else is a 404. A row that does not parse is a 404 and a log line, never a broken page.
What it never does
- Write. It connects with a SELECT-only role. Loki is the only writer, so a Loki outage stops editing, not serving.
- Know the app list. Apps keep their own Caddy blocks, which win over the wildcard; Loki refuses a site on an app's name.
- Fetch a font from a third party.
Environment
| Variable | |
|---|---|
SITES_DATABASE_URL |
Loki's database, as the read-only sites_reader role |
SITES_BASE_DOMAIN |
default orangecat.ch |
SITES_PREVIEW_HOST |
default sites.<base> |
SITES_ASK_FALLBACK |
the ask URL Caddy used before (hirnli), for names this engine does not serve |
Verify
pnpm run verify # format, typecheck, lint, tests — what the merge check runs
Languages
TypeScript
82.2%
JavaScript
15.8%
CSS
2%