[repo] Merge: Mark's decisions on the open points (PR #4)

This commit was merged in pull request #4.
This commit is contained in:
2026-11-07 22:18:05 +01:00
2 changed files with 27 additions and 14 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ crates/core config model, schema, compilers (Pingora runtime + Caddy JSON),
crates/edge Pingora data plane. Reads compiled config, serves traffic. Never decides policy.
crates/control API, git routes repo, apply/rollback, share links, PKI flows. Loopback only. Never serves public traffic.
apps/web Svelte 5 (runes, TypeScript strict). A client of the API; no logic.
packages/ui shared dark Domi theme.
packages/ui shared dark Domi theme, murex palette.
tests/diff same requests against Ianitor and Caddy, responses compared.
tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only.
tests/fuzz cargo-fuzz targets.
@@ -37,7 +37,7 @@ One-time per clone: git config core.hooksPath .githooks (self-test: bash .gith
- Workflow: branch → Gitea PR via API → short adversarial self-review in the PR body → merge --no-ff → push → verify hashes.
- Server changes: prepare the Nix change and show the command; Mark runs nixos-rebuild himself. deploy/test-access.sh must pass.
- When reporting done, say which build is deployed and whether it changed visibly.
- UI: dark Domi theme, every action ≤ 3 clicks, plain English; Latin only in the brand name.
- UI: dark Domi theme, murex palette; every action ≤ 3 clicks, plain English; Latin only in the brand name.
## Session end
Update the Status table and the Handover section at the bottom of docs/ROADMAP.md. No separate handover file.
+25 -12
View File
@@ -9,7 +9,7 @@ Legend: [S] sourced · [J] judgment · [M] decided by Mark.
3. Own proxy on Pingora (Rust, Apache 2.0; HTTP/1, HTTP/2, gRPC, websockets; a library, not a binary). [M] [S blog.cloudflare.com/pingora-open-source]
4. Caddy is the fallback: one config model compiled to the Pingora runtime and to Caddy JSON, kept honest by differential tests on every build. [M]
5. Web UI only, on the server behind Authelia. API tokens are saved by Mark in Custos; control stores only hashes. [M]
6. Routes live in a git repo (private: ianitor-routes), one TOML file per host, schema-validated. Every change is a commit, applied live without nixos-rebuild. Rebuild only for service-level changes (engine, ports, version). [M]
6. Routes live in a git repo (private: ianitor-routes), one TOML file per host, schema-validated. Every change is a commit, applied live without nixos-rebuild. Rebuild only for service-level changes (ports, version). The engine is switched at runtime by control (§3, §4); decided 2026-11-07, replacing "engine" in the rebuild list. [M]
7. Two processes: ianitor-edge (data plane) and ianitor-control (API + UI). Traffic keeps flowing if control crashes. [M]
8. Own small CA in crates/core using rcgen. No internal ACME server in v1. [M]
9. One public MPL-2.0 monorepo on Gitea; read-only GitHub mirror for discovery. Mark's server deployment stays in his NixOS flake. [M]
@@ -37,8 +37,10 @@ Legend: [S] sourced · [J] judgment · [M] decided by Mark.
- Apply: validate → compile → write edge config + Caddy JSON → reload edge → watch health checks 60 s →
on failure git-revert, reload, report "reverted" with the reason; otherwise "kept". Concurrent applies are serialised.
Undo = revert the last kept commit through the same path. Restore = apply an older tree as a new commit. Push to Gitea after a kept apply.
- Share links: HMAC token bound to host + path prefix + expiry (+ optional password hash), validated statelessly by edge;
key from systemd credentials; revocation by key rotation or a small deny list.
- Share links: HMAC token bound to host + path prefix + expiry (+ optional password, mixed into the MAC; no hash in the token,
so it cannot be guessed offline; edge rate-limits tries), validated statelessly by edge; key from systemd credentials;
revocation by key rotation, an epoch ("stop all") or a small deny list kept in a file outside git that control writes and edge
re-reads at once, so a Stop never waits for an apply; neither the epoch nor the list ever goes backwards. [M 2026-11-07]
- API: REST + JSON on loopback, OpenAPI generated from code.
- CA: root created offline, ~10 years, pathLenConstraint ≥ 1, never on the server. Intermediate ~1 year, key encrypted on the server,
password via systemd credentials. Leaf and device mTLS certs issued by control (lifetimes decided and justified in phase 3).
@@ -61,6 +63,9 @@ Main screen: host list with health dots, engine chip, intermediate-expiry banner
| Renew intermediate: banner Renew (approve in Custos) | 1 |
| API token: ⚙ → API → New token | 3 |
Accepted exceptions [M 2026-11-07]: copying a new API token and installing a device certificate may take a 4th click
(deliberate secret-handling steps).
## 5. Test layers (all run in an Artifex pipeline by phase 4)
1. Differential: the same request corpus against Ianitor and Caddy; status, selected headers and body compared.
2. Protocol conformance: h2spec, testssl.sh.
@@ -85,6 +90,8 @@ on the last good config; share token rejected when expired, wrong path, wrong ho
requests without a valid token rejected and tokens never logged; concurrent applies serialised.
Done: add host, undo, restore and share link work end to end via the API on loopback; curl examples in docs/api.md;
diff suite green after every apply.
Also includes the UI API contract (docs/ui-api.md: overview, error codes, idempotency, health classes, watch probes,
history grouping, restore previews), accepted by Mark 2026-11-07.
### Phase 3 — Web UI, PKI, NixOS
Goal: the UI from section 4, the CA flows, the NixOS module with VM tests; Ianitor runs beside Caddy on two low-risk hosts.
@@ -131,9 +138,9 @@ Identity gate, tunnel, Domi templates, ACME server, HTTP/3, migrating public sit
## 9. Status
| Phase | State | Notes |
|:--|:--|:--|
| 1 Core and engine | Done, except the Let's Encrypt staging check | Merged to main 2026-11-07. Tests run in WSL2; ACME checked only against Pebble. LE staging needs a public domain: Mark to decide whether to defer it to phase 3 or give a domain now. |
| 2 Control plane | Done, pending merge | Built on control/phase-2: routes repo, journaled apply with trial/watch/revert, undo, restore, share links, API tokens, REST API + OpenAPI, `--dev`. Four QC rounds; every finding fixed or listed in Handover. Real Gitea, systemd credentials and Authelia not exercised. |
| 3 Web UI, PKI, NixOS | Not started | UI design drafted: claude.ai/artifact/GEiCCPcGC1hiCkA2NrrH9u ("murex" palette on the Domi system). |
| 1 Core and engine | Done | Merged to main 2026-11-07. Tests run in WSL2; ACME checked only against Pebble. The Let's Encrypt staging check moved to phase 3 (Mark, 2026-11-07). |
| 2 Control plane | Done | Merged to main 2026-11-07 (PR 3): routes repo, journaled apply with trial/watch/revert, undo, restore, share links, API tokens, REST API + OpenAPI, `--dev`. Four QC rounds; every finding fixed or listed in Handover. Real Gitea, systemd credentials and Authelia not exercised. |
| 3 Web UI, PKI, NixOS | Not started | UI design drafted: claude.ai/artifact/GEiCCPcGC1hiCkA2NrrH9u ("murex" palette on the Domi system, approved). Carries the Let's Encrypt staging check, on the first low-risk host beside Caddy. |
| 4 Hardening and release | Not started | Known gaps carried here: see Handover. |
## 10. Handover
@@ -160,12 +167,18 @@ Identity gate, tunnel, Domi templates, ACME server, HTTP/3, migrating public sit
- Edge config is version 2; a phase-1 edge refuses it.
- Workspace `rust-version` is now 1.89 (`File::lock`).
- One open flake: in one full run `apply_sequence` timed out waiting for Caddy on the chunked-body case (Ianitor answered 200). The diff suite alone passed 5/5 afterwards; cause not found.
- **Needs Mark:**
- (f) The share-link deny list is a separate file outside git (`share-revocations.json`, plus an epoch for "stop all"), not part of the compiled edge config, so Stop never waits behind a 60 s apply.
- (g) §3 says "(+ optional password hash)"; the token carries no hash, and the password is mixed into the MAC so it cannot be guessed offline. §3 left unchanged until you agree.
- (h) The UI contract roughly doubled phase 2's scope; all of it is built.
- (a)–(e) from phase 1 below are still open.
- **Next step:** Phase 3, starting with the open points (a) LE staging, (b) the engine switch, (c) the 4th clicks, (d) the palette, and §8.6 (Custos CSR signing).
- **Decided by Mark (2026-11-07):**
- (a) Let's Encrypt staging moves to phase 3, run on the first low-risk host beside Caddy.
- (b) The engine is switched at runtime by control (§3, §4); §1.6 corrected.
- (c) The 4th click for copying an API token and for installing a device certificate is accepted (§4).
- (d) The murex palette is approved; CLAUDE.md now says "dark Domi theme, murex palette".
- (f) The share-link deny list stays a separate file outside git (§3 updated).
- (g) §3 now describes the password as mixed into the MAC, with no hash in the token.
- (h) Phase 2's growth to the UI API contract is accepted (§6 Phase 2 note).
- **Still open:**
- The phase 1 click note also listed "share link on a host with links off" as needing a 4th click; not yet decided.
- (e) Delete the stray build folder F:\pwt, and the merged remote branches docs/bootstrap, core/phase-1 and control/phase-2.
- **Next step:** Phase 3, starting with §8.6 (Custos CSR signing) and the Let's Encrypt staging check.
**2026-11-07: Phase 1, design draft** (kept for its open items).
- **Changed:**