📚 Improved IHK Projektdokumentation and logs for better clarity & error handling in backend installation process. 🖥️🔍
This commit is contained in:
@ -1,72 +1,32 @@
|
||||
=================================================================
|
||||
MYP Installation DEBUG Log - 2025-06-03 20:57:58
|
||||
MYP Installation DEBUG Log - 2025-06-03 21:26:54
|
||||
=================================================================
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:449
|
||||
[2025-06-03 21:26:54] DEBUG von setup.sh:485
|
||||
Debian erkannt über /etc/debian_version: 12.11
|
||||
---
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:517
|
||||
[2025-06-03 21:26:54] DEBUG von setup.sh:553
|
||||
Kein Raspberry Pi erkannt. Hardware-Info:
|
||||
---
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:518
|
||||
[2025-06-03 21:26:54] DEBUG von setup.sh:554
|
||||
- Device Tree: nicht verfügbar
|
||||
---
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:519
|
||||
[2025-06-03 21:26:54] DEBUG von setup.sh:555
|
||||
- CPU Hardware: nicht verfügbar
|
||||
---
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:559
|
||||
Vollständige Kernel-Info: Linux debian 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] 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 20:57:58] DEBUG von setup.sh:615
|
||||
[2025-06-03 21:26:56] DEBUG von setup.sh:651
|
||||
DNS-Test Details: Teste DNS für 8.8.8.8: Erfolg mit nslookup.
|
||||
---
|
||||
|
||||
[2025-06-03 20:57:58] DEBUG von setup.sh:716
|
||||
[2025-06-03 21:26:56] DEBUG von setup.sh:752
|
||||
Externe IP ermittelt über ifconfig.me: 163.116.179.142
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1132
|
||||
sysctl-Konfiguration erstellt: /etc/sysctl.d/99-myp-security.conf
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1188
|
||||
Sysctl-Phase abgeschlossen - fahre mit Installation fort
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1214
|
||||
systemd-networkd nicht aktiv - überspringe
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1240
|
||||
NetworkManager nicht aktiv - überspringe
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1246
|
||||
IPv6 Einträge in /etc/hosts auskommentiert
|
||||
---
|
||||
|
||||
[2025-06-03 20:58:45] DEBUG von setup.sh:1263
|
||||
Netzwerk-Sicherheit ohne Blockierung abgeschlossen
|
||||
---
|
||||
|
||||
[2025-06-03 21:02:02] DEBUG von setup.sh:1569
|
||||
SSL-Verzeichnis erstellt: /usr/local/share/ca-certificates/myp
|
||||
---
|
||||
|
||||
[2025-06-03 21:02:07] DEBUG von setup.sh:1677
|
||||
SSL-Konfiguration abgeschlossen ohne hängende Prozesse
|
||||
---
|
||||
|
||||
[2025-06-03 21:02:50] DEBUG von setup.sh:962
|
||||
flask erfolgreich importiert
|
||||
---
|
||||
|
||||
[2025-06-03 21:02:50] DEBUG von setup.sh:962
|
||||
requests erfolgreich importiert
|
||||
---
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
=================================================================
|
||||
MYP Installation FEHLER Log - 2025-06-03 20:57:58
|
||||
MYP Installation FEHLER Log - 2025-06-03 21:26:54
|
||||
=================================================================
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
=================================================================
|
||||
MYP Installation WARNUNGEN Log - 2025-06-03 20:57:58
|
||||
MYP Installation WARNUNGEN Log - 2025-06-03 21:26:54
|
||||
=================================================================
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
=================================================================
|
||||
MYP Installation Log - 2025-06-03 20:57:58
|
||||
MYP Installation Log - 2025-06-03 21:26:54
|
||||
Script Version: 4.1.0
|
||||
System: Linux debian 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux
|
||||
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 20:57:58] === MODUS: ROBUSTE ABHÄNGIGKEITEN-INSTALLATION FÜR MANUELLES TESTEN ===[0m
|
||||
[0;32m[2025-06-03 20:57:58] ✅ Root-Berechtigung bestätigt[0m
|
||||
[0;32m[2025-06-03 20:57:58] === SYSTEM-RESSOURCEN PRÜFUNG ===[0m
|
||||
[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;35m[FORTSCHRITT] Prüfe RAM...[0m
|
||||
[0;35m[FORTSCHRITT] Verfügbarer RAM: 15614MB[0m
|
||||
[0;36m[ERFOLG] ✅ Ausreichend RAM verfügbar (15614MB)[0m
|
||||
[0;35m[FORTSCHRITT] Prüfe Festplattenplatz...[0m
|
||||
[0;35m[FORTSCHRITT] Verfügbarer Festplattenplatz: 13,2GB (13473MB)[0m
|
||||
[0;36m[ERFOLG] ✅ Ausreichend Festplattenplatz verfügbar (13,2GB)[0m
|
||||
[0;35m[FORTSCHRITT] Verfügbarer Festplattenplatz: 12,2GB (12473MB)[0m
|
||||
[0;36m[ERFOLG] ✅ Ausreichend Festplattenplatz verfügbar (12,2GB)[0m
|
||||
[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 20:57:58] ✅ System-Ressourcen-Prüfung abgeschlossen[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ 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 20:57:58] ✅ Debian/Raspbian-basiertes System erkannt (Version: 12.11)[0m
|
||||
[0;32m[2025-06-03 21:26:54] ✅ 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
|
||||
@ -30,8 +30,8 @@ System: Linux debian 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (202
|
||||
[0;34m[INFO] → 64-Bit x86 Architektur erkannt[0m
|
||||
[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 debian 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 20:57:58] ✅ System-Analyse abgeschlossen[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;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,158 +40,5 @@ System: Linux debian 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (202
|
||||
[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 20:57:58] === KONFIGURIERE HOSTNAME ===[0m
|
||||
[0;35m[FORTSCHRITT] Setze Hostname von 'debian' auf 'raspberrypi'...[0m
|
||||
[0;32m[2025-06-03 20:57:58] ✅ Hostname erfolgreich auf 'raspberrypi' gesetzt[0m
|
||||
[0;32m[2025-06-03 20:58:09] ✅ Hostname-Auflösung funktioniert: raspberrypi -> 127.0.1.1[0m
|
||||
[0;32m[2025-06-03 20:58:09] === ROBUSTE SYSTEM-UPDATE ===[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere APT für bessere Zuverlässigkeit...[0m
|
||||
[0;35m[FORTSCHRITT] Validiere APT-Repositories...[0m
|
||||
[0;32m[2025-06-03 20:58:09] ✅ Source-Repositories deaktiviert (nicht benötigt)[0m
|
||||
[0;35m[FORTSCHRITT] Aktualisiere Paketlisten mit Retry...[0m
|
||||
[0;35m[FORTSCHRITT] Führe System-Upgrade durch...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere essenzielle System-Tools...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: ca-certificates[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: gnupg[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: curl[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: wget[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: git[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: nano[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: htop[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: rsync[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: unzip[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: sudo[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: systemd[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: lsb-release[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: apt-transport-https[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: software-properties-common[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: bc[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: dbus[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: systemd-timesyncd[0m
|
||||
[0;35m[FORTSCHRITT] Synchronisiere Systemzeit...[0m
|
||||
[0;32m[2025-06-03 20:58:40] ✅ Robustes System-Update abgeschlossen[0m
|
||||
[0;32m[2025-06-03 20:58:40] === KONFIGURIERE OPTIONALE NETZWERK-SICHERHEIT ===[0m
|
||||
[0;35m[FORTSCHRITT] Deaktiviere IPv6 (robust)...[0m
|
||||
[0;35m[FORTSCHRITT] Deaktiviere IPv6 in GRUB...[0m
|
||||
[0;36m[ERFOLG] ✅ IPv6 in GRUB deaktiviert[0m
|
||||
[0;35m[FORTSCHRITT] Erstelle robuste sysctl-Konfiguration...[0m
|
||||
[0;36m[ERFOLG] ✅ Basis-sysctl-Konfiguration erstellt[0m
|
||||
[0;34m[DEBUG] sysctl-Konfiguration erstellt: /etc/sysctl.d/99-myp-security.conf[0m
|
||||
[0;35m[FORTSCHRITT] OPTIONAL: Versuche sysctl-Einstellungen anzuwenden...[0m
|
||||
[0;36m[ERFOLG] ✅ MYP sysctl-Einstellungen angewendet[0m
|
||||
[0;34m[DEBUG] Sysctl-Phase abgeschlossen - fahre mit Installation fort[0m
|
||||
[0;35m[FORTSCHRITT] Deaktiviere IPv6 in Netzwerk-Interfaces (vorsichtig)...[0m
|
||||
[0;34m[DEBUG] systemd-networkd nicht aktiv - überspringe[0m
|
||||
[0;34m[DEBUG] NetworkManager nicht aktiv - überspringe[0m
|
||||
[0;34m[DEBUG] IPv6 Einträge in /etc/hosts auskommentiert[0m
|
||||
[0;32m[2025-06-03 20:58:45] ✅ Optionale Netzwerk-Sicherheit konfiguriert:[0m
|
||||
[0;32m[2025-06-03 20:58:45] 📝 Sysctl-Konfiguration erstellt: /etc/sysctl.d/99-myp-security.conf[0m
|
||||
[0;32m[2025-06-03 20:58:45] ⚙️ Einstellungen werden beim nächsten Boot aktiv[0m
|
||||
[0;32m[2025-06-03 20:58:45] 🔧 Netzwerk-Konfiguration vorbereitet[0m
|
||||
[0;34m[INFO] 💡 Tipp: Netzwerk-Sicherheit kann manuell aktiviert werden:[0m
|
||||
[0;34m[INFO] → sudo sysctl -p /etc/sysctl.d/99-myp-security.conf[0m
|
||||
[0;34m[INFO] → Oder automatisch beim nächsten Neustart[0m
|
||||
[0;34m[DEBUG] Netzwerk-Sicherheit ohne Blockierung abgeschlossen[0m
|
||||
[0;32m[2025-06-03 20:58:45] === ROBUSTE PYTHON-INSTALLATION ===[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Python 3 und Build-Abhängigkeiten...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3-pip[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3-setuptools[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3-venv[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: python3-wheel[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: build-essential[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libssl-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libffi-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libbz2-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libreadline-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libsqlite3-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libncurses5-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: libncursesw5-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: zlib1g-dev[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: sqlite3[0m
|
||||
[0;35m[FORTSCHRITT] Validiere Python-Installation...[0m
|
||||
[0;32m[2025-06-03 20:59:51] ✅ Python Version: 3.11.2[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere pip für bessere Zuverlässigkeit...[0m
|
||||
[0;35m[FORTSCHRITT] Erstelle systemweite pip-Konfiguration...[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere pip für alle Benutzer...[0m
|
||||
[0;32m[2025-06-03 20:59:51] ✅ pip konfiguriert für Benutzer: user[0m
|
||||
[0;35m[FORTSCHRITT] Aktualisiere pip mit Retry...[0m
|
||||
[0;32m[2025-06-03 20:59:55] ✅ pip Version: 25.1.1[0m
|
||||
[0;32m[2025-06-03 20:59:55] ✅ Robuste Python-Umgebung installiert[0m
|
||||
[0;32m[2025-06-03 20:59:55] === ROBUSTE NODE.JS UND NPM INSTALLATION ===[0m
|
||||
[0;35m[FORTSCHRITT] Bereinige alte Node.js-Installationen...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Node.js mit Fallback-Strategie...[0m
|
||||
[0;35m[FORTSCHRITT] Verwende Debian Repository als Fallback...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: nodejs npm[0m
|
||||
[0;32m[2025-06-03 21:01:58] ✅ Node.js via Debian Repository installiert[0m
|
||||
[0;35m[FORTSCHRITT] Validiere Node.js Installation...[0m
|
||||
[0;32m[2025-06-03 21:01:58] ✅ Node.js Version: v18.19.0[0m
|
||||
[0;32m[2025-06-03 21:01:59] ✅ npm Version: 9.2.0[0m
|
||||
[0;35m[FORTSCHRITT] Optimiere npm-Konfiguration...[0m
|
||||
[0;32m[2025-06-03 21:02:01] ✅ Node.js und npm erfolgreich installiert[0m
|
||||
[0;32m[2025-06-03 21:02:01] === TIMEOUT-GESICHERTE SSL-ZERTIFIKATE KONFIGURATION ===[0m
|
||||
[0;35m[FORTSCHRITT] Installiere SSL-Grundkomponenten...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Pakete: ca-certificates openssl[0m
|
||||
[0;35m[FORTSCHRITT] Aktualisiere CA-Zertifikate (timeout-gesichert)...[0m
|
||||
[0;36m[ERFOLG] ✅ CA-Zertifikate erfolgreich aktualisiert[0m
|
||||
[0;34m[DEBUG] SSL-Verzeichnis erstellt: /usr/local/share/ca-certificates/myp[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Mercedes Corporate Zertifikate (timeout-gesichert)...[0m
|
||||
[0;35m[FORTSCHRITT] Lade CA-Zertifikate nach Mercedes-Import neu (timeout-gesichert)...[0m
|
||||
[0;36m[ERFOLG] ✅ Mercedes-Zertifikate erfolgreich in CA-Store integriert[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere SSL-Umgebungsvariablen...[0m
|
||||
[0;35m[FORTSCHRITT] Validiere SSL-Konfiguration...[0m
|
||||
[0;32m[2025-06-03 21:02:06] ✅ SSL-Zertifikate verfügbar: 144 CA-Zertifikate[0m
|
||||
[0;35m[FORTSCHRITT] Finalisiere SSL-Konfiguration...[0m
|
||||
[0;36m[ERFOLG] ✅ Finale CA-Zertifikate Integration abgeschlossen[0m
|
||||
[0;32m[2025-06-03 21:02:07] ✅ SSL-Zertifikate timeout-gesichert konfiguriert[0m
|
||||
[0;34m[DEBUG] SSL-Konfiguration abgeschlossen ohne hängende Prozesse[0m
|
||||
[0;32m[2025-06-03 21:02:07] === PYTHON-PAKETE INSTALLATION ===[0m
|
||||
[0;35m[FORTSCHRITT] Installiere Python-Pakete...[0m
|
||||
[0;35m[FORTSCHRITT] Installiere requirements.txt...[0m
|
||||
[0;36m[ERFOLG] ✅ requirements.txt erfolgreich installiert[0m
|
||||
[0;35m[FORTSCHRITT] Validiere essenzielle Python-Module...[0m
|
||||
[0;34m[DEBUG] flask erfolgreich importiert[0m
|
||||
[0;34m[DEBUG] requests erfolgreich importiert[0m
|
||||
[0;36m[ERFOLG] ✅ Essenzielle Python-Module verfügbar[0m
|
||||
[0;32m[2025-06-03 21:02:50] ✅ Python-Pakete Installation abgeschlossen[0m
|
||||
[0;35m[FORTSCHRITT] Zeige installierte Python-Pakete...[0m
|
||||
[0;32m[2025-06-03 21:02:50] === ROBUSTES ANWENDUNGS-DEPLOYMENT ===[0m
|
||||
[0;35m[FORTSCHRITT] Erstelle sicheres Zielverzeichnis: /opt/myp[0m
|
||||
[0;35m[FORTSCHRITT] Validiere Source-Dateien...[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Anwendungsdateien (robust)...[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere kritische Datei: app.py[0m
|
||||
[0;36m[ERFOLG] ✅ app.py erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere kritische Datei: models.py[0m
|
||||
[0;36m[ERFOLG] ✅ models.py erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere kritische Datei: requirements.txt[0m
|
||||
[0;36m[ERFOLG] ✅ requirements.txt erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: blueprints[0m
|
||||
[0;36m[ERFOLG] ✅ blueprints erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: config[0m
|
||||
[0;36m[ERFOLG] ✅ config erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: database[0m
|
||||
[0;36m[ERFOLG] ✅ database erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: static[0m
|
||||
[0;36m[ERFOLG] ✅ static erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: templates[0m
|
||||
[0;36m[ERFOLG] ✅ templates erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: uploads[0m
|
||||
[0;36m[ERFOLG] ✅ uploads erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: utils[0m
|
||||
[0;36m[ERFOLG] ✅ utils erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: logs[0m
|
||||
[0;36m[ERFOLG] ✅ logs erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere Verzeichnis: certs[0m
|
||||
[0;36m[ERFOLG] ✅ certs erfolgreich kopiert[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere optionale Datei: package.json[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere optionale Datei: package-lock.json[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere optionale Datei: tailwind.config.js[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere optionale Datei: postcss.config.js[0m
|
||||
[0;35m[FORTSCHRITT] Kopiere optionale Datei: README.md[0m
|
||||
[0;35m[FORTSCHRITT] Erstelle Verzeichnisstruktur...[0m
|
||||
[0;35m[FORTSCHRITT] Setze sichere Berechtigungen...[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere robuste Python-Umgebung...[0m
|
||||
[0;32m[2025-06-03 21:03:16] ✅ Python-Pfad konfiguriert: /usr/local/lib/python3.11/dist-packages/myp-app.pth[0m
|
||||
[0;35m[FORTSCHRITT] Konfiguriere Umgebungsvariablen...[0m
|
||||
[0;35m[FORTSCHRITT] Aktualisiere Bash-Profile...[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
|
||||
|
117
backend/setup.sh
117
backend/setup.sh
@ -11,6 +11,42 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# =========================== KOMMANDOZEILEN-PARAMETER =======================
|
||||
# Erkenne Skip-Parameter
|
||||
SKIP_BASH_PROFILE=false
|
||||
SKIP_SYSTEMD=false
|
||||
SKIP_KIOSK=false
|
||||
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--skip-bash-profile)
|
||||
SKIP_BASH_PROFILE=true
|
||||
;;
|
||||
--skip-systemd)
|
||||
SKIP_SYSTEMD=true
|
||||
;;
|
||||
--skip-kiosk)
|
||||
SKIP_KIOSK=true
|
||||
;;
|
||||
--wsl|--dev)
|
||||
# WSL/Development-Modus: Überspringe systemspezifische Schritte
|
||||
SKIP_BASH_PROFILE=true
|
||||
SKIP_SYSTEMD=true
|
||||
SKIP_KIOSK=true
|
||||
echo "WSL/Development-Modus aktiviert - systemspezifische Schritte werden übersprungen"
|
||||
;;
|
||||
--help|-h)
|
||||
echo "MYP Setup-Skript - Optionen:"
|
||||
echo " --skip-bash-profile Überspringe Bash-Profile Updates"
|
||||
echo " --skip-systemd Überspringe Systemd-Service Installation"
|
||||
echo " --skip-kiosk Überspringe Kiosk-Modus Konfiguration"
|
||||
echo " --wsl, --dev WSL/Development-Modus (überspringt alle systemspezifischen Schritte)"
|
||||
echo " --help, -h Zeige diese Hilfe"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# =========================== GLOBALE KONFIGURATION ===========================
|
||||
readonly APP_NAME="MYP Druckerverwaltung"
|
||||
readonly APP_VERSION="4.1.0"
|
||||
@ -1839,32 +1875,85 @@ FLASK_ENV=production
|
||||
EOF
|
||||
|
||||
# Bash-Profile für alle User aktualisieren (robust)
|
||||
if [ "$SKIP_BASH_PROFILE" = true ]; then
|
||||
log "⏭️ Bash-Profile Update übersprungen (--skip-bash-profile oder --wsl/--dev)"
|
||||
return
|
||||
fi
|
||||
|
||||
progress "Aktualisiere Bash-Profile..."
|
||||
local profile_updated=0
|
||||
|
||||
for user_home in "/root" "/home/"*; do
|
||||
if [ -d "$user_home" ] && [ "$user_home" != "/home/lost+found" ] && [ -w "$user_home" ]; then
|
||||
if ! grep -q "MYP Application Environment" "$user_home/.bashrc" 2>/dev/null; then
|
||||
cat >> "$user_home/.bashrc" << 'EOF'
|
||||
# WSL-Erkennung
|
||||
local is_wsl=false
|
||||
if grep -qEi "(Microsoft|WSL)" /proc/version 2>/dev/null || [ -n "${WSL_DISTRO_NAME:-}" ]; then
|
||||
is_wsl=true
|
||||
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
|
||||
|
||||
# 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'
|
||||
|
||||
# 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
|
||||
((profile_updated++))
|
||||
log "✅ Bash-Profile aktualisiert: $user_home/.bashrc"
|
||||
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
|
||||
|
||||
if [ $profile_updated -eq 0 ] && [ "$is_wsl" = false ]; then
|
||||
warning "⚠️ Keine Bash-Profile wurden aktualisiert"
|
||||
fi
|
||||
|
||||
# Validiere Deployment
|
||||
progress "Validiere Application Deployment..."
|
||||
local validation_errors=0
|
||||
|
Reference in New Issue
Block a user