Architecture
Drillmark is three Docker services plus an external OIDC provider.
Services
Backend API (api)
Rust, built on Axum. Owns the scheduled jobs (incoming queue, failed queue, geolocation, alerts, optional weekly report), the REST surface, and all database access through SeaORM. One process, cooperative async, graceful shutdown with a configurable timeout.
Database (db)
Postgres 17. The api runs migrations at boot; a migration mismatch fails the boot rather than silently drifting. Raw report blobs are stored as BYTEA alongside the parsed rows; storage grows roughly linearly with ingestion volume.
Frontend (web)
Dioxus WASM app served by Caddy. Cross-platform: the same source builds for web (served here), desktop (single static binary per OS), and mobile (planned). Caddy also proxies /api/* back to the backend on the same origin, so browser requests do not cross origins once the user has signed in.
Identity
Drillmark has no local login. Sign-in federates to a Bunyip / mokosh-server OIDC provider via PKCE:
- The SPA runs as a public PKCE client at the OP.
- The backend verifies bearer tokens against the OP’s JWKS on every protected request.
- The OP issues an access token and refresh token; the SPA stores them per the OIDC module in the frontend.
- Sign-out returns the user to Bunyip, which is also surfaced as the “manage your account” link in Settings.
Standalone / local-auth mode was removed. The five OIDC_* env vars are required; the api refuses to boot without them.
Reverse proxy
Drillmark expects a reverse proxy in front terminating TLS and forwarding to the two public hosts: ${DOMAIN} (the SPA served by Caddy) and api.${DOMAIN} (the backend). The sample compose.yml uses Traefik with the network-traefik-public network and cert-cloudflare resolver.
Rate limiting and trust
The rate limiter keys on the socket peer unless TRUSTED_PROXY_CIDRS lists the reverse proxy’s CIDR. Unset means the api only trusts the socket peer, which is correct for local dev and for any deployment that has not yet named its ingress CIDRs.
What is not here
- No worker or queue process. Background jobs run inside the same api process as the HTTP handlers; graceful shutdown drains them.
- No separate cache or message broker. Postgres is the only persistent store.
- No forensic (RUF) report handling. Only DMARC aggregate (RUA) and TLS-RPT are consumed.
- No message-level content ingestion. Reports describe other mail; Drillmark never touches the mail those reports are about.