docs: as-built infrastructure 2026-09-29, remove stale release workflow
ci / shared (pull_request) Successful in 14s

Mirror of the Collectives pages updated on 2026-09-29: INFRASTRUCTURE.md
(production node, WireGuard, digest promotion, storage, encrypted backups,
staff SSO, new risks), COST_PLAN.md (CPX42), CHANGELOG.md.

.gitea/workflows/release.yaml fired on v* tags and called tools that do
not exist (the same stale workflow as in orca-platform#42).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-09-29 10:23:13 +02:00
1 parent 8b2e1fc288
commit e95beb3ce9
4 files changed
+212 -302

No files matched your search

+197 -206
View File
@@ -1,229 +1,213 @@
# Infrastructure Specification
**Status:** Revised topology (2026-09-11)
**Status:** As built — production live (silent launch 2026-09-25), first customer pilot 2026-09-30
**Authors:** Sharang, Benjamin
**Date:** 2026-05-11 (topology lock: 2026-05-18; cluster split: 2026-06-30; **revised 2026-09-11**)
**Companion docs:** PLATFORM_ARCHITECTURE.md, IMPLEMENTATION_PLAN.md, COST_PLAN.md, `BreakPilot Infra/Infrastructure Architecture` (as-built core cluster)
**Cloud provider:** Hetzner Cloud (fsn1 / nbg1, EU) + Hetzner Object Storage (nbg1). DNS at Strato.
**Date:** 2026-05-11 (topology lock 2026-05-18; cluster split 2026-06-30; revised 2026-09-11; **as-built update 2026-09-29**)
**Companion docs:** PLATFORM_ARCHITECTURE.md, IMPLEMENTATION_PLAN.md, COST_PLAN.md, `BreakPilot Infra/Infrastructure Architecture` (both clusters, service catalog, backup runbook)
**Cloud provider:** Hetzner Cloud (EU, Germany) + Hetzner Object Storage (nbg1). DNS and mail at Strato.
---
> **2026-09-11 revision.** Replaces the SysEleven 4-VM / 3-cluster design. The company already runs a single Hetzner Orca cluster (`breakpilot`, see `BreakPilot Infra`). That cluster becomes **core-only**. A second Orca cluster, `breakpilot-platform`, hosts the customer-facing platform with **staging and production on separate VMs**. PowerDNS, Stalwart, Orca-Proxy-as-a-container, wildcard TLS and SysEleven pricing are gone. The legal entity (BreakPilot GmbH, HRB 736403) exists, so the "gated on legal entity" clauses are discharged.
> **2026-09-29 — as built.** The design of 2026-09-11 stands: the core cluster (`breakpilot`) is company infrastructure only, and the platform cluster (`breakpilot-platform`) carries staging and production on separate VMs. What changed on the way: production is a **CPX42** joined over **WireGuard** (no Hetzner private network), production images are **pinned by digest** and promoted by PR (no prod webhooks), backups on both clusters are **age-encrypted**, customer docs live on `docs[-stage].breakpilot.com`, and staff sign in to `/admin` with their **company account**. Sections 1–5, 8 and 12–14 describe the live state; 6, 7 and 9–11 are the targets they are measured against.
## 1. Cluster and VM Inventory
```
┌──────────────────────┬────────────────────┬───────┬────────────────────────────┬───────────┬──────────────────────────┐
│ Node │ Cluster │ Env │ Flavor (Hetzner) │ Public IP │ Role / planes │
├──────────────────────┼────────────────────┼───────┼────────────────────────────┼───────────┼──────────────────────────┤
│ breakpilot-infra-vm1 │ breakpilot (core) │ core │ existing, 46.225.100.82 │ YES │ master · Identity+Infra │
│ ubuntu-16gb-fsn1-1 │ breakpilot (core) │ core │ existing 16 GB, 178.105.159.224 │ YES │ agent · ERP, Nextcloud… │
│ bp-platform-stage │ breakpilot-platform│ stage │ CPX32 4v/8 GB (booked 2026-09-11) │ YES │ MASTER · Control+App (stage) │
│ bp-platform-prod │ breakpilot-platform│ prod │ sized at prod planning (≥16 GB, dedicated cores preferred) │ YES │ agent · Control+App (prod) │
│ (dev) │ — │ dev │ laptop docker-compose │ n/a │ all (in-memory) │
└──────────────────────┴────────────────────┴───────┴────────────────────────────┴───────────┴──────────────────────────┘
┌──────────────────────┬─────────────────────┬───────┬──────────────────────────────┬─────────────────┬────────────────────────────────┐
│ Node │ Cluster │ Env │ Size │ Public IP │ Role │
├──────────────────────┼─────────────────────┼───────┼──────────────────────────────┼─────────────────┼────────────────────────────────┤
│ breakpilot-infra-vm1 │ breakpilot (core) │ core │ 12 vCPU / 22 GB, 451 GB │ 46.225.100.82 │ master · identity, git, images │
│ ubuntu-16gb-fsn1-1 │ breakpilot (core) │ core │ 8 vCPU / 15 GB, 301 GB │ 178.105.159.224 │ agent · ERP, files, CI runner │
│ bp-platform-stage │ breakpilot-platform │ stage │ CPX32 4 vCPU / 8 GB, 150 GB │ 178.105.223.117 │ MASTER · all *-stage services │
│ bp-platform-prod │ breakpilot-platform │ prod │ CPX42 8 vCPU / 16 GB │ 46.225.108.74 │ agent · all *-prod services │
│ (dev) │ — │ dev │ laptop docker-compose │ n/a │ local development │
└──────────────────────┴─────────────────────┴───────┴──────────────────────────────┴─────────────────┴────────────────────────────────┘
All nodes: Orca 0.3.0-rc.6, Docker, no swap.
```
**Why this topology**
- **Core stays where it is.** Keycloak, Gitea, Harbor, ERPNext, LiteLLM, Infisical, SigNoz, Nextcloud, chat and the landing page are company infrastructure and keep running on the cluster they run on today. Nothing customer-facing shares a node with them after M-MIG-2.
- **One platform cluster, one node per environment.** Orca can pin services to a node (`placement.node`) but has no environments, namespaces or label scheduling. Separate VMs give staging and production physical isolation; separate Orca projects, service names, realms, databases and secret scopes give them logical isolation.
- **The staging VM is the cluster master.** It exists first; production joins later as an agent over the Hetzner private network. Unpinned services land on the master, so `validate.sh` rejects any unpinned service.
- **Per-node ingress.** Every node binds 80/443 and issues its own certificates (HTTP-01). A hostname's A record points at the node running the service. No wildcard, no DNS-01, no shared proxy.
- **Core stays where it is.** Keycloak, Gitea, Harbor, ERPNext, LiteLLM, Infisical, SigNoz, Nextcloud, chat and the website are company infrastructure. Nothing customer-facing shares a node with them (the dsms stack is the one temporary exception, M-MIG-9).
- **One platform cluster, one node per environment.** Orca pins services to a node (`placement.node`) but has no environments or label scheduling. Separate VMs give staging and production physical isolation; separate Orca projects, service names, realms, databases and secret scopes give logical isolation.
- **The staging VM is the cluster master**; production joined as an agent on 2026-09-23. Unpinned services would land on the master, so `validate.sh` rejects them.
- **Per-node ingress.** Every node binds 80/443 and issues its own certificates (HTTP-01). A hostname's A record points at the node running the service. No wildcard, no DNS-01.
---
## 2. Service-to-Node Mapping
### Core cluster (`sharang/orca-infra`) — after M-MIG-2
### Core cluster (`sharang/orca-infra`)
```
breakpilot-infra-vm1 (master, 46.225.100.82)
keycloak + db auth.breakpilot.com realms: master, breakpilot, breakpilot-stage, breakpilot-prod
gitea + db git.breakpilot.com (+ SSH :22222)
harbor (9 svcs) repo.breakpilot.com projects: breakpilot, pruefwerk, firmwerk, platform, observability
litellm + db/redis llm.breakpilot.com
infisical + db/redis secrets.breakpilot.com
gatus status.breakpilot.com
matrix/synapse/proxy chat.breakpilot.com
landing + kontakt-relay breakpilot.com, www.
coturn
otel-agent-master
[until M-MIG-9] breakpilot-dsms (12 svcs) · tenant-registry-dev · compliance-mcp · certifai-mongo
keycloak + db auth.breakpilot.com realms: master, breakpilot, breakpilot-stage, breakpilot-prod, breakpilot-dev (legacy)
gitea + db git.breakpilot.com (+ SSH :22222)
harbor (9 svcs) repo.breakpilot.com projects: breakpilot, pruefwerk, firmwerk, platform, observability, infra, certifai (legacy)
litellm + db/redis llm.breakpilot.com + searxng (internal, Werkpilot web search via /v1/search)
infisical + db/redis secrets.breakpilot.com
gatus status.breakpilot.com groups incl. "Platform Staging" and "Platform Production"
synapse + proxy + db chat.breakpilot.com + coturn
landing + kontakt-relay breakpilot.com, www.
otel-agent-master, vuln-watch-master
[until M-MIG-9] breakpilot-dsms (12 svcs, incl. pitch.breakpilot.com) · compliance-mcp · certifai-mongo
ubuntu-16gb-fsn1-1 (agent, 178.105.159.224)
erpnext stack (9 svcs) erp.breakpilot.com + Frappe CRM + Helpdesk
nextcloud + collabora cloud.breakpilot.com, collabora.
signoz + clickhouse signoz.breakpilot.com, otel.breakpilot.com
element, jitsi element.breakpilot.com, meet.breakpilot.com
kellnr crates.breakpilot.com
penpot design.breakpilot.com
otel-agent-workhorse
erpnext stack (9 svcs) erp.breakpilot.com + Frappe CRM + Helpdesk; wired to registry-prod (webhooks, Usage Record)
nextcloud + collabora cloud.breakpilot.com, collabora.
signoz + clickhouse signoz.breakpilot.com, otel.breakpilot.com
element, jitsi, penpot element., meet., design.breakpilot.com
kellnr crates.breakpilot.com
otel-agent-workhorse, vuln-watch-workhorse
gitea-act-runner (plain container, not Orca) — the ONLY CI runner
[until M-MIG-9] tenant-registry-dev + db
```
Stopped and archived at M-MIG-2: `breakpilot-portal` + 4 per-tenant portals, `compliance-agent`, `compliance-dashboard`, `compliance-docs`, `browserless`, `soft-plc`, `plc-sim`, `mailserver`.
### Platform cluster (`platform/orca-platform`) — stage node
### Platform cluster (`platform/orca-platform`)
```
bp-platform-stage (master, public IP, CPX32: 4 vCPU / 8 GB)
project platform-stage
portal-stage app-stage.breakpilot.com 640 MB
tenant-registry-stage registry-stage.breakpilot.com 384 MB (migrate init)
pg-stage internal, volume 768 MB pre_hook pg_dumpall
erpnext-mock-stage internal 192 MB (stage only)
project pruefwerk-stage
pruefwerk-dashboard-stage pruefwerk-stage.breakpilot.com 640 MB
pruefwerk-agent-stage internal :3001 1.25 GB
pruefwerk-mcp-stage route pruefwerk-stage…/mcp/* 256 MB
pruefwerk-docs-stage route pruefwerk-stage…/docs/* 96 MB
pruefwerk-mongo-stage internal, volume 768 MB pre_hook mongodump
werkbank-runner-stage internal (OPTIONAL — start only for runner tests) 512 MB
project firmwerk-stage
firmwerk-cloud-stage firmwerk-stage.breakpilot.com 384 MB
firmwerk-mongo-stage internal, volume 512 MB pre_hook mongodump
otel-agent (observability) internal 192 MB
≈ 6.1 GB committed (6.6 GB with the runner) of 8 GB
NOT on staging (8 GB budget): browserless (Chrome), soft-plc, plc-sim. Scan flows that need them
(DAST, ICS probe) are tested against external demo targets (cra-vuln-demo) or on the prod node
later; scan types that need Chrome are marked "unavailable on staging" in the E2E matrix (M-MIG-8).
bp-platform-prod (agent, 46.225.108.74, CPX42 16 GB) ≈ 8.8 GiB committed
project platform-prod
portal-prod app.breakpilot.com 768 MiB tenants /<slug>, staff /admin
tenant-registry-prod registry.breakpilot.com 512 MiB licences, ERP link (live erp.breakpilot.com)
pg-prod internal, volume 1 GiB dump hook + 02:30 cron
docs-prod docs.breakpilot.com 64 MiB VitePress, DE + EN
project pruefwerk-prod
pruefwerk-dashboard-prod pruefwerk.breakpilot.com 640 MiB
pruefwerk-agent-prod internal 3 GiB
pruefwerk-mcp-prod pruefwerk.breakpilot.com/mcp 256 MiB
pruefwerk-mongo-prod internal, volume 1.5 GiB
project firmwerk-prod
firmwerk-cloud-prod firmwerk.breakpilot.com 384 MiB
firmwerk-mongo-prod internal, volume 512 MiB
otel-agent-prod 192 MiB
bp-platform-stage (master, 178.105.223.117, CPX32 8 GB) ≈ 6.5 GiB committed
project platform-stage portal-stage (app-stage.), tenant-registry-stage (registry-stage.), pg-stage,
docs-stage (docs-stage.), erpnext-mock-stage (internal, stage only)
project pruefwerk-stage dashboard (pruefwerk-stage.), agent 1.25 GiB, mcp (/mcp), docs (/docs), mongo 768 MiB,
werkbank-runner-stage (stage only)
project firmwerk-stage firmwerk-cloud-stage (firmwerk-stage.), firmwerk-mongo-stage
otel-agent-stage
NOT deployed anywhere yet (need more memory): browserless (Chrome), soft-PLC, PLC-sim.
Prüfwerk runs PW_FEATURES=source_only on both environments (no DAST, pentest, PLC runtime).
```
### Platform cluster — prod node (later, same shape)
Per-service detail (images, memory): `BreakPilot Infra/Infrastructure Architecture/Service Catalog`.
`bp-platform-prod` (agent): projects `platform-prod`, `pruefwerk-prod`, `firmwerk-prod` with the same services minus `erpnext-mock`; talks to the live `erp.breakpilot.com`. After M-MIG-9 the `dsms` project (12 services) is added, initially on the stage node until the prod node exists.
### Calls from the platform cluster into core (all HTTPS, all public hostnames)
### Calls from the platform cluster into core (all HTTPS, public hostnames)
```
→ auth.breakpilot.com OIDC, JWKS, admin API (tenant-registry-svc-{env})
→ auth.breakpilot.com OIDC, JWKS, admin API (tenant-registry-svc-{env}); staff via the company-realm broker
→ erp.breakpilot.com ERPNext REST + inbound webhooks (prod only; stage uses the mock)
→ repo.breakpilot.com image pulls (docker login per node)
→ llm.breakpilot.com LiteLLM (Prüfwerk triage, Werkpilot)
→ otel.breakpilot.com traces/logs/metrics
→ secrets.breakpilot.com licence signing key, CI credentials (bootstrap only)
→ git.breakpilot.com webhooks INTO the platform master come from Gitea Actions runners
→ llm.breakpilot.com LiteLLM (Prüfwerk triage, Werkpilot, portal assistant)
→ otel.breakpilot.com traces, logs, metrics
→ smtp.strato.de noreply@breakpilot.com (registry mails, Keycloak invites)
← git.breakpilot.com CI calls the stage master's signed webhook (stage only)
```
### Stage isolation rules (enforced at the platform, not in product code)
### Stage isolation (enforced by the platform, not by product code)
| Risk | Enforcement mechanism | Owner |
| Risk | Enforcement | Status |
|---|---|---|
| Stage writes to prod database | Separate VM, separate Orca projects, **project-scoped secrets** (`*-stage` never sees `*-prod` keys; prod values are never set globally). | Infra plane |
| Stage emails real customers | Realm `breakpilot-stage` SMTP = Strato `noreply+stage@`; tenant-registry-stage `EMAIL_ALLOWLIST_DOMAINS=breakpilot.com`; only `@breakpilot.com` test users exist in the realm. | Control plane |
| Stage creates real ERP records | Stage has no ERPNext credentials at all; `ERP_BASE_URL` points at `erpnext-mock-stage`. | Control plane |
| Stage JWT used in prod | Different realm → different issuer; every prod service pins `iss` and `aud`. | Identity plane |
| Stage load hurts prod | Different VM. Shared core services (Keycloak, LiteLLM) rate-limit per client. | Identity plane |
| Stage CI token deploys prod | Orca tokens are cluster-wide (no per-project RBAC) → prod deploys use a separate `prod` branch webhook + HMAC secret; the stage deployer token is never stored in a repo that can reach prod projects. **Residual risk, see RISK-2.** | Infra plane |
| Stage writes to prod data | Separate VM, Orca projects and project-scoped secrets; prod values never global (`scripts/prod-secrets.sh` checks the project scope). | in place |
| Stage mails real customers | Stage realm and registry send only for test workspaces; Strato does not deliver plus addresses, so real mailboxes are used for tests. | in place |
| Stage creates real ERP records | Stage has no ERPNext credentials; `ERP_BASE_URL` points at `erpnext-mock-stage`. | in place |
| Stage JWT used in prod | Different realm → different issuer; services pin `iss` and `aud`. | in place |
| Stage load hurts prod | Different VM; shared Keycloak and LiteLLM. | in place |
| Stage CI deploys prod | Prod has **no webhooks and no `:latest`**; only a merged promotion PR changes a prod image (by digest). Orca tokens are still cluster-wide (RISK-2). | in place |
---
## 3. Network Topology
```
INTERNET
│
(breakpilot.com zone at Strato — manual A records, no wildcard)
│
┌──────────────────────────────┼───────────────────────────────┐
│ │ │
┌────▼────────────────┐ ┌─────────▼───────────┐ ┌──────────────▼────────┐
│ CORE master │ │ CORE workhorse │ │ bp-platform-stage │
│ 46.225.100.82 │ │ 178.105.159.224 │ │ <stage IP> │
│ auth git repo llm │ │ erp cloud signoz │ │ app-stage registry- │
│ secrets status chat │ │ meet design crates │ │ stage pruefwerk-stage │
│ breakpilot.com │ │ │ │ firmwerk-stage │
└─────────────────────┘ └──────────────────────┘ └──────────┬────────────┘
│ Hetzner private
│ network 10.10.0.0/16
┌──────────▼────────────┐
│ bp-platform-prod │
│ <prod IP> (later) │
│ app registry licence │
│ pruefwerk firmwerk │
└───────────────────────┘
INTERNET
│ (breakpilot.com at Strato — manual A records, no wildcard)
┌──────────────────────────────┼──────────────────────────────┬──────────────────────────────┐
┌──────▼──────────────┐ ┌───────────▼──────────┐ ┌───────────────▼───────┐ ┌─────────────▼─────────┐
│ CORE master │ │ CORE workhorse │ │ bp-platform-stage │ wg0 │ bp-platform-prod │
│ 46.225.100.82 │ │ 178.105.159.224 │ │ 178.105.223.117 │◄──────►│ 46.225.108.74 │
│ auth git repo llm │ │ erp cloud signoz │ │ app-stage registry- │10.66.0.1 10.66.0.2 │
│ secrets status chat │ │ meet design crates │ │ stage pruefwerk-stage │ UDP │ app registry │
│ breakpilot.com │ │ element collabora │ │ firmwerk-stage docs- │ 51820 │ pruefwerk firmwerk │
│ pitch *-dev.ai │ │ otel (CI runner) │ │ stage │ │ docs │
└─────────────────────┘ └──────────────────────┘ └───────────────────────┘ └───────────────────────┘
Firewall (Hetzner Cloud Firewall, per platform VM):
22/tcp admin IPs only
80,443/tcp any
6880/tcp (orca API + agent websocket) private network only, plus the Gitea runner egress IP for webhooks
6881/tcp (orca agent) private network only
everything else drop
Master ↔ agent: WireGuard wg0 only (Orca's agent channel is plain ws:// and carries resolved secrets).
The agent announces "bp-platform-prod:6881" → the stage master has /etc/hosts 10.66.0.2 bp-platform-prod.
Ingress (per node, Orca built-in proxy, HTTP-01 ACME):
bp-platform-stage
app-stage.breakpilot.com → portal-stage:3000
registry-stage.breakpilot.com → tenant-registry-stage:8090
pruefwerk-stage.breakpilot.com → pruefwerk-dashboard-stage:8080
/mcp/* → pruefwerk-mcp-stage:8090 (strip_prefix)
/docs/* → pruefwerk-docs-stage:80 (VitePress base /docs/)
firmwerk-stage.breakpilot.com → firmwerk-cloud-stage:8080
bp-platform-prod
app. registry. licence. pruefwerk. firmwerk.breakpilot.com (same targets, -prod)
Firewall
bp-platform-prod (ufw): 22, 80, 443, 51820/udp; everything on wg0; drop the rest.
bp-platform-stage: 22, 80, 443; 6880 reachable for the CI webhook (HMAC-signed); WireGuard peer of prod.
Cross-node traffic: Docker bridge networks are node-local. Anything that must cross VMs uses public HTTPS
(there is nothing stage↔prod by design). Master↔agent Orca traffic uses the private network.
Ingress (per node, Orca proxy, HTTP-01)
prod: app. → portal-prod:3000 · registry. → tenant-registry-prod:8090 · docs. → docs-prod
pruefwerk. → dashboard-prod, /mcp/* → mcp-prod (strip_prefix) · firmwerk. → firmwerk-cloud-prod
stage: the same with -stage, plus pruefwerk-stage…/docs/* → pruefwerk-docs-stage
Cross-node traffic: Docker networks are node-local; nothing talks stage ↔ prod by design.
```
DNS records to add at Strato (stage): `app-stage`, `registry-stage`, `pruefwerk-stage`, `firmwerk-stage` → stage IP. Prod adds `app`, `registry`, `licence`, `pruefwerk`, `firmwerk` → prod IP. Lower TTLs before any cutover; a certificate is only issued after the A record points at the node.
DNS at Strato (all set): stage `app-stage`, `registry-stage`, `pruefwerk-stage`, `firmwerk-stage`, `docs-stage` → `178.105.223.117`; prod `app`, `registry`, `pruefwerk`, `firmwerk`, `docs` → `46.225.108.74`. There is no `licence.` host: the licence endpoint is part of the registry.
---
## 4. Storage
```
┌────────────────────┬──────────────────────────────────────────────────┬─────────────────────────┐
│ Node │ Data stores │ Disk │
├────────────────────┼──────────────────────────────────────────────────┼─────────────────────────┤
│ bp-platform-stage │ pg-stage, pruefwerk-mongo-stage, firmwerk-mongo- │ local NVMe (flavor); │
│ │ stage, Docker volumes (orca-*) │ add a Hetzner Volume │
│ │ │ (€0.05/GB) when > 60 % │
│ bp-platform-prod │ pg-prod, mongo-prod ×2, later dsms (pg17, IPFS, │ local NVMe + Hetzner │
│ │ qdrant, dataroom, ollama) │ Volume for dsms │
└────────────────────┴──────────────────────────────────────────────────┴─────────────────────────┘
┌────────────────────┬──────────────────────────────────────────────────────────┬───────────────────────────┐
│ Node │ Data stores (Docker volumes orca-*) │ Disk │
├────────────────────┼──────────────────────────────────────────────────────────┼───────────────────────────┤
│ bp-platform-stage │ pg-stage, pruefwerk-mongo-stage, firmwerk-mongo-stage │ local 150 GB (46 %) │
│ bp-platform-prod │ pg-prod, pruefwerk-mongo-prod, firmwerk-mongo-prod │ local NVMe; Hetzner │
│ │ │ Volume when > 60 % │
└────────────────────┴──────────────────────────────────────────────────────────┴───────────────────────────┘
Object storage (Hetzner Object Storage, nbg1, S3-compatible):
s3://bp-platform-backups Orca nightly backups of the platform cluster (separate from core's bp-orca-backups)
s3://bp-seed-data demo tenant fixtures (platform/seed-data)
s3://bp-exports GDPR / offboarding ZIPs (signed URLs, 7-day TTL)
s3://bp-rag existing dsms RAG bucket (moves with dsms)
s3://bp-sccache, bp-gitea-packages, bp-kellnr-* core (unchanged)
Object storage (Hetzner, nbg1):
s3://bp-platform-backups nightly backups of the platform cluster (age-encrypted, 30 days)
s3://bp-docs-stage|prod customer documents ("Unterlagen"), private, 5-minute signed download links
s3://bp-downloads CLI releases + checksums (public read) for /install/{firmwerk,werkpilot}
s3://bp-rag dsms RAG data (moves with dsms)
core: bp-orca-backups, bp-harbor-registry, bp-gitea-packages, bp-kellnr-*, bp-nextcloud
```
**MongoDB and open files:** Docker's default limit of 1024 open files is too low for Prüfwerk's Mongo (one WiredTiger file per collection and index across all tenant databases). The mongo services start through `bash -c "ulimit -n 64000 && exec docker-entrypoint.sh mongod"` (orca has no ulimit setting): staging since 2026-09-28, production with the next promotion.
---
## 5. Backup Requirements
Orca-native backups per cluster (`[backup]` in each `cluster.toml`): nightly `0 0 3 * * *`, local copy + S3, per-datastore logical dumps via `pre_hook` (`pg_dumpall`, `mongodump`, `mariadb-dump`). Retention 14 days core (existing), 30 days platform.
Orca-native backups per cluster: nightly at 03:00, local copy + S3, **age-encrypted** (private key offline in KeePass). Consistent logical dumps (`pg_dumpall`, `mongodump`, `mariadb-dump`) land in each database volume first — through the `pre_hook`s and, on the platform nodes, `scripts/db-dumps.sh` from cron at 02:30. Retention: core 14 days, platform 30 days (staging included).
```
┌──────────────────────────────┬──────────────────────┬────────────┬───────────┬────────────────────┐
│ Data store │ Method │ Frequency │ Retention │ Owner │
├──────────────────────────────┼──────────────────────┼────────────┼───────────┼────────────────────┤
│ keycloak-db (core) │ pg_dumpall pre_hook │ nightly │ 14 d │ Identity plane │
│ keycloak realm export │ kc export → S3 │ on change │ 14 d │ Identity plane │
│ gitea-db + repos (core) │ pre_hook + volume │ nightly │ 14 d │ Infra plane │
│ harbor (core) │ db pre_hook; images │ nightly │ 14 d │ Infra plane │
│ │ rebuildable from CI │ │ │ │
│ erpnext mariadb (core) │ mariadb-dump pre_hook│ nightly │ 14 d │ Control plane │
│ pg-prod (tenant-registry) │ pg_dumpall pre_hook │ nightly + │ 30 d │ Control plane │
│ │ + 6-hourly cron dump │ 6 h │ │ (RPO ≤ 6 h) │
│ pruefwerk-mongo-prod │ mongodump pre_hook │ nightly │ 30 d │ App plane │
│ firmwerk-mongo-prod │ mongodump pre_hook │ nightly │ 30 d │ App plane │
│ dsms (pg17, IPFS, qdrant…) │ pre_hooks + volumes │ nightly │ 30 d │ App plane │
│ stage * │ nightly (convenience)│ nightly │ 7 d │ — (no SLA) │
│ Orca config (IaC) │ Gitea │ on commit │ forever │ Infra plane │
└──────────────────────────────┴──────────────────────┴────────────┴───────────┴────────────────────┘
┌──────────────────────────────┬──────────────────────────┬────────────┬───────────┬────────────────────┐
│ Data store │ Method │ Frequency │ Retention │ Status │
├──────────────────────────────┼──────────────────────────┼────────────┼───────────┼────────────────────┤
│ keycloak-db (core) │ pg_dumpall pre_hook │ nightly │ 14 d │ in place │
│ keycloak realm definitions │ orca-platform/keycloak/ │ on change │ git │ in place (partial │
│ │ *.json + scripts │ │ │ export + scripts) │
│ gitea-db + repos (core) │ pre_hook + volume │ nightly │ 14 d │ in place │
│ harbor (core) │ db pre_hook; images │ nightly │ 14 d │ in place │
│ erpnext mariadb (core) │ mariadb-dump pre_hook │ nightly │ 14 d │ in place │
│ pg-prod (tenant-registry) │ pg_dumpall hook + cron │ nightly │ 30 d │ in place; drilled │
│ pruefwerk-mongo-prod │ mongodump hook + cron │ nightly │ 30 d │ in place; drilled │
│ firmwerk-mongo-prod │ mongodump hook + cron │ nightly │ 30 d │ in place │
│ documents (bp-docs-prod) │ S3 (Hetzner) │ — │ — │ single copy │
│ stage * │ same as prod │ nightly │ 30 d │ in place │
│ Orca config (IaC) │ Gitea │ on commit │ forever │ in place │
└──────────────────────────────┴──────────────────────────┴────────────┴───────────┴────────────────────┘
```
**Known gaps (carried from the as-built runbook):** Orca backups are unencrypted (orca #117) and include `secrets.json`; restores are untested → a restore drill is part of M-MIG-8; both copies live at Hetzner (no 3-2-1) → add a second S3 provider before production.
**Drills:** `pg-stage` 2026-09-12; production Postgres and Mongo 2026-09-24/25 — both restored into scratch containers. **Open:** the 6-hourly pg-prod dump for RPO ≤ 6 h is not set up yet (nightly only: RPO ≤ 24 h today); a second storage provider (3-2-1); a copy of the uploaded documents outside the bucket.
### RPO by data criticality
### RPO by data criticality (targets)
```
CRITICAL (RPO ≤ 6h) keycloak-db · pg-prod (tenants, subscriptions, licences, audit) · erpnext mariadb
IMPORTANT (RPO ≤ 24h) pruefwerk-mongo-prod · firmwerk-mongo-prod · dsms postgres + IPFS
RECOVERABLE harbor images (CI) · qdrant (rebuildable) · gitea (mirrored on laptops)
NOT BACKED UP stage data beyond 7 days · redis caches · browserless
IMPORTANT (RPO ≤ 24h) pruefwerk-mongo-prod · firmwerk-mongo-prod · customer documents
RECOVERABLE harbor images (CI) · gitea (mirrored on laptops) · docs site (built from git)
NOT BACKED UP redis caches · scan working copies (/tmp in the agent)
```
---
@@ -254,7 +238,7 @@ Constraint types (AVAILABILITY, RTO, RPO, IaC, SECRET_HYGIENE, NETWORK, DATA_RES
║ INFRA PLANE (both clusters) ║
║ BACKUP per cluster bucket · IaC all services in Gitea · IMMUTABILITY git → orca deploy║
║ SECRET_HYGIENE project-scoped Orca secrets, Infisical for signing keys ║
║ NETWORK per-node ingress, Hetzner firewall, private network for master↔agent ║
║ NETWORK per-node ingress, host firewall, WireGuard wg0 for master↔agent ║
║ DATA_RESIDENCY Hetzner DE · COLD_START ordering (§10 F) · STAGE_ISOLATION (§2) ║
╚════════════════════════════════════════════════════════════════════════════════════════╝
```
@@ -289,36 +273,41 @@ Measured via `status.breakpilot.com` (Gatus, 3-fail, 30-day rolling) per `Breakp
## 8. IaC Constraint (Orca)
Every platform service is declared in `platform/orca-platform`, every core service in `sharang/orca-infra`. No exceptions.
Every platform service is declared in `platform/orca-platform`, every core service in `sharang/orca-infra`. No exceptions (the Gitea runner on the workhorse is the one container outside Orca).
```
1. ALL containers run via Orca service files committed to Gitea
→ platform: services/<project>/service.toml (Orca-native TOML; one [[service]] per container)
→ Changes go through: Gitea PR → CI (validate.sh, gitleaks, trivy) → merge → `git pull && orca deploy` on the master
→ Image changes go through: product CI → Harbor → signed webhook → orca redeploy
→ platform: services/<project>/service.toml (one [[service]] per container)
→ config changes: PR → CI (validate.sh, gitleaks) → merge → the master pulls and deploys (push hook)
2. EVERY platform service is pinned: [service.placement] node = "bp-platform-stage" | "bp-platform-prod"
→ validate.sh fails the PR otherwise (unpinned = lands on the master)
→ validate.sh fails the PR otherwise; it also rejects :latest on -prod and fixture mode on stage
3. Service names are unique cluster-wide and suffixed by environment (-stage / -prod)
→ stage and prod are separate projects with separate Docker networks
4. Secrets are project-scoped: `orca secrets set --project <p> KEY value`
→ production values are NEVER set globally (project secrets fall back to global)
→ Orca env references `${secrets.KEY}` only; no values in service files
→ scripts/prod-secrets.sh sets the prod keys and checks the project section, not the fallback
5. Resource limits MANDATORY: resources.memory on every service (validate.sh)
5. resources.memory on every service (validate.sh)
6. Restart policy: always; health check per service (HTTP or TCP)
6. Images
→ staging: product CI pushes :sha-<short> and :latest to Harbor, then calls the signed webhook
(orca redeploy <svc>-stage)
→ production: no webhooks, no :latest. scripts/promote.sh reads the digest staging runs and writes
image = "<repo>@sha256:…" into services/*-prod; the PR is merged only after the founder's go
→ releases: platform v0.1.0 (portal, tenant-registry, product-docs, 2026-09-29) goes to production
together with Prüfwerk v0.4.x
7. Images: product images are pushed with :sha-<short> and :latest; `orca redeploy` re-pulls.
Pin by digest for cutovers. Prod promotion = retag :sha-… as :prod-<version> (prod plan).
8. NO manual docker run / compose on any node. SSH for debugging only. Every node has
7. NO manual docker run / compose on any node. SSH for debugging only. Every node has
`docker login repo.breakpilot.com` done once at provisioning.
9. Orca control plane state is recoverable: service files in Gitea = desired state;
losing the master = re-install Orca on the same VM, restore ~/.orca from backup, `orca deploy`.
8. Keycloak realms (core instance) are changed by scripts, reviewed in orca-platform and run on the
core master: scripts/import-realm.sh (realm + settings a partial export lacks), scripts/staff-sso.sh
(company-realm broker for staff)
9. Orca state is recoverable: service files in Gitea = desired state; losing a master = reinstall Orca,
restore ~/.orca (age key needed), `orca deploy`. After `systemctl restart orca`, run `orca deploy`.
```
---
@@ -421,44 +410,45 @@ RISK-1 Core master is a single VM owning auth, git, image registry and LLM.
→ Hetzner snapshot schedule + tested restore; long-term: move Keycloak to its own node.
Priority: HIGH
RISK-2 The staging VM is the platform cluster's only control plane and Orca tokens are cluster-wide
(a stage deployer token can deploy prod).
→ Never store the deployer token where stage-only CI can read it; prod webhooks use their own
HMAC secret; revisit a dedicated control VM at Tier B.
Priority: HIGH (until prod exists: MEDIUM)
RISK-3 One Keycloak instance serves company SSO and both platform realms.
→ Realm-level rate limits per client; realm exports in git; RTO 15 min runbook.
RISK-2 The staging VM is the platform cluster's only control plane and Orca tokens are cluster-wide.
→ Production takes images only through promotion PRs (no prod webhooks); keep deployer tokens
out of CI; revisit a small dedicated control VM at Tier B.
Priority: MEDIUM
RISK-4 pg-prod is a single instance for tenants, subscriptions, licences and audit.
→ 6-hourly dumps in addition to nightly; split audit into its own DB when > 100 tenants.
RISK-3 One Keycloak instance serves company SSO and both platform realms (and now brokers staff
logins into them). → realm changes only by reviewed scripts; RTO 15 min runbook.
Priority: MEDIUM
RISK-5 Stage isolation rests on the six controls in §2.
→ Quarterly red-team: try to read a prod secret from a stage project; try a stage JWT on prod.
RISK-4 pg-prod is a single instance for tenants, subscriptions, licences and audit; nightly dumps only
(RPO ≤ 24 h, target ≤ 6 h). → add the 6-hourly dump; split audit at > 100 tenants.
Priority: MEDIUM
RISK-6 ERPNext → registry webhooks have no guaranteed delivery (Frappe retries are best-effort).
→ Outbox for the up direction, idempotent webhook receiver + 15-min reconcile for the down
direction, alerting on reconcile age. Tested in M-MIG-8 (kill worker, replay).
Priority: HIGH until the M-MIG-8 tests pass, then LOW
RISK-5 Stage isolation rests on the controls in §2. → periodic check: prod secret from a stage project,
stage JWT on prod. Priority: MEDIUM
RISK-7 Orca project secrets fall back to global secrets; a missing stage key silently resolves to a
global value.
→ No global secrets in the platform cluster at all; validate.sh greps service files for
`${secrets.` keys and checks they exist in the project scope (deploy-time check).
Priority: MEDIUM
RISK-6 ERPNext → registry webhooks have no guaranteed delivery. → outbox + idempotent receiver +
15-min reconcile, tested on staging (M-MIG-8). Note: ERPNext's queue workers carry the webhooks;
they were down 2026-09-26 (disk full on the workhorse) until repaired. Priority: LOW–MEDIUM
RISK-8 Backups unencrypted (orca #117) and single-provider.
→ age-encrypt the S3 copy via `[secrets] age_recipients`; second provider before prod.
Priority: MEDIUM
RISK-7 Orca project secrets fall back to global secrets. → no platform secrets set globally;
prod-secrets.sh checks the project scope. Priority: MEDIUM
RISK-9 HTTP-01 cutovers leave a short TLS gap when a hostname moves between nodes.
→ Lower TTLs 24h before; cut over in a night window; verify with `curl -I` immediately.
Priority: LOW
RISK-8 Backups are single-provider (encryption solved: age, since orca 0.3.0-rc).
→ second S3 provider. Priority: MEDIUM
RISK-10 LiteLLM calls external AI APIs. → fallback routing; products degrade gracefully. LOW
RISK-9 Orca does not restart a container that exited (OOM kill, crash): it stays down until
`orca redeploy`. Seen on staging 2026-09-28 (tenant-registry OOM during uploads, since fixed).
→ size limits with headroom; Gatus alerts; health-based restarts in Orca. Priority: HIGH
RISK-10 Container defaults: Docker's open-files limit (1024) broke Mongo on staging 2026-09-28.
→ ulimit start wrapper on all mongo services (stage done, prod with the next promotion).
Priority: HIGH until prod has it, then LOW
RISK-11 One CI runner on the workhorse: serialises all repositories and fills the workhorse disk
(disk-full 2026-09-26). → second runner / own build VM; build-cache pruning. Priority: MEDIUM
RISK-12 LiteLLM calls external AI APIs; intermittent 502s slow Prüfwerk's triage on large repositories.
→ fallback routing; triage cap and parallelism (Prüfwerk). Priority: LOW
```
---
@@ -466,21 +456,22 @@ RISK-10 LiteLLM calls external AI APIs. → fallback routing; products degrade g
## 13. Growth Trajectory
```
Tier A (launch, ≤ 50 cust): stage CX43 + prod ≥16 GB dedicated ≈ €60–90/mo platform compute
Tier B (50–200): bump prod flavor; small control VM as Orca master (RISK-2);
Hetzner Volume for prod data; second S3 provider for backups
Tier A (launch, ≤ 50 cust): stage CPX32 + prod CPX42 (today)
next step on prod: 32 GB (browserless for DAST, dsms after M-MIG-9)
Tier B (50–200): bump prod flavor (dedicated cores); small control VM as Orca master (RISK-2);
Hetzner Volume for prod data; second S3 provider; second CI runner
Tier C (200–500): split prod: app node + db node (pg, mongo); Keycloak to its own core node
Tier D (500+): second prod app node (Orca pins per product), Hetzner LB in front
```
Each step is justified by a measurable signal (> 80% RAM, > 70% CPU, sustained queue depth, or a specific outage). Never split preemptively.
Each step is justified by a measurable signal (> 80 % RAM, > 70 % CPU, sustained queue depth, or a specific outage). Never split preemptively.
---
## 14. Cost summary
See `COST_PLAN.md` (Hetzner). Platform stage ≈ €30/mo; prod sized at prod planning; core cluster unchanged.
See `COST_PLAN.md`. Platform today: stage CPX32 + prod CPX42 + object storage; core cluster unchanged.
---
*End of document. Review after production go-live or any significant infrastructure change. Topology revised 2026-09-11.*
*End of document. As-built update 2026-09-29; review after the pilot and after any significant infrastructure change.*