3.7 KiB
Ianitor Domi: a doorkeeper for a home server
My home server runs a dozen small services behind Caddy. Caddy has been flawless. What I kept wanting was not a
better proxy but a better way to change it: every new host was an edit on the server, a nixos-rebuild, and a hope
that I had not broken the other eleven. So I built Ianitor (Latin for doorkeeper): a reverse proxy on Cloudflare's
Pingora with the workflow around it that I wanted.
What it does
- Routes are commits. One TOML file per host in a git repository. The web UI (or the API) commits the change, edge loads it in place, and for sixty seconds control watches the host's health. If it fails, the commit is reverted and the old config comes back on its own. Undo is one click, and any older state can be restored.
- Two processes. Edge serves traffic and decides nothing. Control, which edits the routes, never listens on anything but loopback and Unix sockets. If control dies, traffic carries on.
- A small CA for the house. The root key lives offline; the server holds an intermediate that is renewed once a year. Devices get certificates for mTLS, so a phone can reach a service no one else can.
- Share links. An expiring link to one path of a service, optionally with a password, checked by edge without any database.
- Caddy stays. The same route model compiles to Caddy JSON, and one click switches engines at runtime. A differential test suite sends the same requests to both on every build and compares the answers.
Why Pingora, and what it costs
Pingora is a library: the request path is ordinary Rust that I own, from the host lookup through Authelia's forward-auth to the share-link check, with no configuration language in between. What it costs: Pingora's Windows support is best effort, its rustls backend is labelled experimental, and some things Caddy does for free I had to match by hand (a deadline for slow request headers, pipelined requests, a resolver that cannot be wedged by a dead DNS server). Each of those now has a test.
The benchmarks are in the repository as data, run on [machine] against Caddy [version] on the same route. In short: [Ianitor is ahead on … / Caddy is ahead on …]. Edge runs with two worker threads by design, so Caddy is measured both as it starts and pinned to two. I publish the rows where Caddy wins, because a home proxy should be chosen for how it is run, not for a number.
Verifiable, and signed
Every release is a SHA256SUMS signed through Custos with my release key, over the notes, screenshots of the UI,
and the NAR hashes of the Nix build. Rebuild the pinned commit and compare (docs/verify.md tells you how).
[Before posting: say "reproducible" only once two independent builds have matched; until then, what is checked is
one rebuild of the output derivations, with dependencies from the binary cache.]
Five test layers
Differential tests against Caddy; h2spec and testssl.sh; cargo-fuzz on route files, share tokens and the CA's parsers; NixOS VM tests for rollback, the engine switch and the CA; load and soak runs. They run in a Fabrica pipeline on every push to main.
Adopt a red panda
The source is free (MPL-2.0). If it helps you, there is a support model: a fifth of anything the project receives goes to the Red Panda Network once a year, and the receipt is published. [Link to docs/support.md once the route is confirmed.]
Ianitor is one person's project for one home. If that is your situation too, it may save you a few evenings.
[Gitea link] · [GitHub mirror link, when it exists]