T4: Ianitor anywhere (Linux, Docker, Windows in Caddy mode), branch previews for Fabrica, team sign-in #10
Reference in New Issue
Block a user
Delete Branch "feature/t4-anywhere"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T4 of Fabrica's coherence roadmap (
docs/32_coherence.md): Ianitor runs for any small team, not only on Mark's NixOS server, and gives Fabrica a preview address for every branch. Builds on domi-pki v1.0.0 (PR #9).What
docs/previews.md):POST /api/v1/previews {project, branch, upstream, ttl}→<branch>--<project>.<preview domain>, with a Domi or Let's Encrypt certificate. Closed byPOST /api/v1/previews/close(on merge),DELETE /api/v1/previews/{host}, or by itself when its TTL runs out. A preview is an ordinary host file with a[preview]table, so it goes through validation, both compilers, the diff suite and the commit-confirmed apply.scope = previews):403 token.scopeon every other route. Previews may only point at[previews] upstreams; control's port, Caddy's admin port, unspecified, link-local, multicast and IPv4-mapped addresses never.preview::labelmakes one safe LDH label (≤ 62, no--at positions 3–4), hashing the original where anything was lost, so different branches never share a host; refuses control characters and over-long names.services.ianitor.previews.docs/deploy/anywhere.md.__Host-session cookie, admin/member roles, Tessera roots with Fundamentum's match code. Authelia still works.101; it no longer does (Caddy never did).Tests (tests first where the risk is)
tests/preview.rs: hostile branch names (unicode, dots, length, IDNA, traversal) → safe labels; no two of 6000 similar branches share a label; the[preview]table must match the host name; compilers ignore it.tests/previews.rs: a preview token cannot touch non-preview hosts (21 routes refused, no take-over of a non-preview host at the preview's name, only its own file changes); cannot point at admin ports; lifecycle incl. expiry; bad requests.tests/caddy_mode.rs: a preview answers through Caddy without an edge (admin over TCP, Domi certificate) and is gone after close.tests/team.rs: setup, invites, roles, CSRF, sign-out, last admin.-NoService, Caddy mode), Docker (compose, Pingora), Linux (installer under systemd in a container). See the ROADMAP handover.Self-review (adversarial)
/api/v1/previews/are refused. ✔urlcrate as core, sohttp://2130706433:20001,0x7f.1and[::ffff:127.0.0.1]normalise before the check (loopback → admin-port check; mapped → refused). Names are checked as written: a listed name that resolves to loopback would pass. Documented; admins should list only names they control.409 preview.taken; DELETE/close only act on preview hosts. ✔X-Ianitor-UIand a same-origin fetch. The sign-in door is rate-limited server-wide (20/min), so someone spamming it can slow real sign-ins for a minute; acceptable for a 2–10 person team, noted.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.