feat(configgen): Phase 2 Config-Generator + nginx → HAProxy-only Pivot
Architektur-Pivot: nginx fällt komplett weg. HAProxy 2.8+ übernimmt
TLS-Termination, L7-Routing per Host-Header und LB. ACME-Webroot
und Management-UI werden von edgeguard-api ausgeliefert (Phase 3
implementiert die zugehörigen Handler); HAProxy proxied
/.well-known/acme-challenge/* und Management-FQDN-Traffic an
127.0.0.1:9443. Eine Distro-Abhängigkeit weniger, ein Renderer
weniger, sauberere Trennung.
Renderer (alle mit Embed-Templates + Tests):
* internal/configgen/ — atomic write + systemctl reload helpers
* internal/haproxy/ — :80 + :443, ACME-ACL, Host-Header-Routing,
Stats-Frontend, api_backend Fallback
* internal/firewall/ — default-deny input, stateful baseline,
SSH-Rate-Limit, :80/:443 accept,
Cluster-Peer-Set für mTLS :8443,
Custom-Rules aus PG
* internal/{squid,wireguard,unbound}/ — Stubs (ErrNotImplemented)
Orchestrator + CLI:
* internal/services/configorch/ — fester Reihenfolge-Run, Stubs
sind soft-skip statt fatal
* cmd/edgeguard-ctl render-config [--no-reload] [--only=svc1,svc2]
Packaging:
* postinst: /etc/edgeguard/nginx raus, /var/lib/edgeguard/acme rein,
self-signed _default.pem via openssl req (damit HAProxy startet
bevor certbot etwas issuet hat)
* control: Depends nginx raus, openssl rein
* edgeguard-ui: dependency auf nginx weg, "Served by edgeguard-api
gin StaticFS"
Live-Smoke: render-config gegen lokale PG schreibt /etc/edgeguard/
haproxy/haproxy.cfg + nftables.d/ruleset.nft korrekt; CRUD-Test aus
Phase 2 läuft weiter unverändert.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
12
CLAUDE.md
12
CLAUDE.md
@@ -57,7 +57,7 @@ ac_search_code(query="<stichworte>", project_id=8, session_name=$(printenv ARCHI
|
||||
| **UI** | React 19, TypeScript strict, Vite, Ant Design 6, TanStack Query 5 |
|
||||
| **DB** | PostgreSQL 16 (Distro-Paket), goose-Migrations in `migrations/` |
|
||||
| **State/HA** | KeyDB Active-Active (Redis-kompatibel) |
|
||||
| **Proxy/LB** | HAProxy (Distro), nginx (Distro) |
|
||||
| **Proxy/LB** | HAProxy (Distro) — TLS-Termination, L7-Routing, LB |
|
||||
| **VPN** | WireGuard (Kernel-Modul ab 5.6, `wireguard-tools`) |
|
||||
| **DNS** | Unbound (Distro) — Forwarder+Cache mit DNSSEC, Cluster-internes Split-Horizon |
|
||||
| **FW** | nftables (Distro) |
|
||||
@@ -88,7 +88,7 @@ ac_search_code(query="<stichworte>", project_id=8, session_name=$(printenv ARCHI
|
||||
| `edgeguard-scheduler` | Cron-Jobs (ACME-Renew, Backup, Health) | — | `edgeguard` |
|
||||
| `edgeguard-ctl` | CLI: `initdb migrate cluster-join promote dump-config` | — | root/edgeguard |
|
||||
|
||||
nginx terminiert TLS auf `:443` und proxied an `127.0.0.1:9443`.
|
||||
HAProxy terminiert TLS auf `:443`, routet per Host-Header an Backends und fällt für Management-FQDN/ACME-Webroot auf `127.0.0.1:9443` (edgeguard-api) zurück. Die Management-UI wird von edgeguard-api ausgeliefert (statisch aus `/usr/share/edgeguard/ui/` oder embedded).
|
||||
|
||||
---
|
||||
|
||||
@@ -112,7 +112,7 @@ cd management-ui && bun install && bun run build
|
||||
|
||||
```bash
|
||||
# Abhängigkeiten installieren
|
||||
sudo apt-get install -y postgresql-16 haproxy nginx wireguard-tools squid unbound nftables certbot
|
||||
sudo apt-get install -y postgresql-16 haproxy wireguard-tools squid unbound nftables certbot
|
||||
|
||||
# API starten (ohne systemd, für Entwicklung)
|
||||
go run ./cmd/edgeguard-api/
|
||||
@@ -137,8 +137,7 @@ cd management-ui && bun run dev
|
||||
│ ├── models/ # GORM-Models
|
||||
│ ├── handlers/ # HTTP-Handler (REST)
|
||||
│ ├── services/ # Business-Logik
|
||||
│ ├── haproxy/ # Config-Generator
|
||||
│ ├── nginx/ # Config-Generator
|
||||
│ ├── haproxy/ # Config-Generator (TLS + Routing + LB)
|
||||
│ ├── squid/ # Config-Generator
|
||||
│ ├── wireguard/ # Config-Generator
|
||||
│ ├── unbound/ # Config-Generator (Forwarder + Cluster-DNS)
|
||||
@@ -151,8 +150,7 @@ cd management-ui && bun run dev
|
||||
├── packaging/debian/ # control, postinst, postrm, systemd-Units
|
||||
├── deploy/
|
||||
│ ├── systemd/ # *.service, *.target, *.timer
|
||||
│ ├── haproxy/ # haproxy.cfg.tpl
|
||||
│ ├── nginx/ # vhost.conf.tpl, sni-map.tpl
|
||||
│ ├── haproxy/ # (Templates liegen jetzt neben Renderer in internal/<svc>/)
|
||||
│ ├── squid/ # squid.conf.tpl
|
||||
│ ├── unbound/ # unbound.conf.tpl
|
||||
│ └── nftables/ # ruleset.nft.tpl
|
||||
|
||||
Reference in New Issue
Block a user