feat: improve WireGuard client management and framework initialization
- Improve WireGuard client IP calculation logic (find next available IP) - Add local wireguard-clients directory for storing client configs - Integrate Redis pool into CacheInitializer - Improve ContainerBootstrapper with better imports and Redis pool - Add monitoring role tags for better task organization - Update WireGuard documentation - Store generated WireGuard client configs locally
This commit is contained in:
@@ -38,6 +38,24 @@ Folgende Dienste sollen später nur noch über VPN erreichbar sein:
|
||||
- Aktuell: `https://portainer.michaelschiemer.de` (öffentlich)
|
||||
- Zukünftig: Nur `https://10.8.0.1:9443` über VPN
|
||||
|
||||
## Aktueller Test: Grafana nur per VPN
|
||||
|
||||
- Realisiert über Traefik-IP-Whitelist (`grafana-vpn-only` Middleware)
|
||||
- Whitelist-Wert: `MONITORING_VPN_IP_WHITELIST` in `deployment/stacks/monitoring/.env` (Ansible default `monitoring_vpn_ip_whitelist`)
|
||||
- Ziel: Erst Grafana absichern, später Prometheus/Portainer nachziehen
|
||||
|
||||
### Rollout-Schritte
|
||||
1. Neue Stacks auf den Server syncen: \
|
||||
`ansible-playbook -i inventory/production.yml playbooks/sync-stacks.yml`
|
||||
2. Monitoring-Rolle komplett laufen lassen (die `.env` muss generiert werden): \
|
||||
`ansible-playbook -i inventory/production.yml playbooks/setup-infrastructure.yml --tags monitoring`
|
||||
3. Prüfen, dass `monitoring_stack_changed` in der Zusammenfassung `true` ist oder der Grafana-Container neu gestartet wurde
|
||||
|
||||
### Verifikation
|
||||
- Ohne VPN (öffentliche IP): `curl -I https://grafana.michaelschiemer.de` → `403 Forbidden`
|
||||
- Mit WireGuard (`10.8.0.x` Client): Grafana im Browser laden, Login funktioniert
|
||||
- Optional: Traefik-Logs prüfen (`docker compose -f ~/deployment/stacks/traefik/docker-compose.yml logs -f traefik`) für geblockte IPs
|
||||
|
||||
---
|
||||
|
||||
## Geplante Implementierungsschritte
|
||||
@@ -210,4 +228,4 @@ Nach der Umsetzung sollte aktualisiert werden:
|
||||
|
||||
---
|
||||
|
||||
**Hinweis**: Diese Härtung wird erst durchgeführt, wenn das VPN stabil läuft und alle notwendigen Clients konfiguriert sind.
|
||||
**Hinweis**: Diese Härtung wird erst durchgeführt, wenn das VPN stabil läuft und alle notwendigen Clients konfiguriert sind.
|
||||
|
||||
@@ -488,6 +488,10 @@ ansible-playbook -i inventory/production.yml playbooks/add-wireguard-client.yml
|
||||
|
||||
**Dokumentation**: Siehe `deployment/ansible/playbooks/README-WIREGUARD.md`
|
||||
|
||||
> Nach dem Lauf liegt die Client-Konfiguration zusätzlich lokal im Repository unter
|
||||
> `deployment/ansible/wireguard-clients/<client_name>.conf` – ideal zum direkten
|
||||
> Import auf deinem Admin-Rechner (Datei bleibt mit `chmod 600` geschützt).
|
||||
|
||||
---
|
||||
|
||||
## Verzeichnisstruktur
|
||||
@@ -555,4 +559,4 @@ Bei Problemen:
|
||||
---
|
||||
|
||||
**Zuletzt aktualisiert**: 2025-10-31
|
||||
**Version**: 1.0
|
||||
**Version**: 1.0
|
||||
|
||||
Reference in New Issue
Block a user