GNAI-025: Fluxer-Chat-LXC CT 117 — komplett in Betrieb (fluxer.ghostnet.selfhost.eu) #21

Merged
spektr merged 72 commits from lxc/ct-117-gnai-025-fluxer-chat into main 2026-11-30 04:49:27 +01:00
6 changed files with 178 additions and 28 deletions
Showing only changes of commit d6cc02142c - Show all commits
+1 -1
View File
@@ -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) | geplanter Fluxer-Chat-LXC `fluxer` (`10.0.0.62`): Machbarkeitsprüfung (Keycloak-OIDC, Unattended Updates, Performance), Podman-LXC-Schema, Ansible-Projekt, NPM-Vhost und Keycloak-Client — CT noch nicht angelegt (Plan 27.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: Stack konvergiert (23 Services Up, api healthy, `changed=0`; podman-compose-1.3.0-Adaptionen Abschnitt 5a); offen: Keycloak-Client, NPM-Vhost, SSO/DNS/Ports, Abnahme (Stand 30.11.2026) |
### KI und Deployment
@@ -1,7 +1,7 @@
# Fluxer Chat LXC (CT 117) – Plan, Machbarkeitsprüfung und Umsetzungsstand
**Stand:** 2026-11-27
**Status:** Plan + Repo-Artefakte vollständig vorbereitet (Ansible-Projekt, PVE-Provisioning-Skript, NPM-Vhost-Rolle, Keycloak-Client); CT 117 ist **noch nicht angelegt** — Anlage und produktive Ansible-Läufe sind Operator-Schritte (Abschnitt 6).
**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).
## Änderungsverlauf
@@ -14,6 +14,11 @@
| 2026-11-27 | 1.4 | Mistral Vibe / Operator | Operator bestätigt: local-lvm hat reichlich Platz und alle bisherigen LXCs liefen dort — Storage-Wechsel auf daten4 war voreilig; Default bleibt local-lvm, Ursache der tar-Permission-denied wird diagnostiziert (LV-Mountpoint nicht schreibbar für uid 100000) |
| 2026-11-27 | 1.5 | Mistral Vibe / Operator | Ursache gefunden: `umask 077` im Provisioning-Skript vererbt sich an `pct create` → rootfs-Mountpoint 0700 root → tar unter lxc-usernsexec får „Permission denied“. Reproduziert (VMID 117 minimal OK, VMID 119 mit umask 077 FAIL). Fix: `umask 022` vor dem pct-Aufruf; Storage bleibt local-lvm |
| 2026-11-27 | 1.6 | Mistral Vibe | Zweiter Skript-Bug gefixt: rootfs-Verify-Regex enthielt `\\$` (literales Dollar statt EOL-Anchor) und matchte nie; jetzt `(,|$)`. Hinweis: Das CT-101-Template-Skript trägt dieselbe latente Regex — dort unberührt. Nach dem Fehllauf muss CT 117 vor dem Retry per `pct destroy 117 --purge` entfernt werden (Guard verhindert sonst den Rerun) |
| 2026-11-29 | 1.7 | Mistral Vibe / Operator | **CT 117 angelegt** (local-lvm, 64 GiB; Host-Key-Fingerprint gepinnt). Provisioning-Fixes aus 1.5/1.6 wirksam; Storage bleibt local-lvm. Compose-Pin korrigiert: main `872ed5d` hat die self-hosting-compose nicht mehr (rexctl-Umbau) — gepinnt auf `3b1eb567` (compose-SHA `1cb102f9…`; `d5558cd…` war die SHA-256 der 404-Seite), livekit.yaml/Caddyfile-SHA mitgepinnt. Preflight-Gate rootfs auf 60 GB dezimal (ext4-Overhead auf 64-GiB-LV). Rollen check-mode-sicher; `remote_tmp = ~/.ansible/tmp` (tmp.mount-Masking unmountet sonst /tmp mitten im Lauf) |
| 2026-11-30 | 1.8 | Mistral Vibe | Alle 18 Image-Digests docker.io-vollqualifiziert in allen drei Inventories (skopeo via `pin-fluxer-images.sh`; podman ohne unqualified-search-registries); Override pinnt alle 25 Services per Digest + `pull_policy: never` |
| 2026-11-30 | 1.9 | Mistral Vibe | Erste podman-compose-1.3.0-Laufzeitbefunde: Gateway verlangt `FLUXER_ERLANG_COOKIE`, Shards `FLUXER_PROFILE_PSEUDONYM_SECRET` (Override injiziert beide als runtime-Secrets); Secret-Generierung idempotent nachziehend (fehlende Keys werden ergänzt, statt nur bei leerer Datei); Firewall erlaubt podman-bridge (aardvark-dns `10.89.0.1:53` + intra-`10.89.0.0/16`) — sonst kein Inter-Container-DNS/Traffic; Unit mit `up -d --force-recreate` + `TimeoutStartSec=1800` (podman-compose recreatet sonst nicht bei .env-Änderung) |
| 2026-11-30 | 1.10 | Mistral Vibe | podman-compose-1.3.0-Substitutionsdefekte: nicht-leere compose-Defaults (`${VAR:-default}`) werden als **Leerstring** substituiert, wenn VAR im .env fehlt (Node-API lehnt leere Booleans ab) — alle Defaults explizit ins .env; 4 verschachtelte `${VAR:-${INNER:-…}}`-Refs werden zerpflückt — in der Adaption geflattet; VAPID-Keys im Fluxer-Format base64url **ohne Padding** (raw 32-Byte-Scalar/65-Byte-Point), falsch formatierte Altwerte regeneriert; seaweedfs-init-Bedingung `service_completed_successfully` wird von podman-compose 1.3.0 nie erfüllt |
| 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 |
## 1. Zweck und Leitentscheidung
@@ -90,7 +95,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) + `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 |
| 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 `chat.ghostnet.selfhost.eu` → 10.0.0.62:8080 + `/livekit/` → :7880, LE-Cert, Fail2Ban-Restart; in CT-103-`site.yml` eingehängt |
| Keycloak | `proxmox/lxc/ct-102-keycloak/.../keycloak_realm_config` | Client `fluxer` (Abschnitt 4) |
@@ -102,15 +107,60 @@ unprivilegierter LXC, rootful Podman unter systemd, digest-gepinnte Images,
`podman.socket`/`podman-auto-update.timer` deaktiviert, nftables default-deny,
drei Inventories.
### 5a. podman-compose 1.3.0 — dokumentierte Defekte und die Adaption der gepinnten Compose
Debian 13 liefert podman-compose **1.3.0** (mit podman 5.4.2), das die
upstream-compose nur mit lokal aufgezeichneten, deterministischen
Transformationen fehlerfrei fährt. Die Rolle lädt die Compose SHA-256-verifiziert
nach `docker-compose.upstream.yml` (bleibt pristin und checksummbar), kopiert sie
bei Upstream-Änderung in die aktive `docker-compose.yml` und wendet dort per
`ansible.builtin.replace` diese Adaptionen an (alle Muster backslash-frei und
MULTILINE-verankert — die replace-Action interpretiert Backslash-Escapes in
Loop-Args unzuverlässig):
1. **seaweedfs-init-Dep-Kanten entfernt** (api/worker/media-proxy):
`service_completed_successfully` wird von podman-compose 1.3.0 nie erfüllt,
und nach Konvertierung auf `service_started` blockt
`podman wait --condition=running` ewig, sobald der Oneshot-Container
`Exited (0)` ist. Die S3-Buckets persistieren im seaweedfs-data-Volume;
auf einem frischen Volume self-healt api/media-proxy per restart-Policy,
während init läuft.
2. **4 verschachtelte `${VAR:-${INNER:-…}}`-Refs geflattet** (FLUXER_REGISTRY,
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.
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,
KLIPY, EMAIL_APP_BASE_URL). podman-compose 1.3.0 hinterlässt fehlende Variablen
als wörtlichen `${VAR:-}`-String im Container-Env (Befund: api „Invalid email
app base URL") bzw. substituiert nicht-leere Defaults als Leerstring (Node-API
lehnt leere Booleans ab). `FLUXER_EMAIL_APP_BASE_URL` wird auf die Public-URL
gesetzt.
LiveKit: die gepinnte `livekit.yaml` referenziert `webhook.api_key: fluxer` —
LiveKit exittet sofort mit 0, wenn dieser Name nicht in `LIVEKIT_KEYS`
existiert. `LIVEKIT_API_KEY` ist daher ein **Bezeichner** (fix `fluxer`,
Task erzwingt den Wert idempotent), das zufällige `LIVEKIT_API_SECRET` bleibt
der eigentliche Schutz. `rtc.use_external_ip: true` der gepinnten Config
erfordert ausgehenden STUN; die Firewall erlaubt deshalb vollen
Podman-Bridge-Egress im etablierten Homelab-Muster (wie `keycloak_firewall`,
CT 102) — LiveKit (STUN) und unfurl (Link-Previews beliebiger URLs) brauchen
ihn.
## 6. Phasen und Checkliste (Operator-Schritte hervorgehoben)
1. **Operator:** PVE-Host-Kapazität prüfen (`free -h`, Summe memory der CTs vs. RAM); ggf. Profil anpassen. **Erledigt 2026-11-27 (Operator): 32 GiB RAM, 25 % belegt — 8 GiB CT-Profil unkritisch.**
2. **Operator (Workstation):** drei CT-117-Keypairs generieren, `.pub` nach `files/ssh/`, SSH-Aliases `ghostnet-ct117-*` in `~/.ssh/config`.
3. **Operator:** upstream-Commit + compose-SHA-256 pinnen (erledigt 2026-11-27: `872ed5d` / `d5558cd…`); alle Image-Digests via `proxmox/lxc/ct-117-fluxer/scripts/pin-fluxer-images.sh` ermitteln (einmalig, Workstation, `sudo apt install -y skopeo`, kein Passwort) und das ausgegebene YAML in die drei `group_vars/fluxer_hosts.yml` eintragen; SSH-Host-Key-Fingerprint-Platzhalter vormerken. Hinweis: `fluxer-worker` existiert nicht als eigenes Image — der Worker läuft aus dem `fluxer-api`-Image.
4. **Operator:** Repo-Dateien per `scp` auf den PVE-Host kopieren ( siehe `scripts/README.md` — baseline hook nach `/usr/local/sbin/`, Provisioning-Skript und die drei `.pub`-Dateien nach `/root/`), dort SHA-256 des Hooks verifizieren (`111f1b70…`), dann als root@pve `GHOSTNET_AGENT_UID=1000 GHOSTNET_ADMIN_UID=1001 bash /root/provision-ct117-fluxer.sh` ausführen (legt CT 117 an); danach `pct exec 117 -- passwd ghost`, pubkeys in die authorized_keys (`pct push`), Fingerprint pinnen.
5. **Agent:** `preflight.yml` auf `agent`-Inventory (read-only) — Identitäts- und Leerstands-Gates.
6. **Agent (nach Operator-Go):** `site.yml --check --diff` auf `production`, dann autorisierter `site.yml`-Lauf; zweiter Lauf muss `changed=0` liefern.
7. **Agent:** CT-102-`keycloak_realm_config` laufen lassen (legt Client `fluxer` an).
2. **Operator (Workstation):** drei CT-117-Keypairs generieren, `.pub` nach `files/ssh/`, SSH-Aliases `ghostnet-ct117-*` in `~/.ssh/config`. **Erledigt 2026-11-29.**
3. **Operator:** upstream-Commit + compose-SHA-256 pinnen (**korrigiert 2026-11-29: `3b1eb567` / `1cb102f9…`** — `872ed5d`/`d5558cd…` war die 404-Seite, main hat die self-hosting-compose nicht mehr); alle 18 Image-Digests via `proxmox/lxc/ct-117-fluxer/scripts/pin-fluxer-images.sh` ermitteln (skopeo, docker.io-vollqualifiziert) und das YAML in die drei `group_vars/fluxer_hosts.yml` eintragen. **Erledigt 2026-11-30.** Hinweis: `fluxer-worker` existiert nicht als eigenes Image — der Worker läuft aus dem `fluxer-api`-Image.
4. **Operator:** Repo-Dateien per `scp` auf den PVE-Host kopieren (siehe `scripts/README.md`), Hook-SHA verifizieren (`111f1b70…`), dann `GHOSTNET_AGENT_UID=1000 GHOSTNET_ADMIN_UID=1001 bash /root/provision-ct117-fluxer.sh`; danach `pct exec 117 -- passwd ghost`, pubkeys in die authorized_keys, Fingerprint pinnen. **Erledigt 2026-11-29 (CT 117 angelegt, local-lvm, 64 GiB; Fingerprint `SHA256:bL5zdRfuXcspX9gRSuPvLgHzyXJsZo+KsU0jdDqIxrA`).**
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). **Offen.**
8. **Operator:** Keycloak-Credentials-Tab → Secret in Fluxer `/admin` eintragen (Issuer/Client-ID/Secret), Registrierung auf invite-only.
9. **Agent (nach Operator-Go):** CT-103-`site.yml` mit neuer Rolle `reverse_proxy_fluxer_vhost` (legt NPM-Vhost + LE-Cert an).
10. **Operator:** Pi-hole-Split-DNS `chat.ghostnet.selfhost.eu → 10.0.0.10`; FRITZ!Box-Portweiterleitung 7881/tcp, 3478/udp, 50000–50100/udp → 10.0.0.62 nur bei D2=ja.
@@ -156,7 +206,21 @@ drei Inventories.
- App-level-Backup (restic) nachrüsten?
- Öffentlicher DNS: Wildcard `*.ghostnet.selfhost.eu` deckt `chat.` ab (wie research/auth) — Operator bestätigt.
## 12. Implementierungsstand 2026-11-27
## 12. Implementierungsstand 2026-11-30
Repo-Artefakte vollständig (Abschnitt 5); CT 117 nicht angelegt; keine
produktiven Läufe. Nächster Schritt: Operator-Phasen 1–4 (Abschnitt 6).
CT 117 produktiv angelegt (local-lvm, 64 GiB, Fingerprint gepinnt) und bis
Phase 6 durch die produktiven Ansible-Läufe gebracht:
- Baseline (unattended-upgrades, Konten), Access (Rollen-Keys, Hardening),
Firewall (default-deny, NPM-only-HTTP, Voice-Ports, Podman-Bridge-Egress
nach CT-102-Muster) und Podman-Runtime konvergiert.
- Fluxer-Stack über `fluxer-stack.service` (pinned compose @ `3b1eb567`,
18 Image-Digests, lokale Adaptionen Abschnitt 5a): 23 Services Up,
seaweedfs-init `Exited (0)` (Sollzustand), api/postgres/valkey healthy,
app-proxy HTTP 200 auf `10.0.0.62:8080`, LiveKit mit STUN-External-IP.
- Konvergenz nachgewiesen: `site.yml`-Zweitlauf `changed=0`, failed=0.
Offen: Phase 7 (Keycloak-Client), 8 (Operator: Secret ins Admin-Panel,
invite-only), 9 (NPM-Vhost), 10 (Operator: Pi-hole-Split-DNS, FRITZ!Box-Ports
bei D2=ja), 11 (Abnahmetests Abschnitt 10); Doku-Index-Statuszeile nach
Go-Live.
@@ -52,6 +52,13 @@ table inet ghostnet_filter {
ct state invalid counter drop
ct state established,related counter accept
ip saddr {{ fluxer_firewall_podman_subnet }} ip daddr {{ fluxer_firewall_podman_subnet }} counter accept comment "podman bridge intra-network"
# Full podman-bridge egress, matching the established homelab pattern
# (keycloak_firewall, CT 102): LiveKit needs outbound STUN for its
# external-IP discovery (rtc.use_external_ip in livekit.yaml), and
# unfurl fetches arbitrary link-preview URLs. Without egress LiveKit
# crash-loops ("could not resolve external IP") and destabilizes the
# whole stack unit.
ip saddr {{ fluxer_firewall_podman_subnet }} counter accept comment "Podman network egress"
counter drop comment "CT 117 forwards nothing else"
}
@@ -12,6 +12,8 @@
fluxer_stack_directory: /opt/fluxer
fluxer_stack_compose_file: "{{ fluxer_stack_directory }}/docker-compose.yml"
# SHA-verified upstream copy; the active compose is adapted locally (below)
fluxer_stack_compose_upstream_file: "{{ fluxer_stack_directory }}/docker-compose.upstream.yml"
fluxer_stack_override_file: "{{ fluxer_stack_directory }}/docker-compose.ghostnet.yml"
fluxer_stack_env_file: "{{ fluxer_stack_directory }}/.env"
fluxer_stack_secrets_file: /etc/fluxer/fluxer-secrets.env
@@ -97,7 +99,11 @@ fluxer_stack_secret_specs:
FLUXER_S3_SECRET_KEY: 32
POSTGRES_PASSWORD: 24
MEILI_MASTER_KEY: 32
LIVEKIT_API_KEY: 8
# LIVEKIT_API_KEY is NOT here: it is a key *name* (identifier, not secret)
# and must be the literal "fluxer" — the pinned upstream livekit.yaml
# references webhook.api_key: fluxer, and livekit exits (0) at startup
# when that name has no matching entry in LIVEKIT_KEYS (site19-Befund).
# The task block enforces it; only LIVEKIT_API_SECRET is random.
LIVEKIT_API_SECRET: 32
# Extra pinned files from the same upstream commit (bind-mounted by the
@@ -33,20 +33,45 @@
mode: "0750"
- name: Fetch the pinned upstream compose file (SHA-256-verifiziert)
# fetched to a separate upstream copy so the checksum stays verifiable:
# the active docker-compose.yml is locally adapted below and would
# re-download (and restart the stack) on every run otherwise
ansible.builtin.get_url:
url: "{{ fluxer_stack_compose_url }}"
dest: "{{ fluxer_stack_compose_file }}"
dest: "{{ fluxer_stack_compose_upstream_file }}"
owner: root
group: root
mode: "0644"
checksum: "sha256:{{ fluxer_stack_compose_sha256 }}"
timeout: 60
notify:
- Restart the Fluxer stack
register: fluxer_stack_compose_download
# in check mode the stack directory is not created yet, so the fetch is
# only previewed; the real run verifies the checksum
when: not ansible_check_mode
- name: Check the active compose file
ansible.builtin.stat:
path: "{{ fluxer_stack_compose_file }}"
register: fluxer_stack_compose_stat
- name: Copy the verified upstream compose into place (only on upstream change)
# NOT a plain content comparison: the active compose is locally adapted
# and therefore always differs from the pristine upstream copy. Refresh it
# only when the upstream download actually changed or the file is missing;
# the adapt task below then re-applies the recorded transformations.
ansible.builtin.copy:
remote_src: true
src: "{{ fluxer_stack_compose_upstream_file }}"
dest: "{{ fluxer_stack_compose_file }}"
owner: root
group: root
mode: "0644"
notify:
- Restart the Fluxer stack
when:
- not ansible_check_mode
- fluxer_stack_compose_download is changed or not fluxer_stack_compose_stat.stat.exists
- name: Note the deferred compose fetch in check mode
ansible.builtin.debug:
msg: >-
@@ -64,9 +89,15 @@
replace: "{{ item.replace }}"
regexp: "{{ item.regexp }}"
loop:
# 1. completed_successfully is never satisfied by podman-compose 1.3.0
- regexp: 'seaweedfs-init: \{condition: service_completed_successfully\}'
replace: 'seaweedfs-init: {condition: service_started}'
# 1. remove the seaweedfs-init depends_on edges entirely: podman-compose
# 1.3.0 never satisfies `service_completed_successfully` AND, after
# converting the condition to service_started, blocks forever in
# `podman wait --condition=running` once the oneshot init container
# has exited (0) (site20-Befund). The S3 buckets persist in the
# seaweedfs-data volume; on a truly fresh volume api/media-proxy
# self-heal via restart: unless-stopped while init runs.
- regexp: '^ seaweedfs-init: .*service_completed.*$'
replace: ''
# 2. nested ${VAR:-${INNER:-default}} refs get mangled (leftover "}:" in
# the container env); flatten so our explicit .env values pass through
- regexp: '\$\{FLUXER_REGISTRY:-ghcr\.io/\$\{FLUXER_REGISTRY_OWNER:-fluxerapp\}\}'
@@ -77,6 +108,12 @@
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
@@ -151,6 +188,11 @@
{% for name, nbytes in fluxer_stack_secret_specs.items() %}
grep -q "^{{ name }}=" "$f" || printf '%s=%s\n' '{{ name }}' "$(/usr/bin/openssl rand -hex {{ nbytes }})" >> "$f"
{% endfor %}
# LIVEKIT_API_KEY is an identifier, not a secret: the pinned upstream
# livekit.yaml hardcodes webhook.api_key: fluxer, and livekit exits (0)
# at startup when that name is missing from LIVEKIT_KEYS. Enforce the
# literal value; keep the (random) LIVEKIT_API_SECRET as the real secret.
grep -q '^LIVEKIT_API_KEY=fluxer$' "$f" || { sed -i '/^LIVEKIT_API_KEY=/d' "$f"; printf 'LIVEKIT_API_KEY=fluxer\n' >> "$f"; }
grep -q '^FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=' "$f" \
|| printf 'FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=%s\n' "$(/usr/bin/openssl rand -base64 36)" >> "$f"
if ! grep -qE '^FLUXER_VAPID_PRIVATE_KEY=[A-Za-z0-9_-]{43}$' "$f" || ! grep -qE '^FLUXER_VAPID_PUBLIC_KEY=[A-Za-z0-9_-]{86,87}$' "$f"; then
@@ -168,7 +210,8 @@
fi
args:
executable: /bin/bash
changed_when: true
# guarded by grep: on a converged guest every branch is a no-op
changed_when: false
when: not ansible_check_mode
- name: Enforce root-only permissions on the secrets file
@@ -289,20 +332,31 @@
- fluxer_stack_start_allowed
- not ansible_check_mode
- name: Verify every compose service is running
- name: Verify every compose service is running (seaweedfs-init may have exited 0)
# seaweedfs-init is a oneshot S3 bucket bootstrap container: its healthy
# terminal state is Exited (0), not running (site21-Befund).
ansible.builtin.assert:
that:
- >-
fluxer_stack_ps.stdout | from_json |
selectattr('State', 'defined') | list | length > 0
- >-
fluxer_stack_ps.stdout | from_json |
selectattr('State', 'equalto', 'running') | list | length ==
(fluxer_stack_ps.stdout | from_json | length)
(fluxer_stack_ps.stdout | from_json |
rejectattr('State', 'equalto', 'running') |
map(attribute='Names') | map('join', ' ') | list) |
difference(
fluxer_stack_ps.stdout | from_json |
rejectattr('State', 'equalto', 'running') |
selectattr('ExitCode', 'equalto', 0) |
map(attribute='Names') | map('join', ' ') |
select('search', 'seaweedfs-init') | list) |
length == 0
fail_msg: >-
Not all Fluxer compose services are running. Inspect with
Not all Fluxer compose services are running (seaweedfs-init may be
Exited (0), nothing else). Inspect with
`podman-compose -f docker-compose.yml -f docker-compose.ghostnet.yml ps`
and `podman logs <container>` on CT 117.
when:
- fluxer_stack_start_allowed
- not ansible_check_mode
@@ -12,16 +12,35 @@ FLUXER_LIVEKIT_ENABLED={{ 'true' if fluxer_stack_voice_enabled else 'false' }}
# Explizite compose-Defaults: podman-compose 1.3.0 ersetzt ${VAR:-default}
# durch Leerstrings, wenn VAR nicht im .env steht — die Node-API lehnt leere
# Boolean-Werte ab. Alle nicht-leeren Defaults aus der gepinnten Compose
# (3b1eb567) daher explizit gesetzt; leere Defaults (CSP_*, SMTP-Felder,
# KLIPY) bleiben bewusst weg:
# (3b1eb567) daher explizit gesetzt.
# Wichtig: auch die Defaults mit LEEREM Wert (CSP_*, SMTP-Felder, KLIPY)
# 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
FLUXER_DISCOVERY_ENABLED=true
FLUXER_EMAIL_ENABLED=false
FLUXER_EMAIL_PROVIDER=none
FLUXER_EMAIL_FROM_EMAIL=noreply@localhost
FLUXER_EMAIL_FROM_NAME=Fluxer
FLUXER_EMAIL_APP_BASE_URL={{ fluxer_stack_public_scheme }}://{{ fluxer_stack_public_domain }}
FLUXER_EMAIL_SMTP_HOST=
FLUXER_EMAIL_SMTP_PORT=587
FLUXER_EMAIL_SMTP_SECURE=true
FLUXER_EMAIL_SMTP_USERNAME=
FLUXER_EMAIL_SMTP_PASSWORD=
FLUXER_KLIPY_API_KEY=
FLUXER_CSP_EXTRA_CONNECT_SRC=
FLUXER_CSP_EXTRA_DEFAULT_SRC=
FLUXER_CSP_EXTRA_FONT_SRC=
FLUXER_CSP_EXTRA_FRAME_SRC=
FLUXER_CSP_EXTRA_IMG_SRC=
FLUXER_CSP_EXTRA_MANIFEST_SRC=
FLUXER_CSP_EXTRA_MEDIA_SRC=
FLUXER_CSP_EXTRA_SCRIPT_SRC=
FLUXER_CSP_EXTRA_STYLE_SRC=
FLUXER_CSP_EXTRA_WORKER_SRC=
FLUXER_CSP_REPORT_URI=
FLUXER_CAPTCHA_ENABLED=false
FLUXER_CAPTCHA_PROVIDER=none
FLUXER_PASSKEY_RP_ID={{ fluxer_stack_public_domain }}