Files
ianitor/CLAUDE.md
T
mnovak 8efea92c01 [repo] Merge: main into phase-4 (Fabrica onboarding and 0.2.0, PRs #11 and #12)
# Conflicts:
#	.fabrica/artifex/release.yaml
#	docs/ROADMAP.md
#	docs/release.md
2026-11-22 19:34:22 +01:00

4.8 KiB

CLAUDE.md — Ianitor Domi

Ianitor is a reverse proxy built on Cloudflare's Pingora, with a small Domi CA, a web UI and an API. NixOS-native, with Caddy as a tested fallback. MPL-2.0. Plan, decisions and status: docs/ROADMAP.md — read it first.

Layout

crates/core config model, schema, compilers (Pingora runtime + Caddy JSON), CA (Ianitor's view of the shared crate domi-pki, pinned by tag). Pure: no I/O, no network. 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, 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. deploy/nixos NixOS module + VM tests. scripts version check, release pin, test layers 2 and 5 (conformance, bench), the Nix pin. Releases: docs/release.md. bench layer 5 results as data (CSV/JSON), layer 2 outputs.

Commands

cargo test --workspace # quote test counts per crate; an exit code alone is not green cargo run -p ianitor-control -- --dev pnpm --filter web dev # 127.0.0.1 only, never --host pnpm --filter web test:e2e # the web UI's flows in Edge on demo data, recorded -> target/e2e/videos (docs/fabrica.md) pnpm --filter web aula:shots # the Aula screenshots from the same suite -> target/e2e/aula; then fabrica aula shots node scripts/check-version.mjs X.Y.Z # Cargo.toml and both package.json carry the version scripts/conformance.sh # layer 2: h2spec + testssl.sh, Ianitor vs Caddy (nix develop .#ci) tests/fuzz/run.sh 60 # layer 3: cargo-fuzz, 60 s a target; crashes become regressions scripts/bench.sh # layer 5: load and soak vs Caddy -> bench/results scripts/nix-pin.sh # rebuild check of the outputs; writes .fabrica/nix/pin.json before a tag node --test scripts/release-pin.test.mjs # the release's pin gate (a pin must be of the tagged code) nix build .#ianitor nix flake check # includes NixOS VM tests (Linux + KVM)

On Windows, build and test in WSL2 Ubuntu (distro Ubuntu, 26.04, root; ROADMAP §8.3: Pingora's Windows support is best effort; edge, diff and ACME tests are Linux-only). Rust from rustup in $HOME (stable; nightly for cargo-fuzz), a Linux target dir, and caddy, pebble and pebble-challtestsrv on PATH: with Nix, nix profile add nixpkgs#caddy nixpkgs#pebble; without it (as now), apt install pebble testssl.sh golang-go and go install github.com/caddyserver/caddy/v2/cmd/caddy@v2.11.7 (apt's Caddy 2.6 is too old for the diff suite): wsl -d Ubuntu -- bash -lc 'cd /mnt/f/Akce/Ianitor && PATH=$HOME/.cargo/bin:$HOME/go/bin:$PATH CARGO_TARGET_DIR=$HOME/ianitor-target cargo test --workspace' One-time per clone: git config core.hooksPath .githooks (self-test: bash .githooks/test-pre-commit.sh)

Rules

  • Commits: [<crate|app>] <Feature>: <one line>. No AI attribution, no trailers, ever.
  • Never in git: target/, node_modules/, dist/, binaries, private keys, files over 5 MB. A pre-commit hook enforces it.
  • $GITEA_TOKEN never echoed or written anywhere. Secrets come only from Custos or systemd credentials, never the Nix store.
  • ianitor-control and every dev server listen on 127.0.0.1 only; only ianitor-edge binds public ports.
  • Disks (Mark's machine): never write, move or delete anything on C:, and nothing on D: either. Everything goes on F: (build output, clones, caches, temp files, tools, WSL swap), under F:\C-Drive-Migration when it replaces a C: path. The only file kept on C: is C:\Users\chode.wslconfig (WSL reads it only there; it points swap to F:). Every agent's brief repeats this rule.
  • Route files, API bodies, CSRs, headers and share tokens are hostile input: typed Result, no unwrap() on input paths, no swallowed errors.
  • Every route change goes through the core compiler and the differential tests.
  • Tests first only where the risk is: parsing, CA, share tokens, forward-auth, apply/rollback, secret injection.
  • 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, 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.