Files
infrastructure/proxmox/lxc/ct-103-reverse-proxy/ansible
spektr 51ce267563
ci-static / secret-scan (push) Successful in 21s
ci-static / yamllint (push) Successful in 31s
ci-static / ansible-syntax (push) Successful in 29s
ci-static / markdown-links (push) Successful in 21s
GNAI-025: Befund f revidiert — Upstream-Caddy als interner Edge (:8082), App vollständig bedienbar
Das app-proxy-only-Routing war unvollständig: der app-proxy ist ein reiner
SPA-Catch-all — /api, /gateway, /media, /admin und Static-Assets fielen auf
ihn zurück, die App konnte keine API-Aufrufe machen.

- fluxer_stack: Caddy-Edge aktiviert (intern, HTTP :8082 via
  FLUXER_CADDY_SITE_ADDRESS=:{{ edge_port }}, kein ACME); gepinnte Caddyfile
  routes alle Pfade zu den Compose-Services; app-proxy 8080 und LiveKit-
  Signaling 7880 nicht mehr gepublisht; caddy-Dep-Kante (Adaption 3) revertiert
- fluxer_firewall: NPM → 8082 (input + DNAT-forward); Verify-Assertionen auf
  den Caddy-Edge umgezogen
- reverse_proxy_fluxer_vhost: NPM → 10.0.0.62:8082 (alles; WS-Upgrade,
  86400 s Timeouts), /livekit/-Location entfernt (caddy routes /livekit)
- Doku: Änderungsverlauf 1.14, Befund f + Zielarchitektur + Abschnitt 5
  und 5a auf den Caddy-Edge-Stand

Verifiziert: /api/auth/sso/status öffentlich HTTP 200 (echte API-Antwort,
SSO enabled=false — Phase 8 steht aus), /admin/login 200, /.well-known/fluxer
200; CT-117- und CT-103-Zweitläufe changed=0.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-30 05:02:09 +01:00
..

CT 103 reverse proxy Ansible project

This self-contained host project manages the production reverse proxy LXC (CT 103, reverse-proxy, 10.0.0.10: Nginx Proxy Manager, Fail2Ban, nftables). It follows the CT 100 Pi-hole and CT 101 Samba project schema, uses the repository-wide pinned control dependency and the shared podman_runtime role, while all CT 103 inventories, playbooks, keys and service roles remain inside the CT 103 root.

Create the repository-level control environment once:

python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r shared/ansible/requirements-control.txt

Run commands from this directory and always select an inventory explicitly:

cd proxmox/lxc/ct-103-reverse-proxy/ansible
../../../../.venv/bin/ansible-playbook \
  --inventory inventories/agent/hosts.yml \
  playbooks/preflight.yml \
  --private-key ~/.ssh/id_ed25519_ghostnet_ct103_agent

Adoption sequence for the pre-Ansible CT 103

The LXC was hardened and accepted before this project existed (GNAI-006). The adoption path mirrors CT 100 and keeps the production proxy intact:

  1. preflight.yml on the agent inventory (read-only, unprivileged, --private-key ~/.ssh/id_ed25519_ghostnet_ct103_agent) proves identity, service health, listeners and the local NPM admin answer.
  2. audit-production.yml on the bootstrap inventory (read-only, become through ghost, --ask-become-pass) deep-audits the root-only state and reports the known drifts instead of failing on them.
  3. bootstrap.yml on the bootstrap inventory adopts the ansible-deploy account, the NOPASSWD sudo policy and the unified SSH drop-in; keep a second session or the Proxmox console open while SSH policy changes are applied.
  4. verify-deploy-access.yml on the production inventory proves the new deployment boundary (--private-key ~/.ssh/id_ed25519_ghostnet_ct103_ansible_deploy).
  5. site.yml --check --diff on the production inventory previews the convergence. Expected changes: the SSH drop-in gains AllowUsers ansible-deploy, AllowStreamLocalForwarding no and DisableForwarding yes; SSH socket activation is replaced by the classic ssh.service; /etc/nftables.conf is rewritten with the managed marker (identical rules); the two stale Quadlet backups are removed.
  6. site.yml converges; verify-production.yml plus a second site.yml --check run with changed=0 complete the adoption.

The production verifier is read-only. A real site.yml run enforces the declared state and therefore requires an explicit change authorization.

Disk housekeeping (incident 2026-11-26)

On 2026-11-26 the CT 103 root filesystem filled up: the NPM access logs below /opt/nginx-proxy-manager/data/logs had no logrotate policy, and nginx keeps deleted inodes open inside the container. NPM then served truncated 0-byte assets, which surfaced as "Frontend is not initialized" on Gitea (CT 110) and unstyled Keycloak pages behind the proxy. The reverse_proxy_disk_housekeeping role (part of site.yml) declares the countermeasures: a journald size cap, a copytruncate logrotate policy for the NPM logs, and a self-healing guard that vaciums the journal, purges the NPM proxy cache and restarts NPM whenever the root headroom drops below reverse_proxy_minimum_root_available_bytes (1 GiB, also asserted by audit-production.yml and verify-production.yml). The guard makes every site.yml run heal a full root disk reproducibly; once the headroom is restored, a second run reports changed=0.

Declared scope and deliberate non-goals

  • NPM runtime data (SQLite database, keys, Let's Encrypt certificates, proxy hosts), the Fail2Ban configuration tree and ban database, and the NPM admin password are backup-restored runtime artifacts. They are never created, read or transported by these playbooks.
  • postfix.service is present on the host but outside the GNAI-006 declared state; this project neither installs nor removes it. The operator decides whether to retire it.
  • The functional Fail2Ban acceptance (GNAI-006 section 12) stays an operator-run procedure; this project only pins the quadlet, jails and filters.
  • Do not store secret contents, private SSH keys or NPM access-log data in this repository.