infra/docs/runbooks
Viktor Barzin deede6dd11 chrome-service: switch to CDP + persistent profile + hourly snapshot pipeline
The chrome-service stack ran `playwright launch-server`, which creates
ephemeral browser contexts per `connect()`. Despite the encrypted PVC
mounted at /profile, no chromium user-data ever persisted — only npm
cache + fontconfig. Logging in via noVNC was effectively a no-op.

Refactor:
- Replace launch-server with direct chromium (TCP CDP on :9223 internal),
  fronted by a Python HTTP+WS bridge on :9222 that rewrites the Host
  header to bypass Chrome's hardcoded DNS-rebinding protection (no
  `--remote-allow-hosts` flag exists in stock Chrome 130; verified by
  binary string grep). Bridge also forces Connection: close on HTTP
  responses so Node ws opens a fresh TCP for the WS upgrade rather than
  trying to reuse the dead keep-alive socket.
- Add `--user-data-dir=/profile/chromium-data` so cookies/localStorage
  actually persist on the encrypted PVC.
- New snapshot-server sidecar (stdlib python HTTP) serves
  GET /api/snapshot at chrome.viktorbarzin.me/api/snapshot,
  bearer-token-gated by the existing api_bearer_token.
- New chrome-service-snapshot-harvester CronJob (hourly) connects via
  CDP, dumps storage_state() (cookies + localStorage), writes atomically
  to /profile/snapshots/storage-state.json.
- NetworkPolicy: TCP/9222 (was :3000), TCP/8088 added for traefik.

Caller migration:
- f1-stream: `chromium.connect(ws_url)` → `chromium.connect_over_cdp(cdp_url)`,
  env var CHROME_WS_URL → CHROME_CDP_URL. CHROME_WS_TOKEN dropped (no
  longer used by code; ExternalSecret kept for symmetry with the snapshot
  endpoint).

Dev-box side (out of scope for this commit — see ~/.config/systemd/user/):
- playwright-mcp.service flips to `--isolated --storage-state=...`
  so per-Claude-Code-session ephemeral contexts seed from the snapshot.
- playwright-snapshot-refresh.{service,timer} (hourly) pulls the
  snapshot via the bearer-gated HTTPS endpoint.

Docs updated:
- docs/architecture/chrome-service.md — new architecture diagram + wire protocol.
- docs/runbooks/chrome-service-snapshot.md — day-2 ops (refresh, rotation,
  failure modes, restore).
- stacks/chrome-service/README.md — connect_over_cdp recipe.

Design spec at docs/superpowers/specs/2026-06-04-playwright-per-session-browser-design.md.
2026-06-05 09:19:10 +00:00
..
beads-auto-dispatch.md claude-agent-service: wire parallel execution (git-crypt mount, memory, MAX_CONCURRENCY) 2026-06-03 10:24:24 +00:00
chrome-service-snapshot.md chrome-service: switch to CDP + persistent profile + hourly snapshot pipeline 2026-06-05 09:19:10 +00:00
forgejo-registry-breakglass.md [ci] Phase 1: infra-ci dual-push + break-glass tarball 2026-05-07 16:01:20 +00:00
forgejo-registry-rebuild-image.md [docs] Forgejo registry image-rebuild runbook 2026-05-07 16:03:34 +00:00
forgejo-registry-setup.md [forgejo] Phase 0 of registry consolidation: prepare Forgejo OCI registry 2026-05-07 15:51:34 +00:00
grow-pve-nfs-lv.md immich: bulk-import Anca's Elements photo archive into her account 2026-05-24 14:12:30 +00:00
immich-transcode-bitrate.md immich runbook: note force=false re-kick gotcha after row deletion [ci skip] 2026-06-02 19:24:30 +00:00
job-hunter.md job-hunter runbook: document two self baselines + taxable_pay gotcha 2026-06-02 23:13:35 +00:00
k8s-node-auto-upgrades.md kured: drop Mon-Fri restriction, reboot any day 2026-05-16 12:29:01 +00:00
k8s-version-upgrade.md docs(k8s-dashboard): dashboard SSO as-built (Option B multi-issuer apiserver) 2026-06-05 09:19:09 +00:00
kms-public-exposure.md docs(kms): SXSMSI/1603 is client-machine-specific (VM 300 pilot) + deep-repair/escalation 2026-06-02 19:24:30 +00:00
mailserver-pfsense-haproxy.md mailserver: split healthcheck path off PROXY-aware listeners + book-search uses ClusterIP 2026-05-05 19:45:33 +00:00
mailserver-proxy-protocol.md [docs] Mailserver architecture — richer diagrams + steady-state accuracy [ci skip] 2026-04-19 12:40:53 +00:00
nextcloud-add-archive.md docs+scripts: lock in nextcloud-as-PVE-NFS-browser surface 2026-05-24 11:45:01 +00:00
nfs-prerequisites.md [docs] Add NFS prerequisite runbook for nfs_volume module [ci skip] 2026-04-19 10:40:55 +00:00
pfsense-unbound.md [dns] Kea: multi-IP DHCP option 6 (10.0.10, 10.0.20) + TSIG-signed DDNS (WS E) 2026-04-19 16:12:23 +00:00
proxmox-host.md [dns] static-client DNS — Proxmox host, registry VM dual-resolver setup (WS F) 2026-04-19 15:43:49 +00:00
r730-ram-upgrade-272gb.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
registry-rebuild-image.md [registry] Stop recurring orphan OCI-index incidents — detection + prevention + recovery 2026-04-19 17:08:28 +00:00
registry-vm.md [forgejo] Phases 3+4+5: cutover, decommission, docs sweep 2026-05-07 18:30:02 +00:00
restore-etcd.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
restore-full-cluster.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
restore-lvm-snapshot.md update backup/DR docs and runbooks for 3-2-1 architecture 2026-04-06 15:06:01 +03:00
restore-mysql.md docs: update MySQL restore runbook + CLAUDE.md after 8.4.9 recovery 2026-05-18 22:51:52 +00:00
restore-postgresql.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
restore-pvc-from-backup.md rename weekly-backup → daily-backup across scripts, timers, services, and docs [ci skip] 2026-04-13 18:37:04 +00:00
restore-vault.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
restore-vaultwarden.md [docs] TrueNAS decommission cleanup — remove references from active docs 2026-04-19 16:55:43 +00:00
scale-k8s-cluster.md runbook: K8s worker scaling for PVC capacity headroom 2026-06-01 19:50:41 +00:00
security-incident.md docs(security): wave 1 plan — Kyverno enforce, NetworkPolicy egress, audit logging, source-IP anomaly 2026-05-18 19:10:16 +00:00
technitium-apply.md [dns] DNS reliability & hardening — Technitium + CoreDNS + alerts + readiness gate 2026-04-19 14:53:41 +00:00
vault-raft-leader-deadlock.md vault runbook + raft/HA stuck-leader alerts 2026-04-22 12:44:46 +00:00
woodpecker-onboard-forgejo-repo.md [woodpecker] Programmatic Forgejo repo registration 2026-05-07 23:33:26 +00:00