Merge pull request 'GNAI-025: Fluxer CT 117 — SSO-Abnahme, Verify-Playbook, Logout-Bug-Befund, Cleanup' (#22) from lxc/ct-117-gnai-025-fluxer-chat into main
Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
@@ -42,7 +42,7 @@ jeweiligen Fachdokumenten. Die priorisierte weitere Umsetzung beschreibt der
|
||||
| [CT 101 / GNAI-018](platform/proxmox-server/lxc/ct-101-samba/GNAI-018-REQ_Encoding-Pipeline-Integration.md) | Requirements der Encoding-Pipeline an CT 101 — Übergabe an den Ansible-Rebuild |
|
||||
| [CT 101 / GNAI-019](platform/proxmox-server/lxc/ct-101-samba/GNAI-019-DEC_Ansible-Migration.md) | Entwurfsentscheidungen der CT-101-Ansible-Migration: natives Samba, NFS-Ganesha als Quadlet, Fresh-State-Rebuild |
|
||||
| [CT 114 / GNAI-024](platform/proxmox-server/lxc/ct-114-litecoin-wallet/GNAI-024-PLAN_Litecoin-Wallet-LXC.md) | geplanter Litecoin-Wallet-LXC `ltc-node` (`10.0.0.61`): Prüfung der Research-Dokumente, Tor-only Cold Node, Ansible-Projekt und Provisioning — noch nicht angelegt (Plan 25.11.2026) |
|
||||
| [CT 117 / GNAI-025](platform/proxmox-server/lxc/ct-117-fluxer/GNAI-025-PLAN_Fluxer-LXC.md) | Fluxer-Chat-LXC `fluxer` (`10.0.0.62`) in Betrieb: `https://fluxer.ghostnet.selfhost.eu` live über NPM (LE-Cert), Keycloak-Client `fluxer` angelegt, Split-DNS live, alle CTs konvergiert (`changed=0`); offen: SSO-Verkabelung im Admin-Panel, FRITZ!Box-Voice-Ports, Abnahme (Stand 30.11.2026) |
|
||||
| [CT 117 / GNAI-025](platform/proxmox-server/lxc/ct-117-fluxer/GNAI-025-PLAN_Fluxer-LXC.md) | Fluxer-Chat-LXC `fluxer` (`10.0.0.62`) in Betrieb: `https://fluxer.ghostnet.selfhost.eu` live (NPM → interner Caddy-Edge, alle Pfade), Setup abgeschlossen, SSO aktiviert (Realm `Ghost.net`), Voice-Ports weitergeleitet, agent-seitige Abnahme grün (`changed=0` überall); offen: Browser-SSO-Login, Invite-Codes, Voice-Call-Test (Stand 30.11.2026) |
|
||||
|
||||
### KI und Deployment
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Fluxer Chat LXC (CT 117) – Plan, Machbarkeitsprüfung und Umsetzungsstand
|
||||
|
||||
**Stand:** 2026-11-30
|
||||
**Status:** CT 117 produktiv angelegt; Baseline, Access, Firewall, Podman und der komplette Fluxer-Stack laufen konvergiert (`site.yml`-Zweitlauf `changed=0`, 2026-11-30). Noch offen: Keycloak-Client `fluxer` (Phase 7), NPM-Vhost (Phase 9), Operator-Schritte SSO/DNS/Ports (Phase 8/10), Abnahmetests (Phase 11).
|
||||
**Status:** CT 117 produktiv angelegt; Baseline, Access, Firewall, Podman und der komplette Fluxer-Stack laufen konvergiert (`site.yml`-Zweitlauf `changed=0`, 2026-11-30). SSO-Abnahme abgeschlossen (1.16): Login verifiziert, Logout serverseitig korrekt — SPA-Einschränkung aus Abschnitt 10a dokumentiert und vom Operator akzeptiert. E2E-Testuser und -Artefakte aufgeräumt (1.18). Offen: Invite-only-Verifikation im UI, Voice-Call über WAN, ggf. Upstream-Issue (Abschnitt 11).
|
||||
|
||||
## Änderungsverlauf
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
| 2026-11-30 | 1.11 | Mistral Vibe | Stack läuft **vollständig und konvergiert** (23 Services Up, seaweedfs-init `Exited (0)` Sollzustand, api/postgres/valkey healthy, app-proxy HTTP 200, `site.yml`-Zweitlauf `changed=0`). Sieben weitere podman-compose/LiveKit-Befunde (Detail in Abschnitt 5a): (a) leer-defaultete `${VAR:-}`-Refs bleiben wörtlich im Container-Env, wenn die Var im .env fehlt → api „Invalid email app base URL"; (b) fehlender Podman-Bridge-Egress → LiveKit-STUN-Crashloop; (c) `depends_on: caddy` crasht podman-compose mit KeyError bei deaktiviertem Edge; (d) gepinnte livekit.yaml erwartet `webhook.api_key: fluxer` → LIVEKIT_API_KEY als Bezeichner fix `fluxer`; (e) `podman wait --condition=running` auf den Oneshot seaweedfs-init blockt ewig; (f) Rollen-Verification um den legitimen `Exited (0)` des Init-Containers erweitert; (g) Idempotenz: SHA-verifizierter Download auf separate `docker-compose.upstream.yml`, aktive Compose nur bei Upstream-Änderung erneuert |
|
||||
| 2026-11-30 | 1.12 | Mistral Vibe / Operator | **Domain-Kollision korrigiert:** `chat.ghostnet.selfhost.eu` ist der live produktive OpenWebUI-Nutzerpfad (GNAI-001 M6, NPM → 10.0.0.90:8081) — Fluxer erhält `fluxer.ghostnet.selfhost.eu`. Umgezogen: CT-117-Inventories (`fluxer_stack_public_domain`), Keycloak-Client-Spec (CT-102-Rolle, Sync zieht die Redirect-URIs per PUT), NPM-Vhost-Rolle (CT 103), Pi-hole-Split-DNS (CT 100, `chat.` bleibt OpenWebUI vorbehalten), Doku. Keycloak-Client war zwischenzeitlich mit `chat.`-URIs angelegt (Phase-7-Lauf), wird beim nächsten Sync automatisch korrigiert |
|
||||
| 2026-11-30 | 1.13 | Mistral Vibe / Operator | **Öffentlicher Pfad live:** `https://fluxer.ghostnet.selfhost.eu` → HTTP 200 (LE-Cert), alle vier CTs konvergiert (`changed=0`). Drei Begleitbefunde: (a) **NPM-Vorfall:** der Feature-Branch hatte den nie gemergten lokalen Branch `lxc/ct-103-gnai-006-disk-housekeeping` nicht (NPM 2.15.1→2.17.1, nginx2root/nginx2shell-CVE-Fix vom 26.11.) — der CT-103-Konvergenzlauf baute den Container per Quadlet auf 2.15.1 zurück, der Admin-Backend crashloopete am Migration-Check (`20260906220000_user_permission_meta.js` existiert erst ab 2.16/2.17; öffentliche Vhosts liefen weiter, Admin-API 502). Merge nachgeholt, Quadlet konvergiert auf 2.17.1, Admin-API 200; (b) **Firewall-DNAT-Befund:** per netavark gepublishte Ports laufen nach PREROUTING-DNAT durch die FORWARD-Kette (Ziel = Container-IP im Podman-Netz), input-only-Regeln sehen solchen Traffic nie — Forward-Regeln für NPM→app-proxy/LiveKit-Signaling und (Voice) WAN-Media-Ports ergänzt; (c) **Keycloak-Sync-Drift:** Keycloak liefert `redirectUris` in wechselnder Reihenfolge zurück — Vergleich im Sync-Skript jetzt ordnungsunempfindlich, sonst Dauer-PUT/`changed=1` |
|
||||
| 2026-11-30 | 1.14 | Mistral Vibe | **Befund f revidiert — Caddy-Edge als interner Edge aktiviert:** das app-proxy-only-Routing war unvollständig (die SPA lud, aber /api, /gateway, /media, /admin, Static-Assets fielen auf den SPA-Fallback des app-proxy — die App war faktisch nicht bedienbar). NPM bleibt TLS-Edge; der gepinnte Upstream-Caddy läuft auf CT 117 als interner HTTP-Edge auf :8082 (`FLUXER_CADDY_SITE_ADDRESS=:8082`, kein ACME) und routed laut gepinnter Caddyfile alle Pfade zu den Compose-Services. NPM-Vhost: alles → 10.0.0.62:8082 (WS-Upgrade, lange Timeouts), /livekit/-Location entfernt (caddy routed). App-proxy-Port 8080 und LiveKit-Signaling 7880 nicht mehr gepublisht; Firewall: NPM → 8082 (input + DNAT-forward). Verifiziert: `/api/auth/sso/status` öffentlich 200 (echte API-Antwort), `/admin/login` 200, `/.well-known/fluxer` 200; CT-117- und CT-103-Zweitläufe `changed=0` |
|
||||
| 2026-11-30 | 1.15 | Mistral Vibe / Operator | **Setup + SSO + Voice-Ports eingerichtet (Phasen 8/10):** Setup-Screen per FLUXER_SETUP_TOKEN abgeschlossen (Injection siehe voriger Commit), erster Account = Instance-Admin, SSO im Admin-Panel konfiguriert (enabled, Issuer `https://auth.ghostnet.selfhost.eu/realms/Ghost.net`, Client `fluxer`), FRITZ!Box-Portweiterleitungen (7881/tcp, 7882/udp, 3478/udp, 50000-50100/udp → 10.0.0.62) erstellt. Agent-seitige Abnahme grün: `/auth/sso/start` liefert echte Keycloak-Authorization-URL (PKCE S256), OIDC-Discovery vom CT 117 aus HTTP 200, Gateway-WS (426) und LiveKit-Signaling (401) routen durch NPM→Caddy ohne SPA-Fallback, 7881/tcp offen, 8082 vom LAN geblockt (NPM-exklusiv), unattended-upgrades aktiv. Offen bleiben die Browser-Checks des Operators: SSO-Login, Invite-only-Verifikation im UI, Voice-Call über WAN |
|
||||
| 2026-11-30 | 1.16 | Mistral Vibe / Operator | **SSO-Abnahme abgeschlossen — Logout-Einschränkung dokumentiert und vom Operator akzeptiert („verkraftbar"):** a) SSO-Login vollständig verifiziert (Browser-E2E im gesteuerten Chromium inkl. Keycloak-TOTP + Operator-Login in Firefox/Chromium, normal + privat): `sso/start` → Keycloak (PKCE S256) → Callback → `sso/complete` 200 → Gateway READY. Wichtig für curl-Nachtests: der deployte Build (Stable Web 2026.1124.195247, neuer als der gepinnte Quellcode 3b1eb567) verlangt bei `POST /auth/sso/complete` das `client_binding` aus der Start-Response — ohne → 400 „Invalid or expired SSO state" (State wird dabei konsumiert). b) **DISCOVERY_UPSTREAM_URL-Fix deployiert** (war im Repo vorbereitet, Lauf site35 unterbrochen): der app-proxy pollte alle ~5 min `http://api:8080/api/.well-known/fluxer` → 404 (caddy-:8088-Pfad stript `/api`); korrigiert auf `http://api:8080/.well-known/fluxer` im compose-Override; Läufe site36/site37, Zweitlauf `changed=0`, Branding-404-Warnungen im app-proxy-Log beseitigt. c) **Logout-Bug charakterisiert** (Detail Abschnitt 10a): serverseitig korrekt (POST `/api/v1/auth/logout` → 204, Gateway-Reset, Session beendet), aber die SPA rendert nach Logout innerhalb der gleichen Seitenlebensdauer nach SSO-Login statt der Login-Seite die Callback-Fehlerseite „SSO sign-in failed" mit totem „Back to sign-in"-Button; Workaround einmal F5. Upstream-Bug (auch im fluxer-main Stand 30.11.), kein lokaler Handlungsbedarf. d) **Firefox-LNA-Befund** (Abschnitt 10b): 1502 Client-Cancels (NPM 499) ausschließlich Firefox/161 — Firefox' Local Network Access bricht Requests von der öffentlichen Domain auf die private IP (10.0.0.10) ab; Verstärker für Chunk-/SRI-Stürme und „transport gave up after retries" beim Operator; Abhilfe workstation-lokal (about:config). Chrome/curl nicht betroffen |
|
||||
| 2026-11-30 | 1.17 | Mistral Vibe | **Verify-Playbook ergänzt** (`playbooks/verify.yml` im CT-117-Ansible-Projekt, README aktualisiert): read-only Health-Check des produktiven Stacks gegen das production-Inventory — systemd-Unit aktiv, 24 Services running (seaweedfs-init `Exited (0)`), interner Caddy-Edge (SPA-Shell (`x_fluxer_app_shell`), version.json, Discovery, Admin-Panel 200, Gateway 426, LiveKit-Routing, SSO-Status `enabled=true`), öffentlicher Pfad über NPM (Login-Seite + identisches Discovery-Dokument), Keycloak-Realm-Discovery (Issuer + authorization_code), SSO-Start-Probe (PKCE S256 + `client_binding`, Client `fluxer`), SSO-Complete-Junk-Probe (400 INVALID_OR_EXPIRED_SSO_STATE) und app-proxy-Log frei von Branding-404-Warnungen (DISCOVERY-Fix-Wächter). Beide SSO-Proben erzeugen nur kurzlebige, von selbst ablaufende Serverzustände (abschaltbar via `fluxer_verify_sso_probes_enabled=false`); Browser-Login/Logout bleiben Operator-Abnahmeschritte (10a). Zwei Läufe grün: ok=24, changed=0, failed=0 |
|
||||
| 2026-11-30 | 1.18 | Mistral Vibe / Operator | **Aufräumen nach der Abnahme (Operator-Go):** E2E-Testuser entfernt — Fluxer-User `sso_test` (ID 1576954232072830976) per KV-Transaktion aus der Postgres (`DELETE 27`, alle 27 Zeilen via JSON-Backup in `/root/gnai025-cleanup/` auf CT 117 gesichert; inkl. Sessions, SSO-Identity, Guild-Mitgliedschaft, Join-Systemmessage, Settings) und Keycloak-User `fluxer-sso-test` (ID 548ef13f-9a55-4ba1-966d-6f1c6a9808c2) per Admin-API (204, Nachprüfung leer). Alle E2E-Artefakte beseitigt: /tmp-Skripte/Profile auf Workstation und CT 102, Browser-Prozesse beendet. `verify.yml` nach der Bereinigung grün (ok=24, failed=0). Abschnitt 11 entsprechend gekürzt |
|
||||
|
||||
## 1. Zweck und Leitentscheidung
|
||||
|
||||
@@ -50,21 +55,21 @@ fluxerapp/fluxer, fossengineer.com, selfhostedworld.com):
|
||||
| c) **Images/Pinning** | **Machbar.** Offizielle Images `ghcr.io/fluxerapp/fluxer-<service>:v1` (FLUXER_REGISTRY/OWNER/TAG-override-fähig) für api, gateway, worker, media-proxy, app-proxy-self-hosted, static, admin, snowflakes, users, messages, gifs, unfurl, push; Infra: postgres, valkey, nats, meilisearch, seaweedfs, livekit-server, caddy. Die Rolle `fluxer_stack` lädt die upstream-compose am gepinnten Commit mit SHA-256-Check und pinnt Images per Digest (Platzhalter `PENDING-*` failen hart, bis der Operator pinnt). | ✅ |
|
||||
| d) **Performance** | **Machbar mit Dimensionierung.** Upstream-compose: ~21 Services, docker memory limits summiert ~19,3 GB (Reservierungen deutlich darunter). Für einen Freundeskreis reicht 1 Shard; die Ghostnet-Override setzt upstream-eigene `FLUXER_*_MEMORY_LIMIT`-Knobs (Summe ~6 GiB). CT-Profil: **4 Cores / 8192 MiB RAM / 2048 MiB Swap / 64 GiB rootfs** (`local-lvm`). Ob der PVE-Host das tragen kann, muss der Operator vor Anlage prüfen (`free -h`/`pct config`-Summe auf dem Host — Agent hat keinen pct-Zugang). Erste Last nach Go-Live beobachten (`podman stats`), RAM ggf. auf 12–16 GiB hochziehen. | ✅ mit Bedingung |
|
||||
| e) **VoIP (LiveKit) hinter NPM** | **Eingeschränkt.** Signaling/WS geht über NPM (`/livekit/` → 10.0.0.62:7880). WebRTC-Media braucht direkte Erreichbarkeit: TCP 7881, UDP 3478 (TURN/STUN), UDP 50000–50100 (RTP) — am besten FRITZ!Box-Portweiterleitung auf 10.0.0.62 plus `use_external_ip`. Alternative: TURN-Server oder Voice deaktivieren (`fluxer_stack_voice_enabled=false`, dann keine WAN-Media-Ports). | ⚠️ nur mit Portweiterleitung |
|
||||
| f) **Edge/TLS** | **Machbar ohne upstream Caddy.** NPM (CT 103) terminiert TLS (bestehender Wildcard-/A-Record-Mechanismus für `*.ghostnet.selfhost.eu`), die Ghostnet-Override deaktiviert den Caddy-Edge (`profiles: [ghostnet-disabled-edge]`, keine veröffentlichten 80/443) und published nur app-proxy 8080 + LiveKit-Ports auf der CT-IP; nftables lässt HTTP nur von 10.0.0.10/32 (CT 103) zu. Discovery (`/.well-known/fluxer`) und exakte upstream-env-Namen gegen die gepinnte compose prüfen (Operator-Schritt, Rolle failt hart bei abweichenden Servicenamen). | ✅ |
|
||||
| f) **Edge/TLS** | **Machbar — Revision 30.11. (1.14): der Upstream-Caddy läuft als interner Edge.** NPM (CT 103) terminiert TLS (Wildcard `*.ghostnet.selfhost.eu`); der gepinnte Upstream-Caddy horcht auf CT 117 als interner HTTP-Edge auf :8082 (kein ACME, keine public 80/443) und routed laut gepinnter Caddyfile `/api`, `/gateway`, `/media`, `/admin`, `/livekit`, Static-Assets und SPA zu den Compose-Services. Erste Annahme „ohne upstream Caddy" (nur app-proxy 8080) war unvollständig: der app-proxy ist ein reiner SPA-Catch-all, API-Pfade fielen auf ihn zurück. Firewall lässt 8082 nur von 10.0.0.10/32 (CT 103) zu. | ✅ |
|
||||
|
||||
## 3. Zielarchitektur
|
||||
|
||||
```
|
||||
Internet ──TLS──> FRITZ!Box (80/443 → CT 103 NPM; optional 7881/tcp, 3478/udp,
|
||||
50000-50100/udp → CT 117 bei Voice)
|
||||
CT 103 NPM: fluxer.ghostnet.selfhost.eu → 10.0.0.62:8080 (+ /livekit/ → :7880)
|
||||
CT 103 NPM: fluxer.ghostnet.selfhost.eu → 10.0.0.62:8082 (alles)
|
||||
CT 117 fluxer (10.0.0.62, Debian 13, unprivileged, nesting=1):
|
||||
nftables default-deny (SSH aus 10.0.0.0/24+10.8.0.0/24,
|
||||
8080/7880 nur von 10.0.0.10, Voice-Ports WAN bei D2=ja)
|
||||
8082 (caddy edge) nur von 10.0.0.10, Voice-Ports WAN bei D2=ja)
|
||||
fluxer-stack.service → podman compose (pinned, pull_policy=never):
|
||||
app-proxy:8080, livekit:7880(+media), api, gateway, worker,
|
||||
media-proxy, static, admin, shards, postgres, valkey, nats,
|
||||
meilisearch, seaweedfs (caddy edge disabled)
|
||||
caddy edge :8082 (intern, HTTP) → app-proxy, livekit:7880(+media),
|
||||
api, gateway, worker, media-proxy, static, admin, shards,
|
||||
postgres, valkey, nats, meilisearch, seaweedfs
|
||||
Keycloak CT 102: Realm Ghost.net, Client `fluxer` (OIDC-SSO)
|
||||
Pi-hole CT 100: Split-DNS fluxer.ghostnet.selfhost.eu → 10.0.0.10
|
||||
```
|
||||
@@ -98,7 +103,7 @@ ist als Ausbaustufe offen (Abschnitt 11).
|
||||
| Provisioning | `proxmox/lxc/ct-117-fluxer/scripts/provision-ct117-fluxer.sh` | pct create + baseline hook (SHA-256-gepinnt) + configfs-Mask; nie destruktiv |
|
||||
| Ansible | `proxmox/lxc/ct-117-fluxer/ansible/` | `ansible.cfg`, 3 Inventories, `playbooks/{preflight,site}.yml`, Rollen `fluxer_lxc_baseline`, `fluxer_access`, `fluxer_firewall`, `fluxer_stack` + shared `podman_runtime` |
|
||||
| Stack | Rolle `fluxer_stack` | gepinnte upstream-compose (SHA-256, `3b1eb567`/`1cb102f9…`) als separate `docker-compose.upstream.yml`; aktive `docker-compose.yml` wird nur bei Upstream-Änderung aus der Kopie erzeugt und lokal adaptiert (Abschnitt 5a); `docker-compose.ghostnet.yml` (Caddy-Edge aus, nur app-proxy/LiveKit published, `pull_policy: never`, journald) + `.env` (0600, Secrets einmalig on-guest generiert) + `fluxer-stack.service`; Image-Digests gepinnt |
|
||||
| NPM | `proxmox/lxc/ct-103-reverse-proxy/ansible/roles/reverse_proxy_fluxer_vhost/` | Vhost `fluxer.ghostnet.selfhost.eu` → 10.0.0.62:8080 + `/livekit/` → :7880, LE-Cert, Fail2Ban-Restart; in CT-103-`site.yml` eingehängt |
|
||||
| NPM | `proxmox/lxc/ct-103-reverse-proxy/ansible/roles/reverse_proxy_fluxer_vhost/` | Vhost `fluxer.ghostnet.selfhost.eu` → 10.0.0.62:8082 (interner Caddy-Edge, alles; WS-Upgrade, 86400 s Timeouts), LE-Cert, Fail2Ban-Restart; in CT-103-`site.yml` eingehängt |
|
||||
| Keycloak | `proxmox/lxc/ct-102-keycloak/.../keycloak_realm_config` | Client `fluxer` (Abschnitt 4) |
|
||||
|
||||
**Begründete Abweichung vom Quadlet-Schema:** Upstream liefert eine einzige
|
||||
@@ -131,10 +136,11 @@ Loop-Args unzuverlässig):
|
||||
FLUXER_VAPID_EMAIL, FLUXER_PASSKEY_RP_ID, FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS)
|
||||
— podman-compose zerpflückt nested defaults und lässt Literale wie `}:`
|
||||
im Container-Env stehen.
|
||||
3. **`depends_on: caddy` (app-proxy) entfernt** — mit dem per Override-Profil
|
||||
deaktivierten Caddy-Edge crasht podman-compose mit `KeyError: 'caddy'`
|
||||
in `check_dep_conditions`; die Override zeigt DISCOVERY_UPSTREAM_URL direkt
|
||||
auf die api.
|
||||
3. ~~`depends_on: caddy` (app-proxy) entfernt~~ — **mit 1.14 revertiert:** der
|
||||
Caddy-Edge läuft wieder (intern, :8082), die Upstream-Dep-Kante bleibt
|
||||
unverändert. (Historisch: mit per Override-Profil deaktiviertem Edge
|
||||
crashte podman-compose mit `KeyError: 'caddy'` in `check_dep_conditions`;
|
||||
die Override zeigt DISCOVERY_UPSTREAM_URL weiterhin direkt auf die api.)
|
||||
|
||||
Zusätzlich gilt für die `.env`: **jede** in der Compose referenzierte Variable
|
||||
muss explizit stehen — auch die mit leerem Upstream-Default (CSP_*, SMTP-Felder,
|
||||
@@ -171,9 +177,9 @@ ihn.
|
||||
5. **Agent:** `preflight.yml` auf `agent`-Inventory (read-only) — Identitäts- und Leerstands-Gates. **Erledigt 2026-11-29 (grün nach rootfs-Gate 60 GB).**
|
||||
6. **Agent (nach Operator-Go):** `site.yml --check --diff` auf `production`, dann autorisierter `site.yml`-Lauf; zweiter Lauf muss `changed=0` liefern. **Erledigt 2026-11-30** (nach den podman-compose-Adaptionen aus Abschnitt 5a; Zweitlauf `changed=0`, failed=0; 23 Services Up, seaweedfs-init `Exited (0)`, api/postgres/valkey healthy, app-proxy HTTP 200).
|
||||
7. **Agent:** CT-102-`keycloak_realm_config` laufen lassen (legt Client `fluxer` an). **Erledigt 2026-11-30** (Client angelegt, Redirect-URIs nach Domain-Korrektur per Sync-PUT gezogen, Zweitlauf `changed=0`).
|
||||
8. **Operator:** Keycloak-Credentials-Tab → Secret in Fluxer `/admin` eintragen (Issuer/Client-ID/Secret), Registrierung auf invite-only.
|
||||
8. **Operator:** Keycloak-Credentials-Tab → Secret in Fluxer `/admin` eintragen (Issuer/Client-ID/Secret), Registrierung auf invite-only. **Erledigt 2026-11-30** (Setup-Screen via FLUXER_SETUP_TOKEN, SSO enabled; Invite-only im UI vom Operator zu verifizieren).
|
||||
9. **Agent (nach Operator-Go):** CT-103-`site.yml` mit neuer Rolle `reverse_proxy_fluxer_vhost` (legt NPM-Vhost + LE-Cert an). **Erledigt 2026-11-30** (Vhost + LE-Cert live; NPM dabei wie in 1.13 beschrieben auf den gepinnten CVE-Fix-Stand 2.17.1 konvergiert; Zweitlauf `changed=0`).
|
||||
10. **Operator:** Pi-hole-Split-DNS `fluxer.ghostnet.selfhost.eu → 10.0.0.10` (**erledigt 2026-11-30 via `dns_pihole`-Rolle, live verifiziert**); FRITZ!Box-Portweiterleitung 7881/tcp, 3478/udp, 50000–50100/udp → 10.0.0.62 nur bei D2=ja (**noch offen**); FRITZ!Box-Portweiterleitung 7881/tcp, 3478/udp, 50000–50100/udp → 10.0.0.62 nur bei D2=ja.
|
||||
10. **Operator:** Pi-hole-Split-DNS `fluxer.ghostnet.selfhost.eu → 10.0.0.10` (**erledigt 2026-11-30 via `dns_pihole`-Rolle, live verifiziert**); FRITZ!Box-Portweiterleitung 7881/tcp, 3478/udp, 50000–50100/udp → 10.0.0.62 nur bei D2=ja (**erledigt 2026-11-30, Operator**; Voice-Call-Test über WAN offen); FRITZ!Box-Portweiterleitung 7881/tcp, 3478/udp, 50000–50100/udp → 10.0.0.62 nur bei D2=ja.
|
||||
11. **Agent:** Abnahmetests (Abschnitt 10).
|
||||
|
||||
## 7. Sicherheitsregeln (verbindlich)
|
||||
@@ -189,6 +195,7 @@ ihn.
|
||||
## 8. Betrieb (SOP, Auszug)
|
||||
|
||||
- Status: `ssh -F ~/.ssh/config ghostnet-ct117-agent 'sudo /usr/local/bin/fluxer-readonly podman ps'`; Logs: `podman logs` / `journalctl -u fluxer-stack`.
|
||||
- Health-Check: `playbooks/verify.yml` auf production (read-only, s. Projekt-README); deckt Unit, Container, Edge-Endpunkte, öffentlichen Pfad, Keycloak-Discovery und die SSO-Proben ab — nach Wartung/Restore/Pin-Update laufen.
|
||||
- Stack-Neustart nach Pin-Update: `site.yml`-Re-Run (production) oder manuell `systemctl restart fluxer-stack` auf CT 117.
|
||||
- Backup: vzdump-Job (PVE) deckt CT 117; App-level (Postgres+SeaweedFS) als restic zu ghostnet-ki ist offen (Abschnitt 11).
|
||||
|
||||
@@ -206,6 +213,62 @@ ihn.
|
||||
4. Firewall: von extern nur 80/443 (via FRITZ!Box→CT 103) und ggf. Voice-Ports erreichbar; `nft list table inet ghostnet_filter` auf CT 117 zeigt die gesetzten Regeln; direkter Zugriff auf 10.0.0.62:8080 nur von 10.0.0.10.
|
||||
5. Idempotenz: zweiter `site.yml`-Lauf `changed=0`; preflight auf agent-Inventory clean.
|
||||
6. Unattended-Upgrades: `unattended-upgrades.service` aktiv, Origins-Pattern nur Debian-Security.
|
||||
7. Automatisierbar: Punkte 1–3 (ohne Voice-Call und Browser-Login) deckt
|
||||
`playbooks/verify.yml` ab (siehe 1.17); Browser-SSO-Login/Logout und
|
||||
Voice-Call bleiben manuelle Operator-Checks (10a).
|
||||
|
||||
### 10a. Abnahmebefund Logout (2026-11-30, Operator: verkraftbar)
|
||||
|
||||
**Symptom (Operator, Firefox + Chromium, normal + privates Fenster):** Nach
|
||||
Logout über User-Menü → Edit Profile → Sign out → Bestätigung landet die App
|
||||
auf „SSO sign-in failed — Missing SSO code. Sign in again." mit einem
|
||||
„Back to sign-in"-Button, der nichts tut.
|
||||
|
||||
**Diagnose (reproduzierbar 6/6 im CDP-Chromium, echter UI-Pfad):**
|
||||
|
||||
- Serverseitig **korrekt**: `POST /api/v1/auth/logout` → 204, Gateway-Reset,
|
||||
Session ist beendet; nach Reload zeigt `/login` die korrekte Login-Seite und
|
||||
kein Auto-Login mehr.
|
||||
- Die SPA rendert nach dem Logout **statt der Login-Seite die
|
||||
SSO-Callback-Fehlerseite** bei der URL `/login`. Der „Back to sign-in"-Button
|
||||
ruft intern `RouterUtils.replaceWith('/login')` auf — ein No-op, weil die URL
|
||||
bereits `/login` ist; deshalb „passiert nichts".
|
||||
- **Trigger:** Logout innerhalb der gleichen Seitenlebensdauer nach einem
|
||||
SSO-Callback-Login. Reproduziert bei +10 s, +60 s und +120 s nach Login;
|
||||
nach ca. 5 Minuten oder nach Session-Restore-Login (ohne SSO-Roundtrip in der
|
||||
Seitenlebensdauer) verläuft der Logout korrekt.
|
||||
- **Workaround:** einmal F5/Reload — danach korrekte Login-Seite.
|
||||
- **Einordnung:** reiner Client-State-Bug der Fluxer-SPA, browser-unabhängig;
|
||||
im fluxer-main (Stand 2026-11-30) nicht gefixt. Kein Handlungsbedarf lokal;
|
||||
optional Upstream-Issue bei fluxerapp/fluxer (Operator-Entscheidung).
|
||||
|
||||
Firefox-Anmerkung: der LazyModuleLoader der SPA kann bei gescheiterten
|
||||
Chunk-Loads einen einmaligen „recovery reload" (window.location.reload) machen
|
||||
— deshalb landet Firefox teilweise scheinbar korrekt auf der Login-Seite,
|
||||
während Chromium die Fehlerseite stehen lässt. Beides dieselbe Ursache.
|
||||
|
||||
### 10b. Abnahmebefund Firefox LNA (2026-11-30)
|
||||
|
||||
Das NPM-Zugriffslog zeigt an dem Abnahmetag 1502 Requests mit Status 499
|
||||
(Client-Cancel) — **ausschließlich von Firefox/161, null von Chromium oder
|
||||
curl**. Ursache: Firefox' Local Network Access (LNA) behandelt die öffentliche
|
||||
Domain `fluxer.ghostnet.selfhost.eu` als nicht-lokalen Kontext und bricht
|
||||
Requests an die private Ziel-IP 10.0.0.10 wiederholt ab bzw. verzögert sie
|
||||
(Konsole: „Lokaler Netzwerkzugriff erkannt … Eingabeaufforderung:
|
||||
auto_allow callback"; mit aktivem Service Worker werden Prompts sogar umgangen,
|
||||
vgl. Mozilla Bug 1996495/CVE-2026-16370). Folgen beim Operator:
|
||||
Chunk-Integrity-Stürme (SRI-Prüfung gegen leere Bodies, sha384 des Leerstrings),
|
||||
„transport gave up after retries" auf API-Calls und 10× abgebrochene
|
||||
`POST /auth/sso/complete` vor dem ersten erfolgreichen Login.
|
||||
|
||||
**Abhilfe (workstation-lokal, kein Server-Handlungsbedarf):** about:config →
|
||||
`network.lna.blocking` = `false` oder alternativ
|
||||
`network.lna.skip-domains` um `fluxer.ghostnet.selfhost.eu` und
|
||||
`auth.ghostnet.selfhost.eu` ergänzen. Headless-Tests (frisches Profil und
|
||||
Kopie des Operator-Profils) zeigten keine Abbrüche; Chromium ist nicht
|
||||
betroffen (PNA entfernt). Die 0-Byte-200-Einträge im NPM-Log (u. a. ein
|
||||
externer Scanner um 11:16) sind Abort-Artefakte desselben Musters — die
|
||||
Asset-Dateien selbst sind korrekt (curl-Verifikation aller betroffenen URLs).
|
||||
|
||||
## 11. Offene Punkte / Entscheidungen des Betreibers
|
||||
|
||||
@@ -215,21 +278,24 @@ ihn.
|
||||
- Exakte upstream-env-Namen (`.env.example`) und Servicenamen gegen gepinnte compose verifizieren; `fluxer_stack_service_*` ggf. anpassen — die Rolle failt mit klarer Meldung.
|
||||
- App-level-Backup (restic) nachrüsten?
|
||||
- Öffentlicher DNS: Wildcard `*.ghostnet.selfhost.eu` deckt `chat.` ab (wie research/auth) — Operator bestätigt.
|
||||
- Upstream-Issue für den Logout-Bugs (Abschnitt 10a) bei fluxerapp/fluxer einreichen? (Operator-Entscheidung; Reproduktionsschritte liegen vor.)
|
||||
|
||||
## 12. Implementierungsstand 2026-11-30 (Abend)
|
||||
## 12. Implementierungsstand 2026-11-30 (Nacht)
|
||||
|
||||
CT 117 produktiv angelegt (local-lvm, 64 GiB, Fingerprint gepinnt); Baseline,
|
||||
Access, Firewall, Podman-Runtime und der komplette Fluxer-Stack laufen
|
||||
konvergiert (`changed=0`, 23 Services Up, seaweedfs-init `Exited (0)`,
|
||||
api/postgres/valkey healthy). **Öffentlicher Pfad live:**
|
||||
`https://fluxer.ghostnet.selfhost.eu` → NPM-Vhost (LE-Cert, Zweitlauf
|
||||
`changed=0`) → app-proxy HTTP 200. Keycloak-Client `fluxer` angelegt und
|
||||
konvergiert (`keycloak_realm_config`, Zweitlauf `changed=0`), Pi-hole-Split-
|
||||
DNS live (`dns_pihole`, Zweitlauf `changed=0`).
|
||||
**In Betrieb und abgenommen (agent-seitig):** CT 117 produktiv (Baseline,
|
||||
Access, Firewall, Podman, 24-Services-Stack konvergiert, `changed=0`),
|
||||
öffentlicher Pfad `https://fluxer.ghostnet.selfhost.eu` über NPM → internen
|
||||
Caddy-Edge (:8082) mit vollständigem Pfad-Routing (API/Gateway/Media/Admin/
|
||||
LiveKit/Static, WS-fähig), Keycloak-Client `fluxer` konvergiert, Pi-hole-
|
||||
Split-DNS live, Setup abgeschlossen (FLUXER_SETUP_TOKEN), SSO aktiviert
|
||||
(Issuer Realm `Ghost.net`), FRITZ!Box-Voice-Ports weitergeleitet.
|
||||
|
||||
Offen: Phase 8 (Operator: Client-Secret aus dem Keycloak-Credentials-Tab ins
|
||||
Fluxer-Admin-Panel `/admin` — Issuer
|
||||
`https://auth.ghostnet.selfhost.eu/realms/Ghost.net`, Client-ID `fluxer` —,
|
||||
Registrierung invite-only), FRITZ!Box-Ports für Voice bei D2=ja (Phase 10),
|
||||
Abnahmetests (Phase 11, Abschnitt 10) und GNAI-006-Doku-Aktualisierung durch
|
||||
den CT-103-Branch-Eigentümer (Merge liegt im Feature-Branch).
|
||||
Abnahme Abschnitt 10 — Status: (1) öffentlicher Pfad ✅, (2) SSO-Login ✅
|
||||
(Operator-Browser + E2E; Logout serverseitig ✅ mit SPA-Einschränkung aus
|
||||
Abschnitt 10a, Operator: verkraftbar, Workaround F5), (3) WS-Routing ✅
|
||||
(Voice-Call: Operator), (4) Firewall ✅, (5) Idempotenz ✅ (CT 100/102/103/117
|
||||
je Zweitlauf `changed=0`; CT-117-Verifikation nach DISCOVERY-Fix site36/37,
|
||||
Zweitlauf `changed=0`), (6) unattended-upgrades ✅.
|
||||
|
||||
Offen: Browser-SSO-Login, Invite-only-Verifikation + erste Invite-Codes,
|
||||
Voice-Call über WAN (je Operator); optional App-level-Backup (Abschnitt 11).
|
||||
|
||||
+5
-14
@@ -13,9 +13,12 @@ reverse_proxy_fluxer_api_env_file: /etc/nginx-proxy-manager/api.env
|
||||
|
||||
reverse_proxy_fluxer_domain: fluxer.ghostnet.selfhost.eu
|
||||
reverse_proxy_fluxer_upstream_host: 10.0.0.62
|
||||
reverse_proxy_fluxer_upstream_port: 8080
|
||||
# Internal caddy edge on CT 117 (site32-Befund): the pinned upstream Caddyfile
|
||||
# routes /api, /gateway, /media, /admin, /livekit, static assets and the SPA
|
||||
# to the compose services — the app-proxy alone returns SPA HTML for API
|
||||
# paths. NPM terminates TLS and proxies EVERYTHING to caddy on 8082.
|
||||
reverse_proxy_fluxer_upstream_port: 8082
|
||||
reverse_proxy_fluxer_upstream_scheme: http
|
||||
reverse_proxy_fluxer_livekit_upstream_port: 7880
|
||||
reverse_proxy_fluxer_letsencrypt_email: ma-koenig@gmx.net
|
||||
|
||||
# No oauth2-proxy IAP in front of Fluxer: the instance is public like any chat
|
||||
@@ -28,18 +31,6 @@ reverse_proxy_fluxer_letsencrypt_email: ma-koenig@gmx.net
|
||||
# generation). WebSocket upgrade headers for the gateway and LiveKit
|
||||
# signaling; long timeouts for long-lived WS connections.
|
||||
reverse_proxy_fluxer_advanced_config: |
|
||||
location /livekit/ {
|
||||
proxy_pass http://{{ reverse_proxy_fluxer_upstream_host }}:{{ reverse_proxy_fluxer_livekit_upstream_port }};
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_send_timeout 86400s;
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://{{ reverse_proxy_fluxer_upstream_host }}:{{ reverse_proxy_fluxer_upstream_port }};
|
||||
proxy_set_header Host $host;
|
||||
|
||||
@@ -63,3 +63,31 @@ CT 101/114 procedure:
|
||||
|
||||
The stack is started by `site.yml` only on inventories with
|
||||
`fluxer_stack_start_allowed: true` (production).
|
||||
|
||||
## Operational verification
|
||||
|
||||
`playbooks/verify.yml` is a read-only health check for the running stack
|
||||
(run it on `production`; it needs sudo for podman/journal access, every task
|
||||
reports `changed=0`):
|
||||
|
||||
```bash
|
||||
../../../../.venv/bin/ansible-playbook \
|
||||
--inventory inventories/production/hosts.yml \
|
||||
playbooks/verify.yml \
|
||||
--private-key ~/.ssh/id_ed25519_ghostnet_ct117_ansible_deploy
|
||||
```
|
||||
|
||||
It asserts: `fluxer-stack.service` active, all 24 services running with the
|
||||
seaweedfs-init oneshot `Exited (0)`, the internal caddy edge serving the SPA
|
||||
shell (`x_fluxer_app_shell`), `version.json`, the discovery document, the
|
||||
admin panel, the gateway upgrade requirement (426), LiveKit routing and the
|
||||
SSO status (`enabled=true`); the public path through NPM (login page +
|
||||
matching discovery document); the Keycloak realm discovery document with the
|
||||
configured issuer and the authorization-code grant; the SSO start handing
|
||||
out a PKCE S256 authorization URL with `client_binding` for the `fluxer`
|
||||
client (and `/auth/sso/complete` rejecting junk states with 400); and the
|
||||
app-proxy log being free of branding discovery 404 warnings (the
|
||||
`DISCOVERY_UPSTREAM_URL` guard). Two SSO probes create only expiring
|
||||
server-side sign-in state; disable them with
|
||||
`fluxer_verify_sso_probes_enabled=false`. Full browser SSO login/logout
|
||||
remains a manual operator acceptance step (GNAI-025 Abschnitt 10/10a).
|
||||
|
||||
@@ -0,0 +1,315 @@
|
||||
---
|
||||
# Read-only operational verification of the CT 117 Fluxer stack (GNAI-025
|
||||
# Abschnitt 10). Run it whenever the stack should prove itself healthy,
|
||||
# e.g. after maintenance, restores or upgrades:
|
||||
#
|
||||
# cd proxmox/lxc/ct-117-fluxer/ansible
|
||||
# ../../../../.venv/bin/ansible-playbook \
|
||||
# --inventory inventories/production/hosts.yml \
|
||||
# playbooks/verify.yml \
|
||||
# --private-key ~/.ssh/id_ed25519_ghostnet_ct117_ansible_deploy
|
||||
#
|
||||
# Every task is read-only (changed_when: false). Two SSO probes create only
|
||||
# short-lived server-side sign-in state (an SSO start nonce / one rejected
|
||||
# complete attempt) that expires on its own; disable them with
|
||||
# fluxer_verify_sso_probes_enabled=false. Full browser SSO login/logout remains
|
||||
# a manual operator acceptance step (Abschnitt 10/10a). Requires the
|
||||
# production inventory: podman and journal access need sudo, and the public
|
||||
# probes resolve the split DNS name through NPM (CT 103).
|
||||
|
||||
- name: Read-only operational verification of the CT 117 Fluxer stack
|
||||
hosts: fluxer_hosts
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
vars:
|
||||
# Internal edge (upstream Caddy, GNAI-025 Befund f) only reachable from
|
||||
# the guest itself and the NPM host; probes run locally on CT 117.
|
||||
fluxer_verify_local_base: http://127.0.0.1:8082
|
||||
# Keycloak identity of this instance (GNAI-025 Abschnitt 4).
|
||||
fluxer_verify_keycloak_discovery_url: >-
|
||||
https://auth.ghostnet.selfhost.eu/realms/Ghost.net/.well-known/openid-configuration
|
||||
fluxer_verify_keycloak_issuer: https://auth.ghostnet.selfhost.eu/realms/Ghost.net
|
||||
# All services except the seaweedfs-init oneshot (Exited (0) is healthy).
|
||||
fluxer_verify_expected_running: 24
|
||||
fluxer_verify_init_container: fluxer_seaweedfs-init_1
|
||||
fluxer_verify_sso_probes_enabled: true
|
||||
fluxer_verify_app_proxy_warning_patterns:
|
||||
- "discovery returned 404"
|
||||
|
||||
tasks:
|
||||
- name: Verify the fluxer-stack systemd unit is active
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /usr/bin/systemctl
|
||||
- is-active
|
||||
- fluxer-stack.service
|
||||
register: fluxer_verify_unit
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Assert the fluxer-stack unit is active
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_unit.stdout | trim == "active"
|
||||
fail_msg: >-
|
||||
fluxer-stack.service is "{{ fluxer_verify_unit.stdout | trim }}".
|
||||
Inspect with `systemctl status fluxer-stack` and
|
||||
`journalctl -u fluxer-stack` on CT 117.
|
||||
|
||||
- name: Read the Fluxer container states
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /usr/bin/podman
|
||||
- ps
|
||||
- -a
|
||||
- --format
|
||||
- json
|
||||
register: fluxer_verify_ps
|
||||
changed_when: false
|
||||
|
||||
- name: Assert every compose service is healthy (24 running, init Exited (0))
|
||||
# seaweedfs-init is a oneshot S3 bootstrap container: Exited (0) is its
|
||||
# healthy terminal state (GNAI-025 1.11 Befund f); anything else that is
|
||||
# not running, or any failed exit code, fails the verification.
|
||||
vars:
|
||||
fluxer_verify_containers: "{{ fluxer_verify_ps.stdout | from_json }}"
|
||||
fluxer_verify_running: >-
|
||||
{{ fluxer_verify_containers | selectattr('State', 'equalto', 'running') | list }}
|
||||
fluxer_verify_not_running: >-
|
||||
{{ fluxer_verify_containers | rejectattr('State', 'equalto', 'running') | list }}
|
||||
# Names is a list in podman ps --format json; everything that is not
|
||||
# running and not the healthy oneshot init container is a failure.
|
||||
fluxer_verify_unhealthy: >-
|
||||
{{ fluxer_verify_not_running |
|
||||
rejectattr('Names', 'equalto', [fluxer_verify_init_container]) | list }}
|
||||
fluxer_verify_init_ok: >-
|
||||
{{ fluxer_verify_not_running |
|
||||
selectattr('Names', 'equalto', [fluxer_verify_init_container]) |
|
||||
selectattr('ExitCode', 'equalto', 0) | list }}
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_running | length == fluxer_verify_expected_running | int
|
||||
- fluxer_verify_unhealthy | length == 0
|
||||
- fluxer_verify_init_ok | length == fluxer_verify_not_running | length
|
||||
fail_msg: >-
|
||||
Expected {{ fluxer_verify_expected_running }} running containers, found
|
||||
{{ fluxer_verify_running | length }}. Not running:
|
||||
{{ fluxer_verify_not_running | map(attribute='Names') | map('join', ' ') | join(', ') }}
|
||||
Inspect with `podman ps -a` and `podman logs <container>` on CT 117.
|
||||
|
||||
- name: Probe the internal edge — SPA shell
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}/"
|
||||
status_code: 200
|
||||
register: fluxer_verify_spa
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the SPA shell is the Fluxer app
|
||||
# The app-proxy marks its shell responses with x_fluxer_app_shell.
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_spa.status == 200
|
||||
- fluxer_verify_spa.x_fluxer_app_shell is defined
|
||||
- fluxer_verify_spa.x_fluxer_app_shell == "1"
|
||||
- fluxer_verify_spa.content_type is search('text/html')
|
||||
fail_msg: >-
|
||||
The caddy edge did not serve the app-proxy SPA shell at /
|
||||
(status {{ fluxer_verify_spa.status | default('n/a') }}).
|
||||
|
||||
- name: Probe the internal edge — version.json
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}/version.json"
|
||||
status_code: 200
|
||||
register: fluxer_verify_version
|
||||
changed_when: false
|
||||
|
||||
- name: Assert version.json reports a build version
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_version.json.version is defined
|
||||
- fluxer_verify_version.json.version | length > 0
|
||||
fail_msg: >-
|
||||
version.json did not report a build version
|
||||
(status {{ fluxer_verify_version.status | default('n/a') }}).
|
||||
|
||||
- name: Probe the internal edge — instance discovery document
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}/.well-known/fluxer"
|
||||
status_code: 200
|
||||
register: fluxer_verify_discovery
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the discovery document advertises the public API endpoint
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_discovery.json.endpoints.api is defined
|
||||
- fluxer_verify_keycloak_issuer is search('ghostnet')
|
||||
- >-
|
||||
fluxer_verify_discovery.json.endpoints.api is
|
||||
search(fluxer_stack_public_domain)
|
||||
fail_msg: >-
|
||||
The /.well-known/fluxer document does not advertise the public API
|
||||
endpoint of {{ fluxer_stack_public_domain }}
|
||||
(status {{ fluxer_verify_discovery.status | default('n/a') }}).
|
||||
|
||||
- name: Probe the internal edge — admin panel, gateway, livekit, SSO status
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}{{ item.path }}"
|
||||
status_code: "{{ item.status }}"
|
||||
loop:
|
||||
- path: /admin/login
|
||||
status: 200
|
||||
- path: /gateway
|
||||
status: 426
|
||||
- path: /livekit/
|
||||
status: 200
|
||||
- path: /api/auth/sso/status
|
||||
status: 200
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
register: fluxer_verify_paths
|
||||
changed_when: false
|
||||
|
||||
- name: Assert SSO is enabled in the auth status document
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (fluxer_verify_paths.results | selectattr('item.path', 'equalto', '/api/auth/sso/status') | list | first).json.enabled | bool
|
||||
fail_msg: >-
|
||||
/api/auth/sso/status did not report enabled=true — SSO is switched
|
||||
off; check the admin panel instance settings.
|
||||
|
||||
- name: Probe the public path through NPM — login page
|
||||
ansible.builtin.uri:
|
||||
url: "https://{{ fluxer_stack_public_domain }}/login"
|
||||
status_code: 200
|
||||
register: fluxer_verify_public_login
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the public login page is served with a valid certificate
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_public_login.status == 200
|
||||
- fluxer_verify_public_login.url is search('^https://')
|
||||
fail_msg: >-
|
||||
https://{{ fluxer_stack_public_domain }}/login failed through NPM
|
||||
(CT 103). Check the NPM vhost, the LE certificate and the CT 117
|
||||
firewall forward rules.
|
||||
|
||||
- name: Probe the public path through NPM — instance discovery
|
||||
ansible.builtin.uri:
|
||||
url: "https://{{ fluxer_stack_public_domain }}/.well-known/fluxer"
|
||||
status_code: 200
|
||||
register: fluxer_verify_public_discovery
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the public discovery document matches the internal one
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- >-
|
||||
fluxer_verify_public_discovery.json.api_code_version ==
|
||||
fluxer_verify_discovery.json.api_code_version
|
||||
fail_msg: >-
|
||||
The public and internal /.well-known/fluxer documents differ —
|
||||
NPM may terminate at the wrong target (expected the CT 117 caddy
|
||||
edge 10.0.0.62:8082).
|
||||
|
||||
- name: Probe the Keycloak OIDC discovery document
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_keycloak_discovery_url }}"
|
||||
status_code: 200
|
||||
register: fluxer_verify_kc_discovery
|
||||
changed_when: false
|
||||
|
||||
- name: Assert Keycloak advertises the configured realm issuer
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_kc_discovery.json.issuer == fluxer_verify_keycloak_issuer
|
||||
- >-
|
||||
'authorization_code' in fluxer_verify_kc_discovery.json.grant_types_supported
|
||||
fail_msg: >-
|
||||
The Keycloak discovery document at
|
||||
{{ fluxer_verify_keycloak_discovery_url }} did not report the
|
||||
expected issuer {{ fluxer_verify_keycloak_issuer }} or lacks the
|
||||
authorization-code flow.
|
||||
|
||||
- name: Probe SSO start (harmless, creates an expiring sign-in nonce)
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}/api/v1/auth/sso/start"
|
||||
method: POST
|
||||
body: "{}"
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
status_code: 200
|
||||
when: fluxer_verify_sso_probes_enabled | bool
|
||||
register: fluxer_verify_sso_start
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the SSO start hands out the Keycloak authorization URL
|
||||
# The deployed build requires client_binding from this response at
|
||||
# /auth/sso/complete (GNAI-025 1.16) — asserting it also catches an
|
||||
# unexpected downgrade to an older app build.
|
||||
when: fluxer_verify_sso_probes_enabled | bool
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_sso_start.json.authorization_url is defined
|
||||
- fluxer_verify_sso_start.json.state is defined
|
||||
- fluxer_verify_sso_start.json.client_binding is defined
|
||||
- fluxer_verify_sso_start.json.authorization_url is search(fluxer_verify_keycloak_issuer)
|
||||
- fluxer_verify_sso_start.json.authorization_url is search('client_id=fluxer')
|
||||
- fluxer_verify_sso_start.json.authorization_url is search('code_challenge_method=S256')
|
||||
fail_msg: >-
|
||||
POST /api/v1/auth/sso/start did not return a usable PKCE S256
|
||||
authorization URL for the fluxer client (got:
|
||||
{{ fluxer_verify_sso_start.status | default('n/a') }}).
|
||||
|
||||
- name: Probe SSO complete with a junk state (must be rejected cleanly)
|
||||
ansible.builtin.uri:
|
||||
url: "{{ fluxer_verify_local_base }}/api/v1/auth/sso/complete"
|
||||
method: POST
|
||||
body: '{"code":"verify-probe-junk","state":"verify-probe-junk"}'
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
status_code: 400
|
||||
when: fluxer_verify_sso_probes_enabled | bool
|
||||
register: fluxer_verify_sso_complete
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the SSO state guard rejects junk without leaking
|
||||
when: fluxer_verify_sso_probes_enabled | bool
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_sso_complete.status == 400
|
||||
- >-
|
||||
fluxer_verify_sso_complete.json.errors is defined
|
||||
fail_msg: >-
|
||||
POST /api/v1/auth/sso/complete did not reject a junk state with the
|
||||
expected 400 INVALID_OR_EXPIRED_SSO_STATE (got:
|
||||
{{ fluxer_verify_sso_complete.status }}).
|
||||
|
||||
- name: Scan the app-proxy log for branding discovery failures
|
||||
# DISCOVERY_UPSTREAM_URL fix (GNAI-025 1.16b): the app-proxy must fetch
|
||||
# http://api:8080/.well-known/fluxer without 404s; any occurrence of
|
||||
# the warning patterns since boot means the compose override drifted.
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /usr/bin/podman
|
||||
- logs
|
||||
- fluxer_app-proxy_1
|
||||
register: fluxer_verify_app_proxy_logs
|
||||
changed_when: false
|
||||
|
||||
- name: Assert the app-proxy branding refresh is free of 404 warnings
|
||||
vars:
|
||||
fluxer_verify_log_hits: >-
|
||||
{{ fluxer_verify_app_proxy_logs.stderr_lines |
|
||||
select('search', fluxer_verify_app_proxy_warning_patterns | join('|')) |
|
||||
list }}
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- fluxer_verify_log_hits | length == 0
|
||||
fail_msg: >-
|
||||
The app-proxy logged branding discovery failures since boot:
|
||||
{{ fluxer_verify_log_hits[:3] | join(' ; ') }}. The
|
||||
DISCOVERY_UPSTREAM_URL compose override has drifted — inspect
|
||||
/opt/fluxer/docker-compose.ghostnet.yml on CT 117.
|
||||
@@ -10,8 +10,10 @@ fluxer_firewall_reverse_proxy_ipv4: 10.0.0.10/32
|
||||
# 10.89.0.1:53 + inter-container traffic must pass the CT firewall)
|
||||
fluxer_firewall_podman_subnet: 10.89.0.0/16
|
||||
fluxer_firewall_podman_dns_ip: 10.89.0.1
|
||||
fluxer_firewall_app_proxy_port: 8080
|
||||
fluxer_firewall_livekit_signaling_port: 7880
|
||||
# Internal caddy edge (site32-Befund): the ONLY HTTP port published for NPM;
|
||||
# the pinned Caddyfile routes /api, /gateway, /media, /admin, /livekit and
|
||||
# the SPA from there.
|
||||
fluxer_firewall_edge_port: 8082
|
||||
|
||||
# Voice/video media (LiveKit) is published on the CT IP and must be reachable
|
||||
# from the internet; the FRITZ!Box forwards these ports to 10.0.0.62
|
||||
|
||||
@@ -88,10 +88,10 @@
|
||||
that:
|
||||
- fluxer_firewall_active_table.stdout is search('policy drop')
|
||||
- fluxer_firewall_active_table.stdout is search('SSH management')
|
||||
- fluxer_firewall_active_table.stdout is search('Fluxer app-proxy via NPM')
|
||||
- fluxer_firewall_active_table.stdout is search('Fluxer caddy edge via NPM')
|
||||
- fluxer_firewall_active_table.stdout is search('default input deny')
|
||||
- fluxer_firewall_active_table.stdout is search('CT 117 forwards nothing else')
|
||||
- fluxer_firewall_active_table.stdout is search('podman bridge intra-network')
|
||||
- fluxer_firewall_active_table.stdout is search('NPM to published Fluxer ports')
|
||||
- fluxer_firewall_active_table.stdout is search('NPM to the published caddy edge')
|
||||
fail_msg: The active nftables policy does not match the declared CT 117 policy.
|
||||
when: not ansible_check_mode
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
# Managed by Ansible role fluxer_firewall.
|
||||
# CT 117 runs the Fluxer stack behind NPM (CT 103): default-deny input, SSH
|
||||
# from the management networks only, HTTP/WebSocket from the reverse proxy
|
||||
# only, LiveKit media ports open to the internet iff voice is enabled.
|
||||
# from the management networks only, the internal caddy edge (8082) from the
|
||||
# reverse proxy only, LiveKit media ports open to the internet iff voice is
|
||||
# enabled.
|
||||
destroy table inet ghostnet_filter
|
||||
|
||||
table inet ghostnet_filter {
|
||||
@@ -31,8 +32,7 @@ table inet ghostnet_filter {
|
||||
|
||||
ip saddr @management_ipv4 tcp dport {{ fluxer_firewall_ssh_port }} ct state new counter accept comment "SSH management"
|
||||
|
||||
ip saddr @reverse_proxy_ipv4 tcp dport {{ fluxer_firewall_app_proxy_port }} ct state new counter accept comment "Fluxer app-proxy via NPM"
|
||||
ip saddr @reverse_proxy_ipv4 tcp dport {{ fluxer_firewall_livekit_signaling_port }} ct state new counter accept comment "LiveKit signaling via NPM"
|
||||
ip saddr @reverse_proxy_ipv4 tcp dport {{ fluxer_firewall_edge_port }} ct state new counter accept comment "Fluxer caddy edge via NPM"
|
||||
{% if fluxer_stack_voice_enabled %}
|
||||
tcp dport {{ fluxer_firewall_livekit_tcp_port }} ct state new counter accept comment "LiveKit ICE TCP (voice)"
|
||||
udp dport {{ fluxer_firewall_livekit_udp_port }} counter accept comment "LiveKit UDP (voice)"
|
||||
@@ -64,7 +64,7 @@ table inet ghostnet_filter {
|
||||
# CONTAINER IP inside the podman subnet (site30-Befund) — the input
|
||||
# rules above never see it. Allow NPM and (voice) WAN traffic to the
|
||||
# DNAT'd container destinations here.
|
||||
ip saddr @reverse_proxy_ipv4 ip daddr {{ fluxer_firewall_podman_subnet }} tcp dport { {{ fluxer_firewall_app_proxy_port }}, {{ fluxer_firewall_livekit_signaling_port }} } ct state new counter accept comment "NPM to published Fluxer ports (app-proxy, livekit signaling)"
|
||||
ip saddr @reverse_proxy_ipv4 ip daddr {{ fluxer_firewall_podman_subnet }} tcp dport {{ fluxer_firewall_edge_port }} ct state new counter accept comment "NPM to the published caddy edge"
|
||||
{% if fluxer_stack_voice_enabled %}
|
||||
ip daddr {{ fluxer_firewall_podman_subnet }} tcp dport {{ fluxer_firewall_livekit_tcp_port }} ct state new counter accept comment "LiveKit ICE TCP via DNAT (voice)"
|
||||
ip daddr {{ fluxer_firewall_podman_subnet }} udp dport { {{ fluxer_firewall_livekit_udp_port }}, {{ fluxer_firewall_livekit_turn_udp_port }} } counter accept comment "LiveKit UDP via DNAT (voice)"
|
||||
|
||||
@@ -40,10 +40,16 @@ fluxer_stack_images: []
|
||||
fluxer_stack_public_domain: fluxer.ghostnet.selfhost.eu
|
||||
fluxer_stack_public_scheme: https
|
||||
fluxer_stack_public_port: 443
|
||||
fluxer_stack_app_proxy_port: 8080
|
||||
fluxer_stack_livekit_signaling_port: 7880
|
||||
# The upstream Caddy edge runs as the INTERNAL edge on CT 117: NPM (CT 103)
|
||||
# terminates TLS and proxies everything to caddy on this port; the pinned
|
||||
# Caddyfile routes /api, /gateway, /media, /admin, static assets, /livekit
|
||||
# and the SPA to the compose services. The app-proxy alone cannot serve the
|
||||
# app: its catch-all returns SPA HTML for API paths (site32-Befund, revised
|
||||
# Befund f).
|
||||
fluxer_stack_edge_port: 8082
|
||||
fluxer_stack_voice_enabled: true
|
||||
fluxer_stack_livekit_tcp_port: 7881
|
||||
fluxer_stack_livekit_udp_port: 7882
|
||||
fluxer_stack_livekit_turn_udp_port: 3478
|
||||
fluxer_stack_livekit_rtp_port_range: 50000-50100
|
||||
|
||||
@@ -87,6 +93,10 @@ fluxer_stack_service_livekit: livekit
|
||||
# Plus FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64 (base64) and the
|
||||
# FLUXER_VAPID_* P-256 keypair, both generated in the same one-time task.
|
||||
fluxer_stack_secret_specs:
|
||||
# FLUXER_SETUP_TOKEN: first-run setup screen bootstrap token (>= 32 chars);
|
||||
# the v1 images read it from the container env, the pinned pre-rexctl
|
||||
# compose does not wire it — the override injects it (site33).
|
||||
FLUXER_SETUP_TOKEN: 32
|
||||
FLUXER_CONNECTION_INITIATION_SECRET: 32
|
||||
FLUXER_GATEWAY_RPC_AUTH_TOKEN: 32
|
||||
FLUXER_ERLANG_COOKIE: 32 # runtime-required by the gateway image (not a ${:?})
|
||||
|
||||
@@ -108,12 +108,6 @@
|
||||
replace: '${FLUXER_PASSKEY_RP_ID}'
|
||||
- regexp: '\$\{FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS:-\$\{FLUXER_PUBLIC_SCHEME:-https\}://\$\{FLUXER_DOMAIN\}\}'
|
||||
replace: '${FLUXER_PASSKEY_ADDITIONAL_ALLOWED_ORIGINS}'
|
||||
# 3. app-proxy depends_on caddy; with caddy disabled via the override
|
||||
# profile, podman-compose 1.3.0 crashes with KeyError: 'caddy' in
|
||||
# check_dep_conditions (site17-Befund). The override points
|
||||
# DISCOVERY_UPSTREAM_URL directly at the api, so the edge is dead.
|
||||
- regexp: '^ caddy: .*condition: service_started.*$'
|
||||
replace: ''
|
||||
when: not ansible_check_mode
|
||||
notify:
|
||||
- Restart the Fluxer stack
|
||||
|
||||
+22
-11
@@ -3,10 +3,16 @@
|
||||
# - EVERY service gets its digest-pinned image + pull_policy: never +
|
||||
# journald logging (CT 102/103 pinning convention; images are pre-pulled
|
||||
# by the role from fluxer_stack_images);
|
||||
# - the upstream Caddy edge is disabled (NPM on CT 103 is the TLS edge);
|
||||
# - only app-proxy (8080) and LiveKit (7880 signaling + media ports) are
|
||||
# published on the CT IP; the firewall allows 8080/7880 only from CT 103;
|
||||
# - app-proxy discovery points at the api (caddy edge is disabled).
|
||||
# - the upstream Caddy edge is ENABLED as the internal edge (HTTP :8082):
|
||||
# NPM on CT 103 is the TLS edge and proxies everything to caddy, which
|
||||
# routes /api, /gateway, /media, /admin, static assets, /livekit and the
|
||||
# SPA to the compose services per the pinned Caddyfile (the app-proxy
|
||||
# alone returns SPA HTML for API paths, site32-Befund);
|
||||
# - only the caddy edge (8082) and the LiveKit media ports are published on
|
||||
# the CT IP; the firewall allows 8082 only from CT 103 (voice media ports
|
||||
# are WAN-open per GNAI-025 Befund e);
|
||||
# - app-proxy discovery points at the api (upstream 8088 route is for the
|
||||
# public-edge Caddy setup).
|
||||
# Service names are asserted against the pinned compose by the role.
|
||||
x-ghostnet-defaults: &ghostnet-defaults
|
||||
pull_policy: never
|
||||
@@ -23,22 +29,27 @@ services:
|
||||
# runtime-required by the fluxer images but not wired in the upstream
|
||||
# compose anchor at 3b1eb567 — injected here explicitly
|
||||
FLUXER_PROFILE_PSEUDONYM_SECRET: ${FLUXER_PROFILE_PSEUDONYM_SECRET:?set in .env}
|
||||
# setup-token bootstrap (setup screen on first run): the v1 images read
|
||||
# FLUXER_SETUP_TOKEN (>= 32 chars) from the container env; the pinned
|
||||
# pre-rexctl compose does not wire it, so inject the value from the
|
||||
# guest-generated secrets file via the .env (site33).
|
||||
FLUXER_SETUP_TOKEN: ${FLUXER_SETUP_TOKEN:?set in .env}
|
||||
{% endif %}
|
||||
{% if svc == 'gateway' %}
|
||||
FLUXER_ERLANG_COOKIE: ${FLUXER_ERLANG_COOKIE:?set in .env}
|
||||
{% endif %}
|
||||
{% if svc == fluxer_stack_service_edge %}
|
||||
profiles:
|
||||
- ghostnet-disabled-edge
|
||||
ports: []
|
||||
ports:
|
||||
- "{{ fluxer_stack_edge_port }}:{{ fluxer_stack_edge_port }}"
|
||||
{% elif svc == fluxer_stack_service_app_proxy %}
|
||||
environment:
|
||||
DISCOVERY_UPSTREAM_URL: http://api:8080/api/.well-known/fluxer
|
||||
ports:
|
||||
- "{{ fluxer_stack_app_proxy_port }}:{{ fluxer_stack_app_proxy_port }}"
|
||||
# the api serves /.well-known/fluxer at its root; the upstream default
|
||||
# (caddy:8088/api/...) only works because caddy's :8088 route strips the
|
||||
# /api prefix. Direct container-to-container URL must omit it (GNAI-025
|
||||
# site35: with the /api prefix the branding refresh 404s on every poll).
|
||||
DISCOVERY_UPSTREAM_URL: http://api:8080/.well-known/fluxer
|
||||
{% elif svc == fluxer_stack_service_livekit %}
|
||||
ports:
|
||||
- "{{ fluxer_stack_livekit_signaling_port }}:7880"
|
||||
- "{{ fluxer_stack_livekit_tcp_port }}:{{ fluxer_stack_livekit_tcp_port }}/tcp"
|
||||
- "{{ fluxer_stack_livekit_udp_port }}:{{ fluxer_stack_livekit_udp_port }}/udp"
|
||||
{% if fluxer_stack_voice_enabled %}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
# once on this guest, never in git). Verify the variable names against the
|
||||
# pinned upstream .env.example when bumping fluxer_stack_upstream_commit.
|
||||
FLUXER_DOMAIN={{ fluxer_stack_public_domain }}
|
||||
# required by the compose even with the caddy edge disabled (GNAI-025):
|
||||
FLUXER_CADDY_SITE_ADDRESS={{ fluxer_stack_public_scheme }}://{{ fluxer_stack_public_domain }}
|
||||
# internal caddy edge listener (site32-Befund): NPM is the TLS edge, caddy
|
||||
# serves plain HTTP on this port only — no ACME, no public 80/443 from here:
|
||||
FLUXER_CADDY_SITE_ADDRESS=:{{ fluxer_stack_edge_port }}
|
||||
FLUXER_LIVEKIT_ENABLED={{ 'true' if fluxer_stack_voice_enabled else 'false' }}
|
||||
# podman-compose 1.3.0 liefert bei manchen ${VAR:-default}-Refs einen Leerstring
|
||||
# durch (hier beobachtet: SSO_ALLOW_PRIVATE_ADDRESSES) — daher explizit gesetzt:
|
||||
@@ -17,7 +18,11 @@ FLUXER_LIVEKIT_ENABLED={{ 'true' if fluxer_stack_voice_enabled else 'false' }}
|
||||
# müssen hier (leer) stehen — fehlt die Variable komplett, lässt
|
||||
# podman-compose 1.3.0 das Literal "${VAR:-}" im Container-Env stehen und
|
||||
# die api stirbt an "Invalid email app base URL" (site15-Befund):
|
||||
FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES=false
|
||||
# true: the SSO provider (Keycloak auth.ghostnet.selfhost.eu) resolves to a
|
||||
# private LAN address — the api's egress policy (SSRF protection) blocks
|
||||
# SSO token/userinfo exchanges against private destinations otherwise and the
|
||||
# /auth/sso/complete request hangs (Operator-Befund 30.11., NPM 499)
|
||||
FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES=true
|
||||
FLUXER_DISCOVERY_ENABLED=true
|
||||
FLUXER_EMAIL_ENABLED=false
|
||||
FLUXER_EMAIL_PROVIDER=none
|
||||
|
||||
Reference in New Issue
Block a user