Router.Africa — Network and Security Map
Every traffic path in the target state at public launch, and the security check applied at each hop. Use it to see what is still open before launch. It restates decisions; where it disagrees with decisions-log.md, the decisions log wins.
How to read the diagram: one strip per traffic path. Boxes are hops, coloured by where they run; the chips under a box are the checks applied at that hop.
| Chip | Meaning |
|---|---|
| Green | Decided and specified; to be built as written |
| Amber ◐ | Decided but applied at the pre-launch lockdown, an accepted risk, or something to verify at build |
| Red ✕ | Open gap: not decided anywhere yet (none at present) |
Today vs target. Before the lockdown, SSH, 80 and 443 are open on the droplet and prod-bifrost-core.router.africa is public. The lockdown (decisions log, Droplet network lockdown) closes those; the Workers use the private path from day one.
Editing: the diagram is generated. Change diagrams/src/network-wire.py and run python3 diagrams/src/network-wire.py diagrams/network-wire.svg; keep this file’s tables in step.
1. Paths
Section titled “1. Paths”| ID | Path | Hops |
|---|---|---|
| A1 | API request | Developer app → Cloudflare edge (api.) → apps/api → VPC binding → Bifrost → provider |
| A2 | Dashboard session | Browser → Cloudflare edge (app.) → SPA + dashboard-api → Hyperdrive → Postgres |
| A3 | Sign-up / sign-in | Browser → edge → dashboard-api (Better Auth) → OAuth provider; email through Resend |
| A4 | Staff admin console | Staff browser → Cloudflare Access (admin.) → admin SPA + admin routes → Postgres |
| A5 | Top-up request | Browser → dashboard-api → VPC binding → niobi-proxy → Niobi API (static IP) |
| A6 | Niobi webhook | Niobi → DigitalOcean firewall (DNS-only host) → Traefik → niobi-proxy → niobi-callbacks queue → dashboard-api |
| B1 | Operator → droplet | Laptop → DigitalOcean firewall → WireGuard → SSH, kubectl, Bifrost dashboard |
| B2 | Cloud consoles and recovery | Operator → DigitalOcean (incl. web console), Cloudflare, GitHub, Datadog, Resend, Niobi portal |
| B3 | CI/CD | GitHub Actions → Cloudflare (wrangler); → K3s and both databases’ migrations via the self-hosted runner |
| C1 | Key sync | dashboard-api → VPC binding → Bifrost management API |
| C2 | Usage, content, logs | apps/api → Queues → consumer; → R2; logs schema in Postgres |
| C3 | Inside the cluster | cloudflared, Traefik, niobi-proxy, Bifrost, Bifrost’s Postgres, the staging and production Postgres (Hyperdrive reaches each over a VPC Service; production backs up to R2) |
| D1 | Outbound from Workers | Datadog, Resend, Turnstile, FX source |
| D2 | Outbound from the droplet | Providers, Niobi, Datadog agent, Let’s Encrypt and Cloudflare DNS |
| D3 | Monitoring probes | Datadog Synthetics → api., app., admin. (Access service token); Bifrost health in-cluster; external port scan |
2. Gaps found and closed
Section titled “2. Gaps found and closed”The first version of this map (2026-10-26) found seven gaps that no doc had decided. All seven were decided the same day; the diagram now has no red chips. Building them is in the execution plan.
| # | Gap | Paths | Decision (decisions log) |
|---|---|---|---|
| 1 | No per-IP rate limit at the edge | A1, A2 | Edge rate limiting: Cloudflare rules on api. and the auth paths of app., editable in the admin app; a 60-second cache of rejected key hashes in apps/api |
| 2 | No least-privilege database roles | A2, A4, C2 | Database roles: api, dashboard, consumer, migrator, each with its own Hyperdrive config |
| 3 | Cloudflare Access login not chosen | A4 | Admin origin access: named allow-list (the operator at launch), email one-time PIN |
| 4 | Cloud account security undocumented | B2 | Cloud account security: MFA in place on every account; tokens listed in ../infra/secrets-inventory.md |
| 5 | CI → K3s deploy mechanism open | B3 | CI/CD pipeline: a self-hosted runner in the cluster that dials out to GitHub |
| 6 | Bifrost management API reachable with only a virtual key | C1 | Gateway management route allow-list: five routes on their own Service and VPC binding, admin credential on dashboard-api only, a conformance test |
| 7 | No Kubernetes network policies | C3 | Kubernetes network policies: default-deny, only the paths in this map allowed |
To add a gap: give it a red chip in diagrams/src/network-wire.py, regenerate, and list it here until it’s decided.
3. Amber items
Section titled “3. Amber items”| Item | Paths | What closes it |
|---|---|---|
No public hostname for Bifrost and niobi-proxy; firewall to WireGuard + Niobi IPs; public Bifrost UI removed |
A1, A5, A6, B1 | Pre-launch lockdown (decisions log, Droplet network lockdown) |
ufw not relied on; DigitalOcean web console tested before SSH closes |
B1, B2 | Pre-launch lockdown |
| Webhook TLS via DNS-01 | A6 | Pre-launch lockdown (cert-manager with a DNS-edit token) |
| No Cloudflare WAF on the webhook path | A6 | Accepted: the firewall IP allowlist and signature check replace it (decisions log, Niobi webhooks) |
| Droplet egress open | D2 | Accepted for launch; network policies limit which pods use which egress |
HTTP refused on api. |
A1 | Proposed in api-key-security.md section 6; needs the Cloudflare rule chosen |
__Host- cookies; no email enumeration on sign-up |
A2, A3 | Verify at the pinned Better Auth version (auth-security.md section 7) |
| Queue push token is send-only | A6 | Verify the Cloudflare token scope (backlog #18) |
| No prompt content in Datadog | D1 | Verify in staging (backlog #17) |
| Bifrost Postgres backups | C3 | Backup job still to build (installation-as-built.md, remaining work) |
| Workers VPC is in beta | A1, A5, C1 | Verify pricing at GA; fallback is Access service tokens (decisions log, Private service access) |
| Hyperdrive to the cluster Postgres over a VPC Service | C3 | Verify in P0.13; fallback is a Tunnel hostname behind an Access service token |
| Production Postgres is a single node on the droplet | C3 | Accepted for now (decisions log, Ledger database): on the droplet’s disk, continuous backups to R2, restore drill in P9.14; move to PlanetScale decided in P9.10 |