dettmer.dev
← works
Ravenward seal, a raven in a golden ring
Self-hosted · Python

Ravenward

One passkey sign-in in front of every self-hosted web interface. A forward-auth gate with an edge on each host that keeps deciding, even while the central is away.

active

Ravenward puts one sign-in in front of every self-hosted web interface: dashboards, a wiki, an admin panel, a file share. You sign in once with a passkey, and every service behind it opens without asking again, across hosts and across domains.

It started in front of my own services, where it runs every day across several hosts and domains. I wanted that protection self-hosted, without running a full identity provider and without setting up OIDC in every single app.

How it works

It is a forward-auth gate, not an identity provider. The apps stay as they are; the reverse proxy asks a small edge on the same host before it lets a request through.

  • Central. Passkeys, email codes where a grant allows them, users, services and who may open what. One small Flask app with SQLite.
  • Edge. One per host, next to nginx, SWAG, Nginx Proxy Manager, Traefik or Caddy. It checks each request against a signed policy it fetches every 30 seconds, and keeps working for 24 hours if the central is down. Python standard library only, about 20 MB of memory.
  • Sign in once. A service sends the browser to the central, which hands back a one-time ticket. The edge redeems it and sets a cookie for that service only.

Ravenward invents no cryptography. Passkeys are verified by py_webauthn, policy and cookies are signed with HMAC-SHA256, and secrets at rest are hashed. How the parts fit together is documented in the repo, down to a cryptography table.

Features

  • Passkeys first. Email codes only where a grant allows them, and never enough to add a passkey.
  • Observe before enforce. Every service can run in observe mode first; the admin area lists who calls it without signing in and turns a caller into an exception.
  • Setup assistant. Proxy snippets for each proxy, ready to copy, and a check that asks the service’s public address what a stranger would see.
  • Defense view. What the edges refused, per service, reason and hour over 30 days, in three tiers. Counts only, no addresses.
  • Instant revocation. Signing out, locking an account or deleting a lost device’s passkey takes effect everywhere within one poll.
  • Themed sign-in pages in the look of each service, English and German, Prometheus metrics with alerts and a Grafana dashboard.

How it is built

Built with AI coding agents through context engineering: I set the rules, the threat model and the scope, and review the plan of every change before it gets built. The code is held to tests: every feature comes with a test, every security-relevant change with a mutation probe that turns the tests red, and every release passes the full harness in CI.

platform
Self-hosted · Python
stack
Python, Flask, SQLite, WebAuthn, Docker, nginx, Traefik, Caddy