[repo] Phase 3: web UI, Domi CA, NixOS module #5

Manually merged
mnovak merged 34 commits from phase-3 into main 2026-11-08 12:57:58 +01:00
Owner

Phase 3 of docs/ROADMAP.md: the web UI, the Domi CA and the NixOS module.

What is in it

  • Web UI: apps/web and packages/ui, a Svelte 5 UI built from the designer's hand-off (docs/ui-handoff.md, decisions in docs/ui-decisions.md). It uses the murex palette, self-hosts its fonts and makes no outside requests. A vitest smoke test counts the clicks for every §4 flow.
  • Domi CA (docs/pki.md):
    • ECDSA P-256; the root is made offline; the intermediate key is encrypted at rest.
    • Server certificates last 90 days, device certificates 1 year, never past the intermediate.
    • Device mTLS works in edge and in Caddy.
    • Control refuses to start if its state dir holds a private key it does not expect.
  • §8.6 answered: Custos cannot sign a CSR. The ticket is in docs/custos-ticket.md (not filed). Until then the intermediate is signed by hand with openssl, and device requests are approved with pki approve.
  • UI sign-in (G14): a per-boot proof secret that only the admin host behind Authelia sends. Control trusts Remote-User only together with it, and refuses the proof header on any other host.
  • Engine switch at runtime through polkit. Changes keep working under Caddy:
    • trials load through Caddy's admin socket;
    • the watch probes upstreams with edge's rules;
    • a revert comes from control, from a deadline guard unit, or from ExecStopPost after a crash.
    • Share links are off under Caddy.
  • Test hooks: behind the default test-hooks feature; the Nix release build is checked to contain none.
  • Nix: flake.nix with .#ianitor, .#ianitor-web and nixosModules.ianitor; four VM tests; deploy/test-access.sh.
  • Server change (prepared, not applied): docs/deploy/configuration-server.patch and beside-caddy.md, for flowers.stage and esp32.stage on the staging mirror, plus the Let's Encrypt staging check.

Verification (WSL2 Debian and Windows, head of this branch)

  • cargo test --workspace: 240 passed, 0 failed.

    Crate Passed
    core 103
    edge 57
    control 75
    diff 4
    testkit 1
  • Lint and hook: fmt, clippy -D warnings and clippy --no-default-features are clean; the hook self-test passes 55/55.

  • Web: vitest 15/15; svelte-check reports 0 errors and 0 warnings.

  • Nix: nix build .#ianitor and .#ianitor-web build, and so do the drivers of all four VM tests (reported by the build agent).

Adversarial self-review

Four QC rounds and two design reviews. Every Major was fixed with a red test first.

  • Round 1:
    • an admin host without forward-auth would let anyone sign in as anyone;
    • a device revocation lost silently;
    • a root-key check that missed domi-root.key;
    • an intermediate accepted although it cannot issue.
  • Round 2, the new changes-under-Caddy path:
    • an unchanged /load never re-reads certificate files;
    • a control crash left Caddy on an unconfirmed trial;
    • the watch judged Caddy's sign-in redirect instead of upstream health;
    • a device change dropped a running trial.
  • Round 3: a revocation waited behind a 60 s watch.
  • Round 4: a revocation lost during an engine switch.
  • Design:
    • a clipped "Remove host";
    • focus not in Hostname;
    • a pause under Caddy that Mark never decided;
    • plus 17 smaller items.

Where I still distrust it:

  • VM tests: the four NixOS VM tests have never run (no KVM in WSL2). Phase 3's "Done" is not met until they do.
  • Not run against the real thing: systemd, polkit, LoadCredential, Authelia, the guard unit and Caddy under systemd; the module was evaluated only against our nixpkgs, not hyperv-infra's 24.11.
  • Guard retry: the caddy guard's retry after a failed load is checked by reading the code only.
  • Spoofable client IP: beside Caddy, edge listens on loopback TCP, so any local process could forge X-Forwarded-For. trustedProxies is therefore off; a Unix-socket listener is the Phase 4 fix.
  • Client compatibility: the PKCS#12 (AES-256) install was not tried on older Apple clients, nor a screen reader or a real clipboard copy.

Deployed

Nothing. The server is unchanged. Mark applies docs/deploy/configuration-server.patch, with the merged commit hash, following beside-caddy.md.

Phase 3 of docs/ROADMAP.md: the web UI, the Domi CA and the NixOS module. ## What is in it - **Web UI:** apps/web and packages/ui, a Svelte 5 UI built from the designer's hand-off (docs/ui-handoff.md, decisions in docs/ui-decisions.md). It uses the murex palette, self-hosts its fonts and makes no outside requests. A vitest smoke test counts the clicks for every §4 flow. - **Domi CA** (docs/pki.md): - ECDSA P-256; the root is made offline; the intermediate key is encrypted at rest. - Server certificates last 90 days, device certificates 1 year, never past the intermediate. - Device mTLS works in edge and in Caddy. - Control refuses to start if its state dir holds a private key it does not expect. - **§8.6 answered:** Custos cannot sign a CSR. The ticket is in docs/custos-ticket.md (not filed). Until then the intermediate is signed by hand with openssl, and device requests are approved with `pki approve`. - **UI sign-in (G14):** a per-boot proof secret that only the admin host behind Authelia sends. Control trusts Remote-User only together with it, and refuses the proof header on any other host. - **Engine switch at runtime** through polkit. Changes keep working under Caddy: - trials load through Caddy's admin socket; - the watch probes upstreams with edge's rules; - a revert comes from control, from a deadline guard unit, or from ExecStopPost after a crash. - Share links are off under Caddy. - **Test hooks:** behind the default `test-hooks` feature; the Nix release build is checked to contain none. - **Nix:** flake.nix with `.#ianitor`, `.#ianitor-web` and `nixosModules.ianitor`; four VM tests; deploy/test-access.sh. - **Server change (prepared, not applied):** docs/deploy/configuration-server.patch and beside-caddy.md, for flowers.stage and esp32.stage on the staging mirror, plus the Let's Encrypt staging check. ## Verification (WSL2 Debian and Windows, head of this branch) - **cargo test --workspace:** 240 passed, 0 failed. | Crate | Passed | |:--|--:| | core | 103 | | edge | 57 | | control | 75 | | diff | 4 | | testkit | 1 | - **Lint and hook:** fmt, clippy `-D warnings` and clippy `--no-default-features` are clean; the hook self-test passes 55/55. - **Web:** vitest 15/15; svelte-check reports 0 errors and 0 warnings. - **Nix:** `nix build .#ianitor` and `.#ianitor-web` build, and so do the drivers of all four VM tests (reported by the build agent). ## Adversarial self-review Four QC rounds and two design reviews. Every Major was fixed with a red test first. - **Round 1:** - an admin host without forward-auth would let anyone sign in as anyone; - a device revocation lost silently; - a root-key check that missed `domi-root.key`; - an intermediate accepted although it cannot issue. - **Round 2, the new changes-under-Caddy path:** - an unchanged `/load` never re-reads certificate files; - a control crash left Caddy on an unconfirmed trial; - the watch judged Caddy's sign-in redirect instead of upstream health; - a device change dropped a running trial. - **Round 3:** a revocation waited behind a 60 s watch. - **Round 4:** a revocation lost during an engine switch. - **Design:** - a clipped "Remove host"; - focus not in Hostname; - a pause under Caddy that Mark never decided; - plus 17 smaller items. Where I still distrust it: - **VM tests:** the four NixOS VM tests have never run (no KVM in WSL2). Phase 3's "Done" is not met until they do. - **Not run against the real thing:** systemd, polkit, LoadCredential, Authelia, the guard unit and Caddy under systemd; the module was evaluated only against our nixpkgs, not hyperv-infra's 24.11. - **Guard retry:** the caddy guard's retry after a failed load is checked by reading the code only. - **Spoofable client IP:** beside Caddy, edge listens on loopback TCP, so any local process could forge X-Forwarded-For. `trustedProxies` is therefore off; a Unix-socket listener is the Phase 4 fix. - **Client compatibility:** the PKCS#12 (AES-256) install was not tried on older Apple clients, nor a screen reader or a real clipboard copy. ## Deployed Nothing. The server is unchanged. Mark applies docs/deploy/configuration-server.patch, with the merged commit hash, following beside-caddy.md.
mnovak added 34 commits 2026-11-08 12:57:48 +01:00
mnovak manually merged commit 5df34bfae6 into main 2026-11-08 12:57:58 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/ianitor#5