[docs] README and support: what Ianitor is, why Pingora, the Caddy fallback, the Fabrica badge, the five test layers; docs/support.md (adopt a red panda, the route to RPN pending); ROADMAP §8.7 answered as a proposal pending Mark
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
# Ianitor Domi
|
||||
|
||||
[](docs/verify.md)
|
||||
|
||||
*Ianitor* is Latin for the doorkeeper: it decides who comes through the door (routing, TLS) and checks
|
||||
credentials (certificates). Ianitor Domi is a reverse proxy for a home server, built on Cloudflare's
|
||||
[Pingora](https://github.com/cloudflare/pingora), with a small certificate authority for your own devices, a web
|
||||
UI, an API, and a NixOS module. MPL-2.0.
|
||||
|
||||
- **Routes in git.** One TOML file per host in a repository (`hosts/wiki.example.toml`), schema-checked. Every
|
||||
change is a commit, applied live without `nixos-rebuild`, watched for 60 seconds, and reverted by itself if the
|
||||
host stops answering. Undo is one click; any older state can be restored.
|
||||
- **Two processes.** `ianitor-edge` serves traffic and decides nothing; `ianitor-control` (API and UI, loopback
|
||||
and Unix sockets only) edits the routes and tells edge what to serve. Traffic keeps flowing when control stops.
|
||||
- **TLS your way.** Let's Encrypt for public names; for everything internal, the Domi CA: the root stays offline,
|
||||
the intermediate on the server is renewed yearly, device certificates enable mTLS for a host.
|
||||
- **What a home server needs, and no more.** Forward-auth to Authelia (existing protected services keep working),
|
||||
header rules whose values can be systemd credentials (never written anywhere), websockets, health checks,
|
||||
share links (an expiring, optionally password-protected link to one path), a truncated, opt-in visit log.
|
||||
- **Caddy as the fallback.** The same route model compiles to Caddy JSON too, and one click switches engines at
|
||||
runtime. Differential tests send the same requests to both on every build, so the fallback stays honest.
|
||||
|
||||
It is one person's project for one home network, published because the approach may be useful to others. It is
|
||||
not a general-purpose proxy: no HTTP/3, no load-balancing policies beyond round robin over healthy upstreams, no
|
||||
plugin system. Status, decisions and what is not done: [docs/ROADMAP.md](docs/ROADMAP.md).
|
||||
|
||||
## Why Pingora
|
||||
|
||||
Pingora is a library, not a server: Ianitor owns the request path (host lookup, forward-auth, share links,
|
||||
header rules, upstream choice) in plain Rust, and gets HTTP/1, HTTP/2, websockets, TLS (rustls) and connection
|
||||
pooling from code that serves a large share of the web at Cloudflare. A memory-safe data plane with no config
|
||||
language between the routes and the code was the point; speed was not, and the numbers below say so.
|
||||
|
||||
Caddy is excellent, and Ianitor keeps it as the fallback engine. What Ianitor adds on top is the workflow: routes
|
||||
as reviewed commits with automatic rollback, a CA for the house, and a UI where every common action takes at most
|
||||
three clicks.
|
||||
|
||||
## Benchmarks (honest ones)
|
||||
|
||||
Load and soak runs against Caddy 2 on the same machine, the same route and the same upstream
|
||||
(`scripts/bench.sh`, ROADMAP §5 layer 5). Results are committed as data in [bench/](bench/), with the machine
|
||||
described beside them; [bench/README.md](bench/README.md) summarises them, including where Caddy wins. Two caveats
|
||||
apply to every number there: the load generator, the proxies and the upstream share one machine, and edge runs
|
||||
Pingora with two worker threads (a home server's budget), so Caddy is also measured with `GOMAXPROCS=2`.
|
||||
|
||||
## Install (NixOS)
|
||||
|
||||
```nix
|
||||
# flake.nix
|
||||
inputs.ianitor.url = "git+https://gitea.marek-novak.cz/mnovak/Ianitor.git";
|
||||
# configuration
|
||||
imports = [ inputs.ianitor.nixosModules.ianitor ];
|
||||
services.ianitor = {
|
||||
enable = true;
|
||||
edge.openFirewall = true;
|
||||
shareLinkKeyFile = "/run/secrets/ianitor-share-link-key"; # never a store path; the module refuses one
|
||||
};
|
||||
```
|
||||
|
||||
Then `ianitor-control token create --name laptop --config /etc/ianitor/control.toml` for the API, or the web UI
|
||||
behind Authelia ([docs/api.md](docs/api.md), "Sign-in"). Beside an existing Caddy, edge can sit behind it on a Unix
|
||||
socket: [docs/deploy/beside-caddy.md](docs/deploy/beside-caddy.md). The CA: [docs/pki.md](docs/pki.md).
|
||||
|
||||
## Tests
|
||||
|
||||
Five layers (ROADMAP §5), all in the `layers` pipeline (`.fabrica/artifex/layers.yaml`):
|
||||
|
||||
| Layer | What | Run it |
|
||||
| :-- | :-- | :-- |
|
||||
| 1 Differential | the same request corpus against Ianitor and Caddy, answers compared | `cargo test -p ianitor-diff` |
|
||||
| 2 Conformance | h2spec and testssl.sh against both engines | `scripts/conformance.sh` |
|
||||
| 3 Fuzzing | route files, header rules, share tokens, share-link paths, the CA's PEM and CSR parsing | `tests/fuzz/run.sh` |
|
||||
| 4 NixOS VM tests | rollback, engine switch, CA renewal, loopback-only control, the sockets | `nix flake check` (KVM) |
|
||||
| 5 Load and soak | against Caddy, results kept as data | `scripts/bench.sh` |
|
||||
|
||||
`cargo test --workspace` runs the unit, integration and layer 1 tests; most of them need Linux (Pingora's Windows
|
||||
support is best effort), Caddy and Pebble on PATH: `nix develop .#ci`.
|
||||
|
||||
## Releases and verification
|
||||
|
||||
A release is a signed manifest, not a binary: `SHA256SUMS` signed by `domi-release` (through Custos) over the
|
||||
release notes, screenshots of the UI and `ianitor-nix.json`, the NAR hashes of the Nix build at the tagged commit.
|
||||
The build is reproducible, so anyone can rebuild the tag and compare: [docs/verify.md](docs/verify.md).
|
||||
|
||||
## Support
|
||||
|
||||
The source is free. If Ianitor is useful to you, you can **adopt a red panda**: support the project, and a fifth of
|
||||
everything it receives goes to the [Red Panda Network](https://redpandanetwork.org), remitted once a year with the
|
||||
receipt published. How it works and where it stands: [docs/support.md](docs/support.md).
|
||||
|
||||
## Licence
|
||||
|
||||
[MPL-2.0](LICENSE). Pingora is Apache-2.0; Caddy, used only as a separate fallback process, Apache-2.0.
|
||||
Reference in New Issue
Block a user