Files
michaelschiemer/.deployment-backup/ansible/nginx-cdn-germany/SETUP.md
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

2.0 KiB

SETUP.md - Einrichtungsanleitung

1. Vorbereitung

Server vorbereiten

# Für jeden CDN-Server (als root):
apt update && apt upgrade -y
apt install -y python3 python3-pip

SSH-Keys einrichten

# Auf deinem lokalen Rechner:
ssh-keygen -t rsa -b 4096 -C "cdn-deployment"
ssh-copy-id root@cdn-fra1.example.de
ssh-copy-id root@cdn-ham1.example.de
ssh-copy-id root@cdn-muc1.example.de

2. Konfiguration anpassen

Domains und IPs ändern

# 1. Server-IPs eintragen
vim inventories/production/hosts.yml

# 2. Domain-Namen anpassen  
vim inventories/production/group_vars/all/main.yml

Wichtig: Ändere diese Werte:

  • cdn_domain: "cdn.example.de" → deine CDN-Domain
  • ssl_email: "admin@example.de" → deine E-Mail
  • origin_domain: "www.example.de" → deine Website
  • Alle IP-Adressen in hosts.yml

3. DNS konfigurieren

Bevor du deployest, stelle sicher dass deine CDN-Domain zu den Servern zeigt:

# A-Records für deine CDN-Domain:
cdn.example.de. IN A 10.0.1.10  # Frankfurt
cdn.example.de. IN A 10.0.2.10  # Hamburg  
cdn.example.de. IN A 10.0.3.10  # München

4. Deployment

# Testen
make check

# Deployen
make deploy

# Health-Check
make health

5. Testen

# CDN testen
curl -I https://cdn.example.de/health

# Cache-Header prüfen
curl -I https://cdn.example.de/some-static-file.css

# Performance testen
time curl -o /dev/null -s https://cdn.example.de/

6. Wartung

# Cache leeren
make purge-cache

# Status prüfen  
make status

# SSL erneuern
make renew-ssl

# Interaktive Verwaltung
make manage

Troubleshooting

Ansible-Verbindung testen

ansible all -m ping

Nginx-Konfiguration prüfen

ansible cdn_nodes -m shell -a "nginx -t"

Logs anschauen

ansible cdn_nodes -m shell -a "tail -f /var/log/nginx/error.log"

SSL-Probleme

# SSL-Status prüfen
ansible cdn_nodes -m shell -a "certbot certificates"

# Manuell erneuern
ansible cdn_nodes -m shell -a "certbot renew --force-renewal"