Files
michaelschiemer/.deployment-backup/ansible/wireguard-server/Makefile
Michael Schiemer 9b74ade5b0 feat: Fix discovery system critical issues
Resolved multiple critical discovery system issues:

## Discovery System Fixes
- Fixed console commands not being discovered on first run
- Implemented fallback discovery for empty caches
- Added context-aware caching with separate cache keys
- Fixed object serialization preventing __PHP_Incomplete_Class

## Cache System Improvements
- Smart caching that only caches meaningful results
- Separate caches for different execution contexts (console, web, test)
- Proper array serialization/deserialization for cache compatibility
- Cache hit logging for debugging and monitoring

## Object Serialization Fixes
- Fixed DiscoveredAttribute serialization with proper string conversion
- Sanitized additional data to prevent object reference issues
- Added fallback for corrupted cache entries

## Performance & Reliability
- All 69 console commands properly discovered and cached
- 534 total discovery items successfully cached and restored
- No more __PHP_Incomplete_Class cache corruption
- Improved error handling and graceful fallbacks

## Testing & Quality
- Fixed code style issues across discovery components
- Enhanced logging for better debugging capabilities
- Improved cache validation and error recovery

Ready for production deployment with stable discovery system.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-13 12:04:17 +02:00

112 lines
4.0 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.PHONY: install setup clients add-client remove-client status download-configs ping-test check-service help
# Standardziel
help:
@echo "WireGuard Ansible (vereinfacht, ohne Firewall)"
@echo ""
@echo "Verfügbare Befehle:"
@echo " install - WireGuard installieren"
@echo " setup - Nur WireGuard-Server installieren"
@echo " clients - Client-Konfigurationen erstellen"
@echo " add-client - Neuen Client hinzufügen"
@echo " remove-client - Client entfernen"
@echo " show-clients - Vorhandene Clients anzeigen"
@echo " status - WireGuard-Status anzeigen"
@echo " download-configs - Client-Konfigurationen herunterladen"
@echo " ping-test - Verbindung zum Server testen"
@echo " check-service - Service-Status prüfen"
@echo " logs - WireGuard-Logs anzeigen"
@echo " restart - WireGuard-Service neustarten"
@echo " qr-codes - QR-Codes für alle Clients erstellen"
# WireGuard-Installation
install:
@echo "🚀 Installiere WireGuard (ohne Firewall)..."
ansible-playbook -i inventory/hosts.yml site.yml
# Nur Server-Setup
setup:
@echo "⚙️ Installiere WireGuard-Server..."
ansible-playbook -i inventory/hosts.yml wireguard-install-server.yml
# Client-Konfigurationen erstellen
clients:
@echo "👥 Erstelle Client-Konfigurationen..."
ansible-playbook -i inventory/hosts.yml wireguard-create-config.yml
# Client-Management
add-client:
@echo " Füge neuen Client hinzu..."
ansible-playbook -i inventory/hosts.yml add-client.yml
remove-client:
@echo " Entferne Client..."
ansible-playbook -i inventory/hosts.yml remove-client.yml
show-clients:
@echo "👀 Zeige vorhandene Clients..."
ansible-playbook -i inventory/hosts.yml show-clients.yml
# Status und Überwachung
status:
@echo "📊 WireGuard-Status:"
ansible vpn -i inventory/hosts.yml -m shell -a "wg show"
download-configs:
@echo "📥 Lade Client-Konfigurationen herunter..."
@mkdir -p ./client-configs
ansible vpn -i inventory/hosts.yml -m fetch -a "src=/etc/wireguard/clients/ dest=./client-configs/ flat=true"
@echo "✅ Konfigurationen in ./client-configs/ gespeichert"
ping-test:
@echo "🏓 Teste Verbindung zum Server..."
ansible vpn -i inventory/hosts.yml -m ping
check-service:
@echo "🔍 Prüfe WireGuard-Service..."
ansible vpn -i inventory/hosts.yml -m systemd -a "name=wg-quick@wg0"
logs:
@echo "📋 WireGuard-Logs:"
ansible vpn -i inventory/hosts.yml -m shell -a "journalctl -u wg-quick@wg0 --no-pager -n 20"
restart:
@echo "🔄 Starte WireGuard-Service neu..."
ansible vpn -i inventory/hosts.yml -m systemd -a "name=wg-quick@wg0 state=restarted"
# Client-QR-Codes
qr-codes:
@echo "📱 Erstelle QR-Codes für alle Clients..."
ansible vpn -i inventory/hosts.yml -m shell -a "for conf in /etc/wireguard/clients/*.conf; do echo; echo '=== '$$conf' ==='; qrencode -t ansiutf8 < $$conf; done"
# Backup der Konfiguration
backup:
@echo "💾 Erstelle Backup der WireGuard-Konfiguration..."
@mkdir -p ./backups/$(shell date +%Y%m%d_%H%M%S)
ansible vpn -i inventory/hosts.yml -m fetch -a "src=/etc/wireguard/ dest=./backups/$(shell date +%Y%m%d_%H%M%S)/ flat=true"
@echo "✅ Backup in ./backups/$(shell date +%Y%m%d_%H%M%S)/ erstellt"
# Syntax-Check
check:
@echo "✅ Prüfe Ansible-Syntax..."
ansible-playbook -i inventory/hosts.yml site.yml --syntax-check
ansible-playbook -i inventory/hosts.yml add-client.yml --syntax-check
ansible-playbook -i inventory/hosts.yml remove-client.yml --syntax-check
ansible-playbook -i inventory/hosts.yml show-clients.yml --syntax-check
# Dry-run
dry-run:
@echo "🧪 Dry-run der Installation..."
ansible-playbook -i inventory/hosts.yml site.yml --check --diff
# Netzwerk-Info
network-info:
@echo "🌐 Netzwerk-Informationen:"
ansible vpn -i inventory/hosts.yml -m shell -a "ip addr show wg0"
ansible vpn -i inventory/hosts.yml -m shell -a "ip route | grep wg0"
# Server-Konfiguration anzeigen
server-config:
@echo "📄 Zeige Server-Konfiguration:"
ansible vpn -i inventory/hosts.yml -m shell -a "cat /etc/wireguard/wg0.conf"