🎉 Improved IHK Project Documentation and Logs for smoother installation process 📚💄
This commit is contained in:
parent
690aa8835e
commit
19951ba6e4
@ -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
|
||||
---
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
=================================================================
|
||||
MYP Installation FEHLER Log - 2025-06-03 21:26:54
|
||||
MYP Installation FEHLER Log - 2025-06-03 21:34:03
|
||||
=================================================================
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
=================================================================
|
||||
MYP Installation WARNUNGEN Log - 2025-06-03 21:26:54
|
||||
MYP Installation WARNUNGEN Log - 2025-06-03 21:34:03
|
||||
=================================================================
|
||||
|
||||
|
@ -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
|
||||
=================================================================
|
||||
|
||||
[0;32m[2025-06-03 21:26:54] === MODUS: ROBUSTE ABHÄNGIGKEITEN-INSTALLATION FÜR MANUELLES TESTEN ===[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ Root-Berechtigung bestätigt[0m
|
||||
[0;32m[2025-06-03 21:26:54] === SYSTEM-RESSOURCEN PRÜFUNG ===[0m
|
||||
[0;32m[2025-06-03 21:34:03] === MODUS: ROBUSTE ABHÄNGIGKEITEN-INSTALLATION FÜR MANUELLES TESTEN ===[0m
|
||||
[0;32m[2025-06-03 21:34:03] ✅ Root-Berechtigung bestätigt[0m
|
||||
[0;32m[2025-06-03 21:34:03] === SYSTEM-RESSOURCEN PRÜFUNG ===[0m
|
||||
[0;35m[FORTSCHRITT] Prüfe RAM...[0m
|
||||
[0;35m[FORTSCHRITT] Verfügbarer RAM: 15614MB[0m
|
||||
[0;36m[ERFOLG] ✅ Ausreichend RAM verfügbar (15614MB)[0m
|
||||
@ -16,10 +16,10 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
|
||||
[0;35m[FORTSCHRITT] Prüfe CPU...[0m
|
||||
[0;35m[FORTSCHRITT] CPU: 6 Kern(e) - 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz[0m
|
||||
[0;36m[ERFOLG] ✅ CPU-Information erfolgreich ermittelt[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ System-Ressourcen-Prüfung abgeschlossen[0m
|
||||
[0;32m[2025-06-03 21:34:03] ✅ System-Ressourcen-Prüfung abgeschlossen[0m
|
||||
[0;35m[FORTSCHRITT] Prüfe Debian/Raspbian-System...[0m
|
||||
[0;34m[DEBUG] Debian erkannt über /etc/debian_version: 12.11[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ Debian/Raspbian-basiertes System erkannt (Version: 12.11)[0m
|
||||
[0;32m[2025-06-03 21:34:03] ✅ Debian/Raspbian-basiertes System erkannt (Version: 12.11)[0m
|
||||
[0;35m[FORTSCHRITT] Prüfe Raspberry Pi Hardware...[0m
|
||||
[0;34m[INFO] 💻 Standard-PC/Server System (kein Raspberry Pi)[0m
|
||||
[0;34m[DEBUG] Kein Raspberry Pi erkannt. Hardware-Info:[0m
|
||||
@ -31,7 +31,7 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
|
||||
[0;35m[FORTSCHRITT] Prüfe Kernel-Version...[0m
|
||||
[0;34m[INFO] 🐧 Kernel-Version: 6.1.0-37-amd64[0m
|
||||
[0;34m[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[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ System-Analyse abgeschlossen[0m
|
||||
[0;32m[2025-06-03 21:34:03] ✅ System-Analyse abgeschlossen[0m
|
||||
[0;35m[FORTSCHRITT] Prüfe Internetverbindung (erweiterte Methoden)...[0m
|
||||
[0;35m[FORTSCHRITT] Teste DNS-Auflösung...[0m
|
||||
[0;34m[DEBUG] DNS-Test Details: Teste DNS für 8.8.8.8: Erfolg mit nslookup. [0m
|
||||
@ -40,5 +40,5 @@ System: Linux raspberrypi 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1
|
||||
[0;35m[FORTSCHRITT] Ermittle externe IP-Adresse...[0m
|
||||
[0;34m[INFO] 🌐 Externe IP: 163.116.179.142[0m
|
||||
[0;34m[DEBUG] Externe IP ermittelt über ifconfig.me: 163.116.179.142[0m
|
||||
[0;32m[2025-06-03 21:26:56] === KONFIGURIERE HOSTNAME ===[0m
|
||||
[0;32m[2025-06-03 21:26:56] ✅ Hostname bereits korrekt: 'raspberrypi'[0m
|
||||
[0;32m[2025-06-03 21:34:04] === KONFIGURIERE HOSTNAME ===[0m
|
||||
[0;32m[2025-06-03 21:34:04] ✅ Hostname bereits korrekt: 'raspberrypi'[0m
|
||||
|
135
backend/setup.sh
135
backend/setup.sh
@ -1890,65 +1890,82 @@ EOF
|
||||
debug "WSL-Umgebung erkannt - verwende angepasste Bash-Profile-Logik"
|
||||
fi
|
||||
|
||||
# Definiere die zu prüfenden Verzeichnisse basierend auf der Umgebung
|
||||
local home_dirs=()
|
||||
if [ "$is_wsl" = true ]; then
|
||||
# In WSL nur das aktuelle Benutzerverzeichnis verwenden
|
||||
if [ -n "${HOME:-}" ] && [ -d "$HOME" ]; then
|
||||
home_dirs=("$HOME")
|
||||
fi
|
||||
# Füge /root nur hinzu wenn wir als root laufen
|
||||
if [ "$(id -u)" = "0" ] && [ -d "/root" ] && [ -w "/root" ]; then
|
||||
home_dirs+=("/root")
|
||||
fi
|
||||
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
|
||||
home_dirs+=("$user_home")
|
||||
fi
|
||||
done < <(find /home -maxdepth 1 -type d -print0 2>/dev/null | head -20)
|
||||
fi
|
||||
# Definiere die zu prüfenden Verzeichnisse basierend auf der Umgebung
|
||||
local home_dirs=()
|
||||
if [ "$is_wsl" = true ]; then
|
||||
# In WSL nur das aktuelle Benutzerverzeichnis verwenden
|
||||
if [ -n "${HOME:-}" ] && [ -d "$HOME" ]; then
|
||||
home_dirs=("$HOME")
|
||||
fi
|
||||
# Füge /root nur hinzu wenn wir als root laufen
|
||||
if [ "$(id -u)" = "0" ] && [ -d "/root" ] && [ -w "/root" ]; then
|
||||
home_dirs+=("/root")
|
||||
fi
|
||||
else
|
||||
# Standard-Verhalten für echtes Linux
|
||||
home_dirs=("/root")
|
||||
# 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
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Aktualisiere Bash-Profile mit Timeout
|
||||
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"
|
||||
else
|
||||
# Schreibe mit timeout und prüfe Erfolg
|
||||
if timeout 5s bash -c "cat >> '$user_home/.bashrc' << 'EOF'
|
||||
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
|
||||
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
|
||||
# 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
|
||||
((profile_updated++))
|
||||
log "✅ Bash-Profile aktualisiert: $user_home/.bashrc"
|
||||
else
|
||||
warning "⚠️ Konnte Bash-Profile nicht aktualisieren: $user_home/.bashrc"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
debug "Überspringe nicht-existierendes/unlesbares .bashrc: $user_home/.bashrc"
|
||||
fi
|
||||
else
|
||||
debug "Überspringe nicht-schreibbares Verzeichnis: $user_home"
|
||||
fi
|
||||
done
|
||||
EOF
|
||||
|
||||
# Füge Inhalt hinzu
|
||||
if cat "$temp_file" >> "$bashrc_file" 2>/dev/null; then
|
||||
((profile_updated++))
|
||||
log "✅ Bash-Profile aktualisiert: $bashrc_file"
|
||||
else
|
||||
warning "⚠️ Konnte Bash-Profile nicht aktualisieren: $bashrc_file"
|
||||
fi
|
||||
|
||||
# Aufräumen
|
||||
rm -f "$temp_file" 2>/dev/null || true
|
||||
fi
|
||||
else
|
||||
debug ".bashrc existiert nicht: $bashrc_file"
|
||||
fi
|
||||
else
|
||||
debug "Verzeichnis nicht schreibbar: $user_home"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $profile_updated -eq 0 ] && [ "$is_wsl" = false ]; then
|
||||
warning "⚠️ Keine Bash-Profile wurden aktualisiert"
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user