Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,81 @@
# Production Server Setup - Debian 12
## Netcup Panel Konfiguration
### 1. Fresh OS Installation
1. **Netcup Panel** → "Server" → Ihr Server
2. **"Betriebssystem"** → "Neu installieren"
3. **OS wählen**: `Debian 12 (Bookworm)` 64-bit
4. **Installation starten** und warten bis abgeschlossen
### 2. SSH-Key Konfiguration
1. **SSH-Key hinzufügen**:
```
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA3DqB1B4wa5Eo116bJ1HybFagK3fU0i+wJ6mAHI1L3i production@michaelschiemer.de
```
2. **Im Netcup Panel**:
- "SSH-Keys" → "Neuen SSH-Key hinzufügen"
- Name: `production-michaelschiemer`
- Key: (oben kopieren und einfügen)
- Key dem Server zuweisen
### 3. Root-Zugang aktivieren
1. **Console/KVM** über Netcup Panel öffnen
2. **Als root einloggen** (initial Setup)
3. **SSH-Key für root aktivieren**:
```bash
# SSH-Key bereits durch Panel hinzugefügt
# Root SSH sollte funktionieren
```
### 4. Deploy User einrichten
```bash
# Als root ausführen:
useradd -m -s /bin/bash deploy
usermod -aG sudo deploy
# SSH-Key für deploy user
mkdir -p /home/deploy/.ssh
cp /root/.ssh/authorized_keys /home/deploy/.ssh/
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys
# Sudo ohne Passwort für deploy
echo "deploy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/deploy
```
## Warum Debian 12?
### Production-Vorteile:
- ✅ **Stabilität**: Bewährte LTS-Pakete, längere Support-Zyklen
- ✅ **Performance**: Geringerer Ressourcenverbrauch als Ubuntu
- ✅ **Security**: Conservative Updates, weniger experimentelle Features
- ✅ **Docker-Optimiert**: Perfekt für containerisierte Deployments
- ✅ **Minimale Basis**: Nur essentielle Pakete, weniger Attack Surface
### Server-Spezifikationen:
- **RAM**: Minimum 2GB (empfohlen 4GB+)
- **Storage**: Minimum 20GB SSD
- **CPU**: 1+ vCPU (empfohlen 2+ vCPU)
- **Network**: Stable internet, static IP
## Nach Installation testen:
```bash
# SSH-Connectivity Test
ssh -i ~/.ssh/production deploy@94.16.110.151
# System Info
ssh -i ~/.ssh/production deploy@94.16.110.151 'uname -a && lsb_release -a'
```
## Nächste Schritte:
Nach erfolgreichem Server-Setup:
1. SSH-Connectivity bestätigen
2. Ansible Ping-Test durchführen
3. Deployment-Playbook ausführen
---
**🔑 SSH-Key Fingerprint**: `SHA256:7FBYrZpDcYcKXpeM8OHoGZZBHwxNORoOFWuzP2MpDpQ`

View File

@@ -6,7 +6,7 @@ all:
netcup-server:
ansible_host: 94.16.110.151
ansible_user: deploy
ansible_ssh_private_key_file: /home/michael/.ssh/staging
ansible_ssh_private_key_file: /home/michael/.ssh/production
# Server-Details
domain: "test.michaelschiemer.de"
@@ -22,5 +22,37 @@ all:
# Umgebungsvariablen für deine App (wird in .env geschrieben)
app_env:
APP_ENV: "production"
DATABASE_URL: "sqlite:///app/data/app.db"
# Füge hier weitere ENV-Variablen hinzu die deine App braucht
APP_DEBUG: "false"
APP_NAME: "Michael Schiemer"
APP_KEY: "base64:kJH8fsd89fs8df7sdf8sdf7sd8f7sdf"
APP_TIMEZONE: "Europe/Berlin"
APP_LOCALE: "de"
# Database (Docker internal)
DB_DRIVER: "mysql"
DB_HOST: "db"
DB_PORT: "3306"
DB_DATABASE: "michaelschiemer"
DB_USERNAME: "mdb-user"
DB_PASSWORD: "StartSimple2024!"
DB_CHARSET: "utf8mb4"
# Security
SECURITY_ALLOWED_HOSTS: "localhost,test.michaelschiemer.de,michaelschiemer.de"
SECURITY_RATE_LIMIT_PER_MINUTE: "60"
SECURITY_RATE_LIMIT_BURST: "10"
SESSION_LIFETIME: "1800"
# SSL/HTTPS
APP_SSL_PORT: "443"
FORCE_HTTPS: "true"
# Docker Settings
COMPOSE_PROJECT_NAME: "framework-production"
UID: "1000"
GID: "1000"
# Performance
OPCACHE_ENABLED: "true"
REDIS_HOST: "redis"
REDIS_PORT: "6379"

View File

@@ -0,0 +1,75 @@
#!/bin/bash
# Test Production Server Connectivity
set -e
SERVER="94.16.110.151"
USER="deploy"
SSH_KEY="~/.ssh/production"
echo "🔧 Production Server Connectivity Test"
echo "========================================"
echo "Server: $SERVER"
echo "User: $USER"
echo "SSH-Key: $SSH_KEY"
echo ""
# 1. SSH Key Test
echo "1⃣ SSH-Key Test..."
if ssh-keygen -l -f $SSH_KEY.pub &>/dev/null; then
echo "✅ SSH-Key ist gültig"
ssh-keygen -l -f $SSH_KEY.pub
else
echo "❌ SSH-Key Problem"
exit 1
fi
echo ""
# 2. SSH Connectivity Test
echo "2⃣ SSH Connectivity Test..."
if ssh -i $SSH_KEY -o ConnectTimeout=10 -o StrictHostKeyChecking=no $USER@$SERVER 'echo "SSH Connection successful"' 2>/dev/null; then
echo "✅ SSH Connection erfolgreich"
else
echo "❌ SSH Connection fehlgeschlagen"
echo "Möglicherweise ist der Server noch nicht bereit oder SSH-Key nicht konfiguriert"
exit 1
fi
echo ""
# 3. System Info
echo "3⃣ Server System Information..."
ssh -i $SSH_KEY $USER@$SERVER 'echo "Hostname: $(hostname)" && echo "OS: $(cat /etc/os-release | grep PRETTY_NAME)" && echo "Kernel: $(uname -r)" && echo "Uptime: $(uptime -p)" && echo "Available space: $(df -h / | tail -1 | awk "{print \$4}")"'
echo ""
# 4. Docker Readiness Check
echo "4⃣ Docker Readiness Check..."
if ssh -i $SSH_KEY $USER@$SERVER 'which docker &>/dev/null && which docker-compose &>/dev/null'; then
echo "✅ Docker bereits installiert"
ssh -i $SSH_KEY $USER@$SERVER 'docker --version && docker-compose --version'
else
echo "⚠️ Docker noch nicht installiert (wird durch Ansible installiert)"
fi
echo ""
# 5. Ansible Ping Test
echo "5⃣ Ansible Ping Test..."
cd "$(dirname "$0")"
if ansible netcup-server -i inventory/hosts.yml -m ping; then
echo "✅ Ansible Ping erfolgreich"
else
echo "❌ Ansible Ping fehlgeschlagen"
exit 1
fi
echo ""
# 6. Ansible Gather Facts
echo "6⃣ Ansible System Facts..."
ansible netcup-server -i inventory/hosts.yml -m setup -a "filter=ansible_distribution*" | grep -A 10 '"ansible_distribution"'
echo ""
echo "🎉 Connectivity Test erfolgreich abgeschlossen!"
echo ""
echo "Nächste Schritte:"
echo "1. Deployment-Playbook ausführen: ansible-playbook -i inventory/hosts.yml deploy.yml"
echo "2. SSL-Zertifikate konfigurieren"
echo "3. Monitoring einrichten"