🎉 Improved IHK Project Documentation and Logs for smoother installation process 📚💄

This commit is contained in:
Till Tomczak 2025-06-03 21:34:13 +02:00
parent 690aa8835e
commit 19951ba6e4
5 changed files with 101 additions and 72 deletions

View File

@ -1,32 +1,32 @@
=================================================================
MYP Installation DEBUG Log - 2025-06-03 21:26:54
MYP Installation DEBUG Log - 2025-06-03 21:34:03
=================================================================
[2025-06-03 21:26:54] DEBUG von setup.sh:485
[2025-06-03 21:34:03] DEBUG von setup.sh:485
Debian erkannt über /etc/debian_version: 12.11
---
[2025-06-03 21:26:54] DEBUG von setup.sh:553
[2025-06-03 21:34:03] DEBUG von setup.sh:553
Kein Raspberry Pi erkannt. Hardware-Info:
---
[2025-06-03 21:26:54] DEBUG von setup.sh:554
[2025-06-03 21:34:03] DEBUG von setup.sh:554
- Device Tree: nicht verfügbar
---
[2025-06-03 21:26:54] DEBUG von setup.sh:555
[2025-06-03 21:34:03] DEBUG von setup.sh:555
- CPU Hardware: nicht verfügbar
---
[2025-06-03 21:26:54] DEBUG von setup.sh:595
[2025-06-03 21:34:03] DEBUG von setup.sh:595
Vollständige Kernel-Info: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
---
[2025-06-03 21:26:56] DEBUG von setup.sh:651
[2025-06-03 21:34:03] DEBUG von setup.sh:651
DNS-Test Details: Teste DNS für 8.8.8.8: Erfolg mit nslookup.
---
[2025-06-03 21:26:56] DEBUG von setup.sh:752
[2025-06-03 21:34:04] DEBUG von setup.sh:752
Externe IP ermittelt über ifconfig.me: 163.116.179.142
---

View File

@ -1,4 +1,4 @@
=================================================================
MYP Installation FEHLER Log - 2025-06-03 21:26:54
MYP Installation FEHLER Log - 2025-06-03 21:34:03
=================================================================

View File

@ -1,4 +1,4 @@
=================================================================
MYP Installation WARNUNGEN Log - 2025-06-03 21:26:54
MYP Installation WARNUNGEN Log - 2025-06-03 21:34:03
=================================================================

View File

@ -1,12 +1,12 @@
=================================================================
MYP Installation Log - 2025-06-03 21:26:54
MYP Installation Log - 2025-06-03 21:34:03
Script Version: 4.1.0
System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
=================================================================
[2025-06-03 21:26:54] === MODUS: ROBUSTE ABHÄNGIGKEITEN-INSTALLATION FÜR MANUELLES TESTEN ===
[2025-06-03 21:26:54] ✅ Root-Berechtigung bestätigt
[2025-06-03 21:26:54] === SYSTEM-RESSOURCEN PRÜFUNG ===
[2025-06-03 21:34:03] === MODUS: ROBUSTE ABHÄNGIGKEITEN-INSTALLATION FÜR MANUELLES TESTEN ===
[2025-06-03 21:34:03] ✅ Root-Berechtigung bestätigt
[2025-06-03 21:34:03] === SYSTEM-RESSOURCEN PRÜFUNG ===
[FORTSCHRITT] Prüfe RAM...
[FORTSCHRITT] Verfügbarer RAM: 15614MB
[ERFOLG] ✅ Ausreichend RAM verfügbar (15614MB)
@ -16,10 +16,10 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
[FORTSCHRITT] Prüfe CPU...
[FORTSCHRITT] CPU: 6 Kern(e) - 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
[ERFOLG] ✅ CPU-Information erfolgreich ermittelt
[2025-06-03 21:26:54] ✅ System-Ressourcen-Prüfung abgeschlossen
[2025-06-03 21:34:03] ✅ System-Ressourcen-Prüfung abgeschlossen
[FORTSCHRITT] Prüfe Debian/Raspbian-System...
[DEBUG] Debian erkannt über /etc/debian_version: 12.11
[2025-06-03 21:26:54] ✅ Debian/Raspbian-basiertes System erkannt (Version: 12.11)
[2025-06-03 21:34:03] ✅ Debian/Raspbian-basiertes System erkannt (Version: 12.11)
[FORTSCHRITT] Prüfe Raspberry Pi Hardware...
[INFO] 💻 Standard-PC/Server System (kein Raspberry Pi)
[DEBUG] Kein Raspberry Pi erkannt. Hardware-Info:
@ -31,7 +31,7 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
[FORTSCHRITT] Prüfe Kernel-Version...
[INFO] 🐧 Kernel-Version: 6.1.0-37-amd64
[DEBUG] Vollständige Kernel-Info: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
[2025-06-03 21:26:54] ✅ System-Analyse abgeschlossen
[2025-06-03 21:34:03] ✅ System-Analyse abgeschlossen
[FORTSCHRITT] Prüfe Internetverbindung (erweiterte Methoden)...
[FORTSCHRITT] Teste DNS-Auflösung...
[DEBUG] DNS-Test Details: Teste DNS für 8.8.8.8: Erfolg mit nslookup. 
@ -40,5 +40,5 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
[FORTSCHRITT] Ermittle externe IP-Adresse...
[INFO] 🌐 Externe IP: 163.116.179.142
[DEBUG] Externe IP ermittelt über ifconfig.me: 163.116.179.142
[2025-06-03 21:26:56] === KONFIGURIERE HOSTNAME ===
[2025-06-03 21:26:56] ✅ Hostname bereits korrekt: 'raspberrypi'
[2025-06-03 21:34:04] === KONFIGURIERE HOSTNAME ===
[2025-06-03 21:34:04] ✅ Hostname bereits korrekt: 'raspberrypi'

View File

@ -1904,49 +1904,66 @@ EOF
else
# Standard-Verhalten für echtes Linux
home_dirs=("/root")
# Füge alle Home-Verzeichnisse hinzu, aber mit Timeout
while IFS= read -r -d '' user_home; do
if [ "$user_home" != "/home/lost+found" ]; then
# Füge nur existierende Home-Verzeichnisse hinzu (max 5)
local count=0
for user_home in /home/*; do
if [ -d "$user_home" ] && [ "$user_home" != "/home/lost+found" ]; then
home_dirs+=("$user_home")
((count++))
if [ $count -ge 5 ]; then
debug "Limitiere auf 5 Home-Verzeichnisse"
break
fi
done < <(find /home -maxdepth 1 -type d -print0 2>/dev/null | head -20)
fi
done
fi
# Aktualisiere Bash-Profile mit Timeout
debug "Aktualisiere Bash-Profile für ${#home_dirs[@]} Verzeichnisse"
# Aktualisiere Bash-Profile (vereinfacht)
for user_home in "${home_dirs[@]}"; do
if [ -d "$user_home" ] && [ -w "$user_home" ]; then
# Prüfe ob .bashrc existiert und lesbar ist
if [ -f "$user_home/.bashrc" ] && [ -r "$user_home/.bashrc" ]; then
# Verwende timeout um hängende Operationen zu vermeiden
if timeout 5s grep -q "MYP Application Environment" "$user_home/.bashrc" 2>/dev/null; then
debug "Bash-Profile bereits konfiguriert: $user_home/.bashrc"
local bashrc_file="$user_home/.bashrc"
# Prüfe ob .bashrc existiert
if [ -f "$bashrc_file" ]; then
# Prüfe ob bereits konfiguriert (ohne timeout)
if grep -q "MYP Application Environment" "$bashrc_file" 2>/dev/null; then
debug "Bash-Profile bereits konfiguriert: $bashrc_file"
else
# Schreibe mit timeout und prüfe Erfolg
if timeout 5s bash -c "cat >> '$user_home/.bashrc' << 'EOF'
# Erstelle temporäre Datei mit dem Inhalt
local temp_file="/tmp/myp_bashrc_addition_$$"
cat > "$temp_file" << 'EOF'
# MYP Application Environment
if [ -d \"/opt/myp\" ]; then
export MYP_APP_DIR=\"/opt/myp\"
export FLASK_APP=\"/opt/myp/app.py\"
export FLASK_ENV=\"production\"
if [ -z \"\${PYTHONPATH:-}\" ]; then
export PYTHONPATH=\"/opt/myp\"
if [ -d "/opt/myp" ]; then
export MYP_APP_DIR="/opt/myp"
export FLASK_APP="/opt/myp/app.py"
export FLASK_ENV="production"
if [ -z "${PYTHONPATH:-}" ]; then
export PYTHONPATH="/opt/myp"
else
export PYTHONPATH=\"/opt/myp:\$PYTHONPATH\"
export PYTHONPATH="/opt/myp:$PYTHONPATH"
fi
fi
EOF" 2>/dev/null; then
EOF
# Füge Inhalt hinzu
if cat "$temp_file" >> "$bashrc_file" 2>/dev/null; then
((profile_updated++))
log "✅ Bash-Profile aktualisiert: $user_home/.bashrc"
log "✅ Bash-Profile aktualisiert: $bashrc_file"
else
warning "⚠️ Konnte Bash-Profile nicht aktualisieren: $user_home/.bashrc"
warning "⚠️ Konnte Bash-Profile nicht aktualisieren: $bashrc_file"
fi
# Aufräumen
rm -f "$temp_file" 2>/dev/null || true
fi
else
debug "Überspringe nicht-existierendes/unlesbares .bashrc: $user_home/.bashrc"
debug ".bashrc existiert nicht: $bashrc_file"
fi
else
debug "Überspringe nicht-schreibbares Verzeichnis: $user_home"
debug "Verzeichnis nicht schreibbar: $user_home"
fi
done
@ -2042,6 +2059,12 @@ generate_ssl_certificate() {
install_systemd_services() {
log "=== ROBUSTE SYSTEMD-SERVICES INSTALLATION ==="
# Skip wenn Parameter gesetzt
if [ "$SKIP_SYSTEMD" = true ]; then
log "⏭️ Systemd-Service Installation übersprungen (--skip-systemd oder --wsl/--dev)"
return
fi
# Validiere systemd-Verzeichnis
if [ ! -d "$SYSTEMD_DIR" ]; then
error "systemd-Verzeichnis nicht gefunden: $SYSTEMD_DIR"
@ -2124,6 +2147,12 @@ install_systemd_services() {
enable_and_start_services() {
log "=== ROBUSTE SERVICES AKTIVIERUNG UND START ==="
# Skip wenn Parameter gesetzt
if [ "$SKIP_SYSTEMD" = true ]; then
log "⏭️ Service-Aktivierung übersprungen (--skip-systemd oder --wsl/--dev)"
return
fi
# Service-Status tracking
local successful_services=0
local failed_services=0