Commit graph homek8s/apps/base
Author SHA1 Message Date
Lancelot
3d21e96a9c ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.

The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.

- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
  dynamic local-path PV on siriussec were rebound by name, so runner.ini
  (registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
  NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
  cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.

Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
0fdd918875 Merge pull request #71: netsec(collector): gzip on rotate so 960 MiB holds ~72-100 h of flows 2026-11-27 06:10:18 +00:00
Lance Walters
7e42ad6d1c netsec(collector): gzip on rotate so 960 MiB holds ~72-100 h of flows
The collector wrote 150 MiB plaintext files into a directory capped at 960 MiB,
which bought only ~4-5 h of retention at the measured 4.5-6.2 GB/day
(3380-4280 kB/min) of filtered Hubble JSONL — the cap was sized for a forensic
window, not for hours.

Compress on rotate; no schema change, no filter change, no DS argument change:

* the file being appended stays plain `flows-<ts>-<n>.jsonl` (one file for a
  reader to tail);
* on rotation the closed file is gzip'd to `.jsonl.gz` through a temp name +
  atomic rename, in the background, so a reader never sees a partial archive and
  the flow reader never stalls (stalling it makes the agent drop events);
* prune bounds the WHOLE directory at MAX_TOTAL_BYTES = 960 MiB — archives and
  in-flight `.gz.tmp` included — deleting oldest first, and never reaps the live
  file nor a file whose gzip is still running (that would discard the archive
  and lose the entire file);
* MAX_FILES now bounds plain files only. Applying it to the archives is exactly
  what would keep retention at a few hours.

Measured on this node's live data 2026-11-27: 18.53x ratio at gzip -9
(17.85x at -6), i.e. 960 MiB holds 72.6 h at the 6.16 GB/day burst sample,
92 h at 4.87 GB/day and ~100 h at the 4.48 GB/day 55-minute average.

Verified offline against a replaying fake `hubble` (rotation->archive parity,
gzip -t on every archive, atomicity, oldest-first prune, live-file and in-flight
protection) and inside the real cilium image under dash (23 rotations -> 23
valid archives, no loss).
2026-11-27 01:09:57 -05:00
sirius
a6499bf1c2 ci(runners): re-own the actions cache recursively so uid-1000 jobs stop dying in checkout
The fix-data-perms init container guarded a chown -R behind a TOP-LEVEL owner
check (`stat -c %u /data/.cache`). /data/.cache was already 1000 while the git
pack files inside it were still root:root from the pre-uid-1000 runner, so the
guard skipped exactly the file that matters and every job on that runner died
in actions/checkout, before a single step:

  open /data/.cache/act/actions-checkout@v4/.git/objects/pack/pack-ba0cccfe….pack:
  permission denied

That is a 3 s red X with zero steps on a push (websites run 1430, card
t_29249bf0). chown the three trees the runner writes recursively instead
(cache/, .cache/, runner.ini); /data/docker stays root-owned and unwalked.

Also document the Recreate consequence: a template rollout SIGKILLs in-flight
jobs and Forgejo reports them as a plain failure with the log cut off mid-step
(sirius-growth push run 1422: 14 min red, log ending at 'Fetching the
repository').
2026-11-27 01:08:34 -05:00
44a765452b Merge pull request #65: contact APIs: pin the F13 images 2026-11-27 05:57:29 +00:00
Sirius DevOps
0e738be671 contact APIs: pin the images carrying the F13 bounded _hits fix
All three contact APIs were still running the pre-F13 tree: unbounded
per-IP _hits deque and an unvalidated X-Real-IP limit key.

- siriusdevops-contact:467b087 (CI run 64 at the F13 merge 467b087)
- sirius-growth-contact:97cfa4f (main head = F13 merge 3042edc + the
  deploy-contact buildx fix f3a9cae; run 126 job 2074)
- phs-contact:0446be8 (main head = F13 merge bd64105 + buildx fix
  0d6d5e3 + the phs Telegram HTML fix 64f1b5b; run 126 job 2075)

The two latter merge shas had no image: their build failed on
'could not obtain buildx' until the workflow fix, so the pinned tags are
the current heads, which contain the F13 tree.
2026-11-27 00:57:17 -05:00
50ee0d23f4 fix(f6): re-own the actions cache for the uid-1000 runner (#62) 2026-11-27 05:52:49 +00:00
a8534bae42 fix(f6): fix-data-perms must run as root; PSA labels for logging + cnpg-system (#58) 2026-11-27 05:48:40 +00:00
c1d29ad87a fix(forgejo): restore the initContainers key #54 lost, unblocking the apps Kustomization
#54 (secops F6) inserted the new fix-data-perms init container at the
tolerations list indentation instead of under an initContainers key, and dropped
the key itself. YAML still parsed (a list item with name/image/... is just a
malformed toleration), so the merge was green, but the API rejects it:

  Deployment.apps "forgejo-runner-arm64" is invalid:
  spec.template.spec.tolerations[1].operator: Invalid value: "": operator must
  be Exists when key is empty

That failed the dry-run of the whole apps Kustomization, so nothing in
apps/home could be applied at all - including any secret rotation - until it was
fixed. Nothing was pruned or broken in the cluster: the rejected revision never
applied.

Restores the initContainers: key above the block; the container's own body is
untouched, so F6's intent (re-own the PVC as 1000:1000 instead of chmod 666 on
the dind socket) is preserved.

Verified: the file parses to tolerations=[dedicated/Equal/network/PreferNoSchedule],
initContainers=[fix-data-perms], containers=[dind, runner]; server-side dry-run of
this Deployment succeeds; server-side dry-run of all 116 non-Secret objects in
apps/home reports no errors.
2026-11-27 00:46:30 -05:00
cb387a8121 secops(f6): de-privilege CI job containers + runner uid, add Pod Security labels (#54) 2026-11-27 05:42:39 +00:00
Lance Walters
584036631d osint: pin app image to amd64-6066ac8e0d6c (PR #71, openapi adminSession scheme)
The FastAPI app now publishes components.securitySchemes.adminSession
(apiKey/in:cookie/osint_session) and stamps security on every documented
operation from auth.is_public(). Merged as 6066ac8e0d6c in
sirius/osint-dashboard (PR #71); CI pushed
forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-6066ac8e0d6c
(digest sha256:bf5f3d4ffbb7ae8cbe54fcf5f5b81cd5a1815d8abf9e042c2804f5a2d207ae6c).

The live /openapi.json keeps advertising no securitySchemes until this tag
is running, which is what F17 flagged.
2026-11-27 00:41:02 -05:00
a4cc2d87bc secrets: SOPS the backup SSH key and monitoring's hand-made Secrets (F12, part 2)
Completes F12 on the objects deliberately held back until the delete-and-reconcile
drill on siriusdevops/siriusdevops-contact had proved the path works (it did:
deleted 05:29:03Z, recreated by Flux 05:29:05Z, byte-identical, pod restarted off
the recovered Secret and /health 200 — see docs/secrets-sops.md).

* cluster-backup-ssh in forgejo, sirius-growth and monitoring — three files, one
  plaintext ed25519 key: a Secret cannot cross namespaces and each backup
  CronJob mounts its own namespace's copy, so all three must exist and all three
  must be rotated together.
* monitoring/grafana-admin, monitoring/grafana-secret-key and
  monitoring/alertmanager-telegram, which are the *inputs* the prometheus-operator
  and Grafana consume; the operator's rendered prometheus-*/alertmanager-* objects
  stay excluded (a second writer would fight it).
* monitoring Kustomization gains the same sops decryption block as apps.

All six files were generated from the live objects and decrypt to a byte-identical
data map and type, so this apply is a no-op.
2026-11-27 00:30:24 -05:00
c8f0834886 secrets: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12)
Nothing in the cluster was reconciled from the repo: 67 hand-made Secrets and no
managed Secret at all, so a restore of this Git tree produced a cluster that would
not start. This commits the first-party ones as SOPS/age ciphertext and enables
Flux's sops decryptor.

* provider: SOPS + age (chosen over SealedSecrets: Flux already ships the sops
  decryptor, so no extra controller/CRD, and the age key is escrowed off-cluster).
* 29 Secrets across forgejo, siriusdevops, piedmont, sirius-growth, osint,
  metabase and customer1, as apps/base/<ns>/secret-<name>.sops.yaml with
  encrypted_regex ^(data|stringData)$ — names/namespaces stay reviewable.
* each file was generated from the LIVE object and decrypts to a byte-identical
  data map and type, so the first apply is a no-op (not a rotation).
* the CNPG bootstrap secrets (forgejo-pg-app, pg-app, sirius-growth-portal-db)
  are ours, not operator output — bootstrap.initdb.secret points at them, so a
  rebuild has no application password without them.
* forgejo-pull is included despite docs/registry-pull-auth.md calling it
  out-of-band: with imagePullSecrets on every workload it is the one Secret whose
  absence stops the whole cluster from pulling images.
* .gitignore keeps **/*secret*.yaml ignored and re-includes only .sops.yaml, so a
  plaintext Secret still cannot be committed; age.agekey stays ignored.
* excluded on purpose (controller/helm-owned): CNPG *-server/*-replication/*-ca,
  cnpg-system CA+webhook, cert-manager webhook CA, cilium/hubble certs, helm
  release records, prometheus-operator rendered prompts. Full table in
  docs/secrets-sops.md.

Key locations (never in git): Secret flux-system/sops-age (age.agekey) and
/root/sops/homek8s-age.key on the Linode, reached only over the mesh.
2026-11-27 00:18:14 -05:00
bc942e2571 registry(auth): require auth for image pulls (audit F11)
Forgejo 16 mints an anonymous ("ghost user") registry token on /v2/token and
grants it Read on every package regardless of repo visibility, so all 18 app
images were world-downloadable — including images of private repos
(siriusdevops-site, phs-site, sirius-growth-*, sgs-leadgen).

* FORGEJO__service__REQUIRE_SIGNIN_VIEW=true: /v2/token answers UNAUTHORIZED
  to anonymous clients, anonymous manifests get 401. This is the documented
  switch in routers/api/packages/container (Authenticate) and
  services/context/package.go (determineAccessMode). Side effect: the Forgejo
  web UI/API becomes login-only for anonymous visitors.
* imagePullSecrets: [forgejo-pull] on all 18 workloads that pull from the
  registry (osint, piedmont, sirius-growth, siriusdevops). The
  kubernetes.io/dockerconfigjson Secret is per-namespace and out of band
  (never in git); docs/registry-pull-auth.md documents why, how to recreate
  it, and the verification commands. No containerd-level credential.
2026-11-27 00:15:20 -05:00
Lance Walters
2e52bfad24 apps(secops): scoped read-only auditor ServiceAccount + ClusterRole (F8)
Security runs had no read-only identity: every audit ran as kubernetes-admin
(system:masters), the identity that can delete the cluster, so the auditor was
the largest privilege holder in the environment.

New ns secops with SA secops-auditor bound to a from-scratch ClusterRole:

  get,list,watch  pods services endpoints events configmaps namespaces nodes
  get,list,watch  * in apps, batch, networking.k8s.io,
                    gateway.networking.k8s.io, cilium.io
  get             pods/log

Deliberately absent: secrets (all verbs), pods/exec, pods/attach, every write
verb, impersonate/escalate/bind. Not bound to view/edit/admin (all three carry
Secrets; edit reads Secret data).

The bearer token is a credential and is generated out of band into
~/.kube/secops.yaml (mode 600) — see the SA manifest comment for the one-liner.
2026-11-27 00:08:14 -05:00
c0cf2925dc apps(netsec): hubble-flow-collector DaemonSet — filtered flow capture on siriussec (#39) 2026-11-27 05:03:11 +00:00
Lance Walters
ae22aab330 apps(customer1): anonymize client name — farrisilk -> customer1
Rename the client-shaped lab replica namespace and its manifests to keep the
client name out of the repo going forward (git history is intentionally not
rewritten).

- apps/base/farrisilk -> apps/base/customer1 (namespace, workloads, PVCs,
  HTTPRoutes, backup CronJob, README)
- infrastructure/networking/internal/gateway-farrisilk-{odoo,metabase}.yaml ->
  gateway-customer1-{odoo,metabase}.yaml (listener ports unchanged: 8086/8087)
- firewall comment headers updated (rules/ports untouched)

No functional change beyond object names; workloads remain parked at 0.
2026-11-24 01:46:25 -05:00
Lance Walters
f9888c63f0 apps(siriusdevops): pin site to 399c421f — zero em dashes on /, /book, /lab 2026-11-24 00:20:02 -05:00
Lance Walters
f5cb4ec22a apps(siriusdevops): pin site to 04b36fed — telemetry 7 / 7 Flux Kustomizations 2026-11-24 00:09:28 -05:00
Lance Walters
955f886d36 apps(siriusdevops): pin site to 398b5353 — homepage sheet roles 2026-11-24 00:02:35 -05:00
Lance Walters
5b26ecd823 apps(siriusdevops): pin site to 0e91b466 — /lab briefs rewrite 2026-11-23 23:43:30 -05:00
Lance Walters
cc50d1c231 apps(siriusdevops): pin site to fe2d5bb — Quiet Precision token pass 2026-11-23 23:28:27 -05:00
Lance Walters
648516af71 apps(siriusdevops): pin site to af139906 — five-band homepage repositioning 2026-11-23 23:09:23 -05:00
Lance Walters
82f0d83243 apps(siriusdevops): pin site to e2fd76a — /book drops the public audit price
siriusdevops-site:e2fd76ad (merge of PR #19) replaces the $750–$1,500
audit anchor in the /book funnel with 'scoped and quoted after the review'.
contact-api is unchanged at 8642f1a.
2026-11-23 22:54:10 -05:00
01db28dec5 apps(forgejo): serve a declarative robots.txt that keeps non-portfolio paths out of the index
Self-registration was open until 2026-11-20 and Google indexed spam
profiles under forgejo.siriusdevops.com (/leonabrewton8, /charlinebrando,
.../-/packages). The accounts are deleted and 404 now, but Forgejo's
built-in robots.txt only blocks /explore/*?* and /user/, so /explore/repos
and /search stay crawlable.

Forgejo serves GITEA_CUSTOM=/data/gitea/public/robots.txt at /robots.txt,
so mount a ConfigMap there (the supported custom-public override) and
disallow /explore/*, /user/*, /search*, /api/*, /*/-/packages while
allowing /sirius/* for the portfolio repos.
2026-11-23 22:50:52 -05:00
Lance Walters
79206e0487 ops(farrisilk): park the client replica stack to cut siriussec draw
siriussec is on a 15 W USB-C adapter and low-battery-shutdown fired 2026-11-22
04:20. The farrisilk replica (Odoo + Metabase JVM + Postgres) is the largest
single stack on that node and is not client production. Scale its three
Deployments to 0 and suspend the nightly pg_dump; PVCs and data stay put.

Restore: set replicas back to 1 in odoo.yaml, metabase.yaml, postgres.yaml and
unsuspend backup.yaml, then let Flux reconcile.
2026-11-22 05:54:53 -05:00
Lance Walters
530320bbfe ops(siriussec): bound CPU bursts to the 15W power budget
siriussec is a T480 on a 5V/3A (15W) USB-C supply and died 2026-11-22 04:20
after ~12h on battery. Host PL1 was 25W with turbo on, so any sustained burst
outran the adapter. Cap the two workload-side bursts that can pin cores:

- forgejo-runner-amd64 dind: no CPU limit before -> add cpu: 3
- metabase + farrisilk metabase: cpu limit 2 -> 1 each (two JVMs = 4 threads)

Host-side cap (PL1 12W/PL2 15W, no_turbo=1) is applied by
cpu-power-cap.service on the node itself, not by this repo.
2026-11-22 05:42:52 -05:00
devops
96404c96e1 apps(farrisilk): document backup schedule/restore/RPO + the filestore gap with measured evidence 2026-11-22 02:43:17 -05:00
devops
03fb50c3d7 apps(farrisilk): client-shaped nightly pg_dump cron + 14d retention on a 10Gi PVC 2026-11-22 02:38:35 -05:00
Lance Walters
f658bfabe9 apps(farrisilk): close the metabase_ro schema-CREATE hole + README
metabase_ro could create tables in public: default_transaction_read_only is a
role default the role can lift (SET ... = off), and PG16 keeps CREATE on schema
public for PUBLIC when the database was created by a non-superuser (Odoo creates
its own). Revoke CREATE from PUBLIC and ALL from metabase_ro, grant USAGE only,
in both the first-boot script and the per-start grant pass. README documents the
stack, list_db/workers=0 rationale, module loading, filestore, the DB-only backup
gap (filestore is not covered; follow-up t_8bdd3708) and the Shopify blank.
2026-11-22 02:28:56 -05:00
Lance Walters
4891694f6f apps(farrisilk): name Odoo's database odoo (align with the BI grants + Metabase source)
The card's build section names db `odoo` (owner odoo) and points Metabase at
pg.../odoo, while its Odoo config line said db_name=farrisilk — the two cannot
both hold. Aligned on `odoo`: db_name/dbfilter in odoo.conf and the init
script's ODOO_DB_NAME. The renamed database kept its data (partner 7, product
template 1, base+web+product installed).
2026-11-22 02:25:09 -05:00
Lance Walters
7f7f806616 apps(farrisilk): lab replica stack (Odoo 18 + plain Postgres + Metabase) on :8086/:8087
Odoo 18 (dated tag 18.0-20261112) on a plain postgres:16 container, not CNPG:
the client runs bare Postgres on a Proxmox VM and this namespace mirrors that
shape. Odoo's initContainer installs base,web once, applies the read-only BI
grants/revokes and sets the admin login from a Secret. Metabase gets its own
state in the same Postgres (db metabase) with a 1Gi heap and
MB_ENCRYPTION_SECRET_KEY. Two bare-IP Gateways (8086 odoo, 8087 metabase) in ns
internal, each with its own RouteConfiguration. Host firewall (nft on siriussec,
ufw on rpi) carries 8086/8087 and was installed before the Gateways were pushed.
2026-11-22 02:15:56 -05:00
Lance Walters
930752152e apps(metabase): deploy Metabase (WireGuard-only :8085) with CNPG app DB
- apps/base/metabase: namespace, CNPG Cluster pg (5Gi local-path, siriussec),
  Metabase Deployment v0.65.6.3 (1.5G heap, no PVC), Service, hostname-less
  HTTPRoute on the dedicated metabase Gateway
- infrastructure/networking/internal: new Gateway metabase on port 8085
  (own RouteConfiguration, so it cannot merge with Grafana's bare route)
- host firewall: 8085 in siriussec nft set + rpi ufw guard
2026-11-22 00:32:31 -05:00
Lance Walters
0e5ba18377 apps(osint): pin ingester to amd64-76035535bcb2 (GDELT 15-min GKG bulk ingest) 2026-11-21 18:39:28 -05:00
Lance Walters
1e9253c147 apps(osint): pin ingester to amd64-fc0cd41b7aa4 (GDELT 429 backoff)
osint-dashboard#69: drop the pointless https->http retry on 429, add a
doubling backoff (300s -> 1800s, Retry-After honoured) and log one line
per cycle instead of a traceback. Ingester only; app/camera keep their tags.
2026-11-21 18:15:51 -05:00
Lance Walters
f0a82f85de apps(osint): set PGDATABASE=osint_data on osint-db
deploy/osint-db logged 'FATAL: database "osint" does not exist' straight
after it became ready (2026-11-21 22:15:15): any bare `psql -U osint` /
`pg_dump -U osint` inside the pod defaults the database to the user name.
PGDATABASE makes osint_data the default so ops commands cannot aim at a
database that does not exist. Probes already pass -d osint_data.
2026-11-21 17:58:33 -05:00
Lance Walters
f326735a8b apps(osint): pin app to amd64-54897b49bc57 + ADS-B idle watch env
osint-dashboard#68: the ADSB refresh loop persisted aircraft only for
connected browser viewports, so aircraft_positions stalled whenever nobody
had the map open. The new image sweeps the chokepoint presets while idle;
this commit pins it and sets ADSB_REFRESH_INTERVAL/ADSB_WATCH_* explicitly
instead of relying on app defaults.

ingester/camera keep amd64-915f6cbe25be (no loop change there); pinning the
ingester would restart it for nothing.
2026-11-21 17:42:10 -05:00
Lance Walters
e63c14641d apps(osint): pg image r3 for timescaledb 2.32.1 on PG 16.16
PG 16.16 added the PortalDrop() "cannot drop portal" check that
TimescaleDB <=2.32.0 trips from the background scheduler, so every policy
job (refresh/compression/retention/job history) failed with SQLSTATE 24000
although CALL run_job() worked (timescale/timescaledb#11038, fixed in
2.32.1).

Rebuilt apps/base/osint/pg-image/Dockerfile with:
- base postgres:16.16-bookworm (was floating 16-bookworm)
- timescaledb-2-postgresql-16 / -2-loader-postgresql-16 pinned to
  2.32.1~debian12-1616 (built against PG 16.16)

Pushed as amd64-c48788d4b614-r3 (digest sha256:b2bdc093...), verified by a
throwaway restore of a fresh pg_dump: extension 2.32.0 -> ALTER EXTENSION
UPDATE 2.32.1 -> all 12 jobs Success with real last_successful_finish and
no portal errors.
2026-11-21 17:13:54 -05:00
Lance Walters
c2cdc2d5c1 apps(osint): move osint-db onto a linode-local PVC
osint-db (TimescaleDB+PostGIS) moves from siriussec's local-path PV to a new
15Gi local-path-linode claim restored from a pg_dump (44,120,765 bytes,
sha256 d74afa6d...30da). The Deployment gets a required linode nodeAffinity
plus an amd64 arch selector; the old osint-pgdata claim and its PV are left
untouched so rollback is one revert of claimName + scheduling.
2026-11-21 16:47:03 -05:00
devops
b55ec826c9 apps(osint): place stateless CPU workers on the amd64 linode node
news-scraper, news-summarizer, ingester and nats were hard-pinned to
siriussec (the ThinkPad, on a 15 W USB-C supply that brownouts under load).
Replace the hostname pin with:
  * nodeSelector kubernetes.io/arch=amd64  (keeps them off the arm64 rpi)
  * preferred nodeAffinity weight 100 for kubernetes.io/hostname=linode
still falling back to siriussec if linode is down. No PVCs, images,
resources or taints touched.
2026-11-21 16:24:16 -05:00
9ad79263ab apps(forgejo): disable self-registration (FORGEJO__service__DISABLE_REGISTRATION=true)
Bot signups: 5845 accounts, /user/sign_up served 200. Lock to admin-only
account creation via env (config is env-driven, not app.ini).
2026-11-20 18:46:17 -05:00
devops
e63ba14791 apps(siriusdevops): pin site to 799afe40 (DevOps-repositioned build) 2026-11-20 18:31:15 -05:00
devops
24785a54e8 apps(osint): pin amd64-915f6cbe25be (critical-news renderer fix + Blue Marble default + slower ticker) 2026-11-19 23:48:48 -05:00
Lance Walters
7ae4ac2ee3 docs(osint): CI builds the amd64 cluster images now — retire the manual-build instructions 2026-11-19 23:36:56 -05:00
Lance Walters
1b27ad1120 apps(osint): pin amd64-fe2b5df369d0 (per-article news blips: geolocation API + map layer) 2026-11-19 22:59:37 -05:00
Lance Walters
c6e0081217 apps(siriusdevops): pin contact-api to 8642f1a (Telegram Markdown→HTML lead-drop fix) 2026-11-19 19:33:54 -05:00
Lance Walters
4ffe40e6ca apps(siriusdevops): pin site to c704a2e (post-PR-12 build) 2026-11-19 19:14:54 -05:00
devops
c45255242b db(portal): migrate WAL archiving to the CNPG-I Barman Cloud plugin
CloudNativePG 1.30 deprecates spec.backup.barmanObjectStore and 1.31 removes
it, so the pin on 1.30.0 was a hard gate. This closes that gate:

- Vendors plugin-barman-cloud v0.16.0 verbatim into
  infrastructure/databases/base/upstream/ (the operator manifest's pattern),
  with a kustomize patch only for --log-level=info and resource bounds.
  v0.16.0 requires CNPG >= 1.30 and is registered through Service
  annotations; its operator<->plugin mTLS pair comes from cert-manager
  (previous commit).
- Adds ObjectStore sirius-growth/portal-wal: the literal translation of the
  retired barmanObjectStore block, with retentionPolicy 14d moved off the
  Cluster (in the plugin, retention belongs to the store).
- Cluster portal drops spec.backup entirely and gains spec.plugins
  (barman-cloud.cloudnative-pg.io, isWALArchiver, barmanObjectName
  portal-wal, serverName portal). The server name is the barman prefix, so
  the plugin keeps writing s3://pg-wal-archive/portal/{base,wals}/... — the
  same objects the in-tree archiver left behind; the 14-day window stays
  readable.
- ScheduledBackup portal-daily switches to method: plugin.
- databases waits on cert-manager; apps waits on databases (the ObjectStore
  CRD ships with the plugin).
- CNPG dashboard: the backup timestamp metric family changes name under the
  plugin, so the panel now accepts both.
2026-11-19 17:58:12 -05:00
Lance Walters
953be9f3cf backup(portal): barman-cloud PITR via a Linode-side Garage WAL archive
sirius-growth/portal had a 24h-RPO pg_dump and no way to roll forward. This adds
continuous WAL archiving + a daily base backup into a second, independent Garage
node on the Linode (bucket pg-wal-archive, 10.10.0.5:3900, WireGuard-only), and
proves a restore to a point in time end to end.

- infrastructure/garage-linode/: podman+quadlet unit (the Linode is a kubelet
  node, no docker), garage.toml bound to 10.10.0.5 only, nft guard in PREROUTING
  -140, install.sh, README with the measured disk sizing, pitr-restore.md with
  the rehearsal transcript.
- apps/base/sirius-growth/cluster.yaml: spec.backup.barmanObjectStore
  (destinationPath s3://pg-wal-archive, gzip WAL+data, retentionPolicy 14d),
  credentials from Secret sirius-growth/portal-wal-s3 (out of band, not in git).
- apps/base/sirius-growth/scheduled-backup.yaml: ScheduledBackup portal-daily,
  03:20 UTC, six-field cron.
- docs/cluster-overview.md: §5.1 the WAL store, §8.1 coverage + sizing + gaps,
  §8.3 the PITR restore recipe.

forgejo/pg is deliberately left on pg_dump only (a day of git history is
annoying, not costly); portal keeps its nightly dump as the logical second copy.

Rehearsed 2026-11-19: marker row at 22:35:06Z, unwanted row at 22:35:28Z,
throwaway cluster restored to targetTime 22:35:15Z came back with the marker and
without the later row. See infrastructure/garage-linode/pitr-restore.md.
2026-11-19 17:46:27 -05:00
Lance Walters
c1fe485469 apps(backup): cover the remaining stateful gaps off-host
Four pieces of state were still only on the machine they run on. All four now
land on the Linode over the WireGuard mesh, in the same /root/cluster-backup
tree (or /root/pihost-backup for the Pi) with the same manifest/sha256 habit:

* monitoring/kube-prometheus-stack-grafana — new CronJob `monitoring/grafana-backup`.
  The image is -distroless (no shell), so this mounts the PVC read-write and
  takes a consistent copy with the sqlite backup API (PRAGMA integrity_check on
  the copy), then streams it: grafana/grafana-<stamp>.db, keep 14.
* osint/osint-db — plain Postgres Deployment, so neither the CNPG primary lookup
  nor CNPG_TARGETS reaches it. `forgejo/cluster-backup` gains a PG_TARGETS loop
  that pg_dump -Fc's inside the pod using its own POSTGRES_USER/POSTGRES_DB
  (exec-only RBAC in apps/base/osint/), sha256 checked on both sides.
* sirius-growth/sgs-leadgen-data — new CronJob `sirius-growth/leadgen-backup`,
  link-dest snapshot mirror, keep 7.
* Pi /etc/wireguard + wgportal sqlite — infrastructure/wireguard/backup/,
  nightly systemd timer -> [email protected]:/root/pihost-backup, keep 14.

Each tree carries its own retention, so adding artifacts cannot crowd the
Linode. Docs §8/§8.1/§8.2 record coverage, the accepted gaps (Prometheus TSDB,
camera frames, runner scratch) and the restore procedure — including the
TimescaleDB pre/post-restore calls osint needs.
2026-11-19 17:14:36 -05:00