feat: Überarbeitung des Kiosk-Installationsskripts zur Vereinfachung der Installation ohne venv/nginx und Verbesserung der Benutzerinteraktion durch klare Fehlermeldungen und Anweisungen. Entfernen nicht benötigter Dateien und Anpassung der Service-Konfiguration für bessere Wartbarkeit.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,316 +0,0 @@
|
|||||||
# MYP Kiosk-System Installation
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Das MYP Kiosk-System bietet eine vollständig automatisierte Lösung für den Betrieb eines Python 3.11 Backends mit sicherem Chrome Kiosk-Modus. Das System ist für verschiedene Betriebssysteme verfügbar.
|
|
||||||
|
|
||||||
## Verfügbare Installationsoptionen
|
|
||||||
|
|
||||||
### Linux/Ubuntu Installation
|
|
||||||
|
|
||||||
**Dateien:**
|
|
||||||
|
|
||||||
- `install-kiosk.sh` - Hauptinstallationsskript
|
|
||||||
- `setup-backend.sh` - Backend-Einrichtung
|
|
||||||
- `myp-backend.service` - Systemd-Service für Backend
|
|
||||||
- `myp-kiosk.service` - Systemd-Service für Kiosk
|
|
||||||
- `kiosk-start.sh` - Kiosk-Start-Skript
|
|
||||||
|
|
||||||
**Installation:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo chmod +x install-kiosk.sh setup-backend.sh
|
|
||||||
sudo ./install-kiosk.sh
|
|
||||||
sudo ./setup-backend.sh
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
### Windows Installation
|
|
||||||
|
|
||||||
**Dateien:**
|
|
||||||
|
|
||||||
- `install-kiosk.ps1` - PowerShell-Installationsskript
|
|
||||||
- `setup-backend.ps1` - PowerShell-Backend-Einrichtung
|
|
||||||
|
|
||||||
**Installation:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
# Als Administrator ausführen
|
|
||||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
||||||
.\install-kiosk.ps1
|
|
||||||
.\setup-backend.ps1
|
|
||||||
Restart-Computer
|
|
||||||
```
|
|
||||||
|
|
||||||
## Systemanforderungen
|
|
||||||
|
|
||||||
### Mindestanforderungen
|
|
||||||
|
|
||||||
- **RAM:** 4 GB (8 GB empfohlen)
|
|
||||||
- **Speicher:** 10 GB freier Speicherplatz
|
|
||||||
- **Prozessor:** Dual-Core (Quad-Core empfohlen)
|
|
||||||
- **Netzwerk:** Internetverbindung für Installation
|
|
||||||
|
|
||||||
### Software-Anforderungen
|
|
||||||
|
|
||||||
- **Python:** 3.11 oder höher
|
|
||||||
- **Browser:** Google Chrome (wird automatisch installiert)
|
|
||||||
- **Betriebssystem:**
|
|
||||||
- Linux: Ubuntu 20.04+ oder ähnlich
|
|
||||||
- Windows: Windows 10/11
|
|
||||||
|
|
||||||
## Installationsschritte
|
|
||||||
|
|
||||||
### Schritt 1: Vorbereitung
|
|
||||||
|
|
||||||
1. Lade das komplette Projektverzeichnis herunter
|
|
||||||
2. Navigiere zum `backend/install` Verzeichnis
|
|
||||||
3. Stelle sicher, dass du Administrator-/Root-Rechte hast
|
|
||||||
|
|
||||||
### Schritt 2: Kiosk-System installieren
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd backend/install
|
|
||||||
sudo ./install-kiosk.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
cd backend\install
|
|
||||||
.\install-kiosk.ps1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Schritt 3: Backend einrichten
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo ./setup-backend.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
.\setup-backend.ps1
|
|
||||||
```
|
|
||||||
|
|
||||||
### Schritt 4: System neu starten
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Linux
|
|
||||||
sudo reboot
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
Restart-Computer
|
|
||||||
```
|
|
||||||
|
|
||||||
## Automatische Funktionen
|
|
||||||
|
|
||||||
### Beim Systemstart
|
|
||||||
|
|
||||||
1. **Backend startet automatisch** auf Port 443 (HTTPS)
|
|
||||||
2. **Chrome Kiosk öffnet automatisch** die Anwendung
|
|
||||||
3. **Überwachung läuft** und startet Services bei Bedarf neu
|
|
||||||
4. **Kein Desktop-Zugriff** möglich
|
|
||||||
|
|
||||||
### Sicherheitsfeatures
|
|
||||||
|
|
||||||
- Vollbild-Kiosk ohne Browser-UI
|
|
||||||
- Keine Tabs, Menüs oder Navigation
|
|
||||||
- Deaktivierte Entwicklertools
|
|
||||||
- Automatischer Neustart bei Fehlern
|
|
||||||
- Eingeschränkte Benutzerrechte
|
|
||||||
|
|
||||||
## Verzeichnisstruktur nach Installation
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
|
|
||||||
```
|
|
||||||
/opt/myp/
|
|
||||||
├── backend/
|
|
||||||
│ ├── app/ # Backend-Anwendung
|
|
||||||
│ ├── venv/ # Python Virtual Environment
|
|
||||||
│ └── requirements.txt # Python-Abhängigkeiten
|
|
||||||
├── scripts/
|
|
||||||
│ ├── kiosk-start.sh # Kiosk-Start-Skript
|
|
||||||
│ ├── kiosk-monitor.sh # Überwachungsskript
|
|
||||||
│ └── emergency-restore.sh # Notfall-Wiederherstellung
|
|
||||||
└── logs/ # System-Logs
|
|
||||||
```
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
```
|
|
||||||
C:\MYP\
|
|
||||||
├── backend\
|
|
||||||
│ ├── app\ # Backend-Anwendung
|
|
||||||
│ ├── venv\ # Python Virtual Environment
|
|
||||||
│ └── requirements.txt # Python-Abhängigkeiten
|
|
||||||
├── scripts\
|
|
||||||
│ ├── kiosk-start.ps1 # Kiosk-Start-Skript
|
|
||||||
│ ├── backend-start.ps1 # Backend-Start-Skript
|
|
||||||
│ └── emergency-restore.ps1 # Notfall-Wiederherstellung
|
|
||||||
└── logs\ # System-Logs
|
|
||||||
```
|
|
||||||
|
|
||||||
## Konfiguration
|
|
||||||
|
|
||||||
### Backend-Konfiguration
|
|
||||||
|
|
||||||
- **URL:** https://localhost:443
|
|
||||||
- **SSL:** Selbstsignierte Zertifikate (automatisch erstellt)
|
|
||||||
- **Umgebung:** Produktion
|
|
||||||
- **Logs:** Automatische Rotation
|
|
||||||
|
|
||||||
### Chrome-Konfiguration
|
|
||||||
|
|
||||||
- **Modus:** Vollbild-Kiosk
|
|
||||||
- **Sicherheit:** No-Sandbox für Stabilität
|
|
||||||
- **Cache:** Wird bei jedem Start geleert
|
|
||||||
- **Incognito:** Aktiviert für Datenschutz
|
|
||||||
|
|
||||||
## Wartung und Überwachung
|
|
||||||
|
|
||||||
### Service-Status prüfen
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl status myp-backend.service
|
|
||||||
sudo systemctl status myp-kiosk.service
|
|
||||||
sudo systemctl status myp-monitor.service
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Get-Process -Name "chrome" | Where-Object { $_.ProcessName -like "*kiosk*" }
|
|
||||||
Get-Process -Name "python" | Where-Object { $_.Path -like "*MYP*" }
|
|
||||||
```
|
|
||||||
|
|
||||||
### Logs anzeigen
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo journalctl -u myp-backend.service -f
|
|
||||||
sudo journalctl -u myp-kiosk.service -f
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Get-EventLog -LogName Application -Source "MYP*" -Newest 50
|
|
||||||
```
|
|
||||||
|
|
||||||
## Fehlerbehebung
|
|
||||||
|
|
||||||
### Backend startet nicht
|
|
||||||
|
|
||||||
1. Prüfe Python-Installation: `python3.11 --version`
|
|
||||||
2. Prüfe Virtual Environment: `ls /opt/myp/backend/venv/` (Linux)
|
|
||||||
3. Prüfe SSL-Zertifikate: `ls /opt/myp/backend/app/certs/`
|
|
||||||
4. Prüfe Logs für Fehlermeldungen
|
|
||||||
|
|
||||||
### Kiosk startet nicht
|
|
||||||
|
|
||||||
1. Prüfe Chrome-Installation: `google-chrome --version`
|
|
||||||
2. Prüfe X11-Display (Linux): `echo $DISPLAY`
|
|
||||||
3. Prüfe Backend-Verfügbarkeit: `curl -k https://localhost:443`
|
|
||||||
4. Prüfe Benutzerrechte
|
|
||||||
|
|
||||||
### System hängt im Kiosk-Modus
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
- SSH-Zugriff von anderem Computer
|
|
||||||
- TTY-Zugriff: Strg+Alt+F2
|
|
||||||
- Stoppe Services: `sudo systemctl stop myp-kiosk.service`
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
- Strg+Alt+Entf für Task-Manager
|
|
||||||
- Führe Notfall-Wiederherstellung aus
|
|
||||||
- Stoppe Chrome-Prozesse manuell
|
|
||||||
|
|
||||||
## Notfall-Wiederherstellung
|
|
||||||
|
|
||||||
### Automatische Wiederherstellung
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo /opt/myp/scripts/emergency-restore.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
- Desktop-Verknüpfung "MYP Notfall-Wiederherstellung" verwenden
|
|
||||||
- Oder: `C:\MYP\scripts\emergency-restore.ps1` ausführen
|
|
||||||
|
|
||||||
### Manuelle Wiederherstellung
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo systemctl disable myp-kiosk.service
|
|
||||||
sudo systemctl disable myp-backend.service
|
|
||||||
sudo rm /etc/lightdm/lightdm.conf.d/10-myp-kiosk.conf
|
|
||||||
sudo systemctl enable gdm3
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Get-Process -Name "chrome" | Stop-Process -Force
|
|
||||||
Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\MYP-Kiosk.ps1"
|
|
||||||
Restart-Computer
|
|
||||||
```
|
|
||||||
|
|
||||||
## Support und Dokumentation
|
|
||||||
|
|
||||||
### Weitere Dokumentation
|
|
||||||
|
|
||||||
- `README-Kiosk.md` - Detaillierte Systemdokumentation
|
|
||||||
- Service-Dateien enthalten Kommentare zur Konfiguration
|
|
||||||
- Skripte sind vollständig dokumentiert
|
|
||||||
|
|
||||||
### Log-Sammlung für Support
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo journalctl -u myp-* --since "1 hour ago" > myp-logs.txt
|
|
||||||
sudo systemctl status myp-* > myp-status.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Get-EventLog -LogName Application -After (Get-Date).AddHours(-1) | Out-File myp-logs.txt
|
|
||||||
Get-Process | Where-Object { $_.ProcessName -like "*chrome*" -or $_.ProcessName -like "*python*" } | Out-File myp-processes.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
## Sicherheitshinweise
|
|
||||||
|
|
||||||
### Produktionsumgebung
|
|
||||||
|
|
||||||
- Ersetze selbstsignierte Zertifikate durch echte SSL-Zertifikate
|
|
||||||
- Konfiguriere Firewall für eingehende Verbindungen
|
|
||||||
- Verwende VPN für Remote-Wartung
|
|
||||||
- Regelmäßige Sicherheitsupdates durchführen
|
|
||||||
|
|
||||||
### Physische Sicherheit
|
|
||||||
|
|
||||||
- Sichere das Gerät vor unbefugtem Zugriff
|
|
||||||
- Deaktiviere USB-Ports falls möglich
|
|
||||||
- Verwende sichere Netzwerkverbindung
|
|
||||||
- Überwache Systemzugriffe
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Wichtiger Hinweis:** Teste die Installation zuerst in einer Testumgebung, bevor du sie in der Produktion einsetzt.
|
|
@@ -1,274 +0,0 @@
|
|||||||
# MYP Kiosk-System Dokumentation
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Das MYP Kiosk-System ist eine vollständig automatisierte Lösung, die ein Python 3.11 Backend mit einem sicheren Chrome Kiosk-Modus kombiniert. Das System startet automatisch beim Systemstart und verhindert den Zugriff auf den Desktop.
|
|
||||||
|
|
||||||
## Systemarchitektur
|
|
||||||
|
|
||||||
### Services
|
|
||||||
1. **myp-backend.service** - Python 3.11 Flask Backend
|
|
||||||
2. **myp-kiosk.service** - Chrome Kiosk-Modus
|
|
||||||
3. **myp-monitor.service** - Überwachung und automatischer Neustart
|
|
||||||
|
|
||||||
### Sicherheitsfeatures
|
|
||||||
- Kein Desktop-Zugriff möglich
|
|
||||||
- Chrome läuft im eingeschränkten Kiosk-Modus
|
|
||||||
- Automatischer Login ohne Benutzerinteraktion
|
|
||||||
- Keine neuen Tabs oder Browser-Navigation möglich
|
|
||||||
- Automatische Wiederherstellung bei Fehlern
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Schritt 1: Kiosk-System installieren
|
|
||||||
```bash
|
|
||||||
cd backend/install
|
|
||||||
sudo chmod +x install-kiosk.sh
|
|
||||||
sudo ./install-kiosk.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### Schritt 2: Backend einrichten
|
|
||||||
```bash
|
|
||||||
sudo chmod +x setup-backend.sh
|
|
||||||
sudo ./setup-backend.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### Schritt 3: System neu starten
|
|
||||||
```bash
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
## Systemkonfiguration
|
|
||||||
|
|
||||||
### Automatischer Login
|
|
||||||
- Benutzer: `myp`
|
|
||||||
- Desktop-Umgebung: Openbox (minimal)
|
|
||||||
- Automatischer Start ohne Benutzerinteraktion
|
|
||||||
|
|
||||||
### Chrome Kiosk-Konfiguration
|
|
||||||
- Vollbild-Modus ohne Browser-UI
|
|
||||||
- Keine Tabs, Menüs oder Navigation
|
|
||||||
- Deaktivierte Entwicklertools
|
|
||||||
- Incognito-Modus für Datenschutz
|
|
||||||
- No-Sandbox für Stabilität
|
|
||||||
|
|
||||||
### Backend-Konfiguration
|
|
||||||
- Python 3.11 mit Flask
|
|
||||||
- HTTPS auf Port 443
|
|
||||||
- Automatische SSL-Zertifikate
|
|
||||||
- Produktions-Umgebung
|
|
||||||
|
|
||||||
## Verzeichnisstruktur
|
|
||||||
|
|
||||||
```
|
|
||||||
/opt/myp/
|
|
||||||
├── backend/
|
|
||||||
│ ├── app/ # Backend-Anwendung
|
|
||||||
│ ├── venv/ # Python Virtual Environment
|
|
||||||
│ └── requirements.txt # Python-Abhängigkeiten
|
|
||||||
├── scripts/
|
|
||||||
│ ├── kiosk-start.sh # Kiosk-Start-Skript
|
|
||||||
│ ├── kiosk-monitor.sh # Überwachungsskript
|
|
||||||
│ └── emergency-restore.sh # Notfall-Wiederherstellung
|
|
||||||
└── logs/ # System-Logs
|
|
||||||
|
|
||||||
/home/myp/
|
|
||||||
├── .config/
|
|
||||||
│ ├── openbox/ # Openbox-Konfiguration
|
|
||||||
│ └── google-chrome/ # Chrome-Konfiguration
|
|
||||||
```
|
|
||||||
|
|
||||||
## Service-Management
|
|
||||||
|
|
||||||
### Services starten/stoppen
|
|
||||||
```bash
|
|
||||||
# Backend
|
|
||||||
sudo systemctl start myp-backend.service
|
|
||||||
sudo systemctl stop myp-backend.service
|
|
||||||
sudo systemctl restart myp-backend.service
|
|
||||||
|
|
||||||
# Kiosk
|
|
||||||
sudo systemctl start myp-kiosk.service
|
|
||||||
sudo systemctl stop myp-kiosk.service
|
|
||||||
sudo systemctl restart myp-kiosk.service
|
|
||||||
|
|
||||||
# Monitor
|
|
||||||
sudo systemctl start myp-monitor.service
|
|
||||||
sudo systemctl stop myp-monitor.service
|
|
||||||
```
|
|
||||||
|
|
||||||
### Service-Status prüfen
|
|
||||||
```bash
|
|
||||||
sudo systemctl status myp-backend.service
|
|
||||||
sudo systemctl status myp-kiosk.service
|
|
||||||
sudo systemctl status myp-monitor.service
|
|
||||||
```
|
|
||||||
|
|
||||||
### Logs anzeigen
|
|
||||||
```bash
|
|
||||||
# Backend-Logs
|
|
||||||
sudo journalctl -u myp-backend.service -f
|
|
||||||
|
|
||||||
# Kiosk-Logs
|
|
||||||
sudo journalctl -u myp-kiosk.service -f
|
|
||||||
|
|
||||||
# Monitor-Logs
|
|
||||||
sudo journalctl -u myp-monitor.service -f
|
|
||||||
|
|
||||||
# Alle MYP-Logs
|
|
||||||
sudo journalctl -t myp-backend -t myp-kiosk -f
|
|
||||||
```
|
|
||||||
|
|
||||||
## Überwachung und Wartung
|
|
||||||
|
|
||||||
### Automatische Überwachung
|
|
||||||
Das System überwacht sich selbst und startet Services automatisch neu:
|
|
||||||
- Backend-Verfügbarkeit (alle 30 Sekunden)
|
|
||||||
- Chrome Kiosk-Prozess (alle 30 Sekunden)
|
|
||||||
- Automatischer Neustart bei Fehlern
|
|
||||||
|
|
||||||
### Manuelle Überwachung
|
|
||||||
```bash
|
|
||||||
# Prüfe Backend-Verfügbarkeit
|
|
||||||
curl -k https://localhost:443
|
|
||||||
|
|
||||||
# Prüfe Chrome-Prozesse
|
|
||||||
ps aux | grep chrome
|
|
||||||
|
|
||||||
# Prüfe System-Ressourcen
|
|
||||||
htop
|
|
||||||
```
|
|
||||||
|
|
||||||
## Fehlerbehebung
|
|
||||||
|
|
||||||
### Backend startet nicht
|
|
||||||
```bash
|
|
||||||
# Prüfe Service-Status
|
|
||||||
sudo systemctl status myp-backend.service
|
|
||||||
|
|
||||||
# Prüfe Logs
|
|
||||||
sudo journalctl -u myp-backend.service -n 50
|
|
||||||
|
|
||||||
# Prüfe Python-Umgebung
|
|
||||||
sudo -u myp /opt/myp/backend/venv/bin/python3.11 --version
|
|
||||||
|
|
||||||
# Teste Backend manuell
|
|
||||||
cd /opt/myp/backend/app
|
|
||||||
sudo -u myp /opt/myp/backend/venv/bin/python3.11 app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### Kiosk startet nicht
|
|
||||||
```bash
|
|
||||||
# Prüfe Service-Status
|
|
||||||
sudo systemctl status myp-kiosk.service
|
|
||||||
|
|
||||||
# Prüfe X11-Display
|
|
||||||
sudo -u myp DISPLAY=:0 xdpyinfo
|
|
||||||
|
|
||||||
# Prüfe Chrome-Installation
|
|
||||||
which google-chrome
|
|
||||||
google-chrome --version
|
|
||||||
|
|
||||||
# Teste Kiosk manuell
|
|
||||||
sudo -u myp DISPLAY=:0 /opt/myp/scripts/kiosk-start.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### System hängt im Kiosk-Modus
|
|
||||||
```bash
|
|
||||||
# SSH-Zugriff von anderem Computer
|
|
||||||
ssh user@kiosk-system-ip
|
|
||||||
|
|
||||||
# Oder lokaler Zugriff über TTY
|
|
||||||
# Strg+Alt+F2 (TTY2)
|
|
||||||
# Login als root oder sudo-Benutzer
|
|
||||||
|
|
||||||
# Stoppe Kiosk-Services
|
|
||||||
sudo systemctl stop myp-kiosk.service
|
|
||||||
sudo systemctl stop myp-backend.service
|
|
||||||
```
|
|
||||||
|
|
||||||
## Notfall-Wiederherstellung
|
|
||||||
|
|
||||||
### Desktop-Modus wiederherstellen
|
|
||||||
```bash
|
|
||||||
# Führe Notfall-Skript aus
|
|
||||||
sudo /opt/myp/scripts/emergency-restore.sh
|
|
||||||
|
|
||||||
# Oder manuell:
|
|
||||||
sudo systemctl disable myp-kiosk.service
|
|
||||||
sudo systemctl disable myp-backend.service
|
|
||||||
sudo rm /etc/lightdm/lightdm.conf.d/10-myp-kiosk.conf
|
|
||||||
sudo systemctl enable gdm3 # oder sddm/lightdm
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
### Kiosk-Modus reaktivieren
|
|
||||||
```bash
|
|
||||||
sudo systemctl enable myp-backend.service
|
|
||||||
sudo systemctl enable myp-kiosk.service
|
|
||||||
sudo systemctl enable myp-monitor.service
|
|
||||||
sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
## Sicherheitshinweise
|
|
||||||
|
|
||||||
### Systemsicherheit
|
|
||||||
- Kiosk-Benutzer hat eingeschränkte Rechte
|
|
||||||
- Keine sudo-Berechtigung für Kiosk-Benutzer
|
|
||||||
- Systemd-Services mit Sicherheitsrichtlinien
|
|
||||||
- Automatische Updates deaktiviert (manuell durchführen)
|
|
||||||
|
|
||||||
### Netzwerksicherheit
|
|
||||||
- HTTPS-Verschlüsselung
|
|
||||||
- Selbstsignierte Zertifikate (für Produktion ersetzen)
|
|
||||||
- Firewall-Konfiguration empfohlen
|
|
||||||
- VPN-Zugriff für Wartung empfohlen
|
|
||||||
|
|
||||||
### Physische Sicherheit
|
|
||||||
- Tastatur-Shortcuts deaktiviert
|
|
||||||
- Kein Zugriff auf Terminal oder Dateisystem
|
|
||||||
- Automatischer Neustart bei Manipulation
|
|
||||||
- Bildschirmschoner deaktiviert
|
|
||||||
|
|
||||||
## Wartungsplan
|
|
||||||
|
|
||||||
### Täglich
|
|
||||||
- Automatische Überwachung läuft
|
|
||||||
- Logs werden automatisch rotiert
|
|
||||||
|
|
||||||
### Wöchentlich
|
|
||||||
- Service-Status prüfen
|
|
||||||
- Log-Dateien überprüfen
|
|
||||||
- System-Ressourcen überwachen
|
|
||||||
|
|
||||||
### Monatlich
|
|
||||||
- System-Updates (im Wartungsfenster)
|
|
||||||
- SSL-Zertifikate prüfen
|
|
||||||
- Backup-Strategie überprüfen
|
|
||||||
|
|
||||||
### Bei Bedarf
|
|
||||||
- Backend-Updates
|
|
||||||
- Chrome-Updates
|
|
||||||
- Konfigurationsänderungen
|
|
||||||
|
|
||||||
## Support und Kontakt
|
|
||||||
|
|
||||||
### Log-Sammlung für Support
|
|
||||||
```bash
|
|
||||||
# Sammle alle relevanten Logs
|
|
||||||
sudo journalctl -u myp-backend.service --since "1 hour ago" > backend.log
|
|
||||||
sudo journalctl -u myp-kiosk.service --since "1 hour ago" > kiosk.log
|
|
||||||
sudo systemctl status myp-*.service > service-status.log
|
|
||||||
```
|
|
||||||
|
|
||||||
### Systeminfo für Support
|
|
||||||
```bash
|
|
||||||
# System-Informationen sammeln
|
|
||||||
uname -a > system-info.txt
|
|
||||||
lsb_release -a >> system-info.txt
|
|
||||||
systemctl list-units myp-* >> system-info.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Wichtiger Hinweis**: Dieses System ist für den Produktionseinsatz konzipiert. Teste alle Änderungen zuerst in einer Testumgebung.
|
|
58
backend/install/README.md
Normal file
58
backend/install/README.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# MYP Kiosk-Modus Installation
|
||||||
|
|
||||||
|
## Einfache Installation
|
||||||
|
|
||||||
|
Das MYP Kiosk-System installiert automatisch:
|
||||||
|
- Python 3.11 Backend auf 192.168.0.105:80
|
||||||
|
- Chromium Kiosk-Modus im Vollbild
|
||||||
|
- Automatischer Login als "user"
|
||||||
|
- Automatischer Neustart nach Installation
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd backend/install
|
||||||
|
sudo chmod +x install-kiosk.sh
|
||||||
|
sudo ./install-kiosk.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Das System startet automatisch neu und öffnet den Kiosk-Modus.
|
||||||
|
|
||||||
|
## Services
|
||||||
|
|
||||||
|
- **myp-backend.service** - Python Backend
|
||||||
|
- **myp-kiosk.service** - Chromium Kiosk
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
- **Backend:** http://192.168.0.105:80
|
||||||
|
- **Benutzer:** user (automatischer Login)
|
||||||
|
- **Desktop:** Openbox (minimal)
|
||||||
|
- **Browser:** Chromium im Kiosk-Modus
|
||||||
|
|
||||||
|
## Wartung
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Service-Status prüfen
|
||||||
|
sudo systemctl status myp-backend.service
|
||||||
|
sudo systemctl status myp-kiosk.service
|
||||||
|
|
||||||
|
# Services neu starten
|
||||||
|
sudo systemctl restart myp-backend.service
|
||||||
|
sudo systemctl restart myp-kiosk.service
|
||||||
|
|
||||||
|
# Logs anzeigen
|
||||||
|
sudo journalctl -u myp-backend.service -f
|
||||||
|
sudo journalctl -u myp-kiosk.service -f
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deinstallation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl disable myp-backend.service
|
||||||
|
sudo systemctl disable myp-kiosk.service
|
||||||
|
sudo rm /etc/systemd/system/myp-*.service
|
||||||
|
sudo rm -rf /opt/myp
|
||||||
|
sudo rm /etc/lightdm/lightdm.conf.d/10-autologin.conf
|
||||||
|
sudo reboot
|
||||||
|
```
|
@@ -1,231 +0,0 @@
|
|||||||
# MYP Kiosk Installation Script für Windows
|
|
||||||
# Installiert und konfiguriert das komplette Kiosk-System
|
|
||||||
|
|
||||||
param(
|
|
||||||
[switch]$Force,
|
|
||||||
[string]$InstallPath = "C:\MYP"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Prüfe Administrator-Rechte
|
|
||||||
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
|
||||||
Write-Error "Dieses Skript muss als Administrator ausgeführt werden"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Starte MYP Kiosk Installation..." -ForegroundColor Blue
|
|
||||||
|
|
||||||
# Erstelle Installationsverzeichnis
|
|
||||||
Write-Host "Erstelle Verzeichnisstruktur..." -ForegroundColor Yellow
|
|
||||||
New-Item -ItemType Directory -Path "$InstallPath\backend" -Force | Out-Null
|
|
||||||
New-Item -ItemType Directory -Path "$InstallPath\scripts" -Force | Out-Null
|
|
||||||
New-Item -ItemType Directory -Path "$InstallPath\logs" -Force | Out-Null
|
|
||||||
|
|
||||||
# Installiere Chocolatey falls nicht vorhanden
|
|
||||||
if (!(Get-Command choco -ErrorAction SilentlyContinue)) {
|
|
||||||
Write-Host "Installiere Chocolatey..." -ForegroundColor Yellow
|
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
|
||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
|
||||||
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
|
||||||
}
|
|
||||||
|
|
||||||
# Installiere benötigte Software
|
|
||||||
Write-Host "Installiere benötigte Software..." -ForegroundColor Yellow
|
|
||||||
choco install googlechrome python311 -y
|
|
||||||
|
|
||||||
# Erstelle Kiosk-Start-Skript
|
|
||||||
Write-Host "Erstelle Kiosk-Skripte..." -ForegroundColor Yellow
|
|
||||||
$kioskScript = @"
|
|
||||||
# MYP Kiosk Start Script für Windows
|
|
||||||
`$BackendUrl = "https://localhost:443"
|
|
||||||
`$MaxRetries = 30
|
|
||||||
`$RetryCount = 0
|
|
||||||
|
|
||||||
Write-Host "Starte MYP Kiosk-Modus..." -ForegroundColor Green
|
|
||||||
|
|
||||||
# Warte auf Backend-Verfügbarkeit
|
|
||||||
while (`$RetryCount -lt `$MaxRetries) {
|
|
||||||
try {
|
|
||||||
`$response = Invoke-WebRequest -Uri `$BackendUrl -UseBasicParsing -SkipCertificateCheck -TimeoutSec 5
|
|
||||||
if (`$response.StatusCode -eq 200) {
|
|
||||||
Write-Host "Backend ist verfügbar" -ForegroundColor Green
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
`$RetryCount++
|
|
||||||
Write-Host "Warte auf Backend... Versuch `$RetryCount/`$MaxRetries" -ForegroundColor Yellow
|
|
||||||
Start-Sleep -Seconds 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (`$RetryCount -ge `$MaxRetries) {
|
|
||||||
Write-Error "Backend nicht erreichbar nach `$MaxRetries Versuchen"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Beende alle Chrome-Prozesse
|
|
||||||
Get-Process -Name "chrome" -ErrorAction SilentlyContinue | Stop-Process -Force
|
|
||||||
Start-Sleep -Seconds 2
|
|
||||||
|
|
||||||
# Lösche Chrome-Cache
|
|
||||||
`$ChromeUserData = "`$env:LOCALAPPDATA\Google\Chrome\User Data"
|
|
||||||
if (Test-Path `$ChromeUserData) {
|
|
||||||
Remove-Item "`$ChromeUserData\Default\Web Data*" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item "`$ChromeUserData\Default\History*" -Force -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
|
|
||||||
# Chrome Kiosk-Parameter
|
|
||||||
`$ChromeArgs = @(
|
|
||||||
"--kiosk"
|
|
||||||
"--no-sandbox"
|
|
||||||
"--disable-dev-shm-usage"
|
|
||||||
"--disable-gpu-sandbox"
|
|
||||||
"--disable-software-rasterizer"
|
|
||||||
"--disable-background-timer-throttling"
|
|
||||||
"--disable-backgrounding-occluded-windows"
|
|
||||||
"--disable-renderer-backgrounding"
|
|
||||||
"--disable-features=TranslateUI,BlinkGenPropertyTrees"
|
|
||||||
"--disable-default-apps"
|
|
||||||
"--disable-extensions"
|
|
||||||
"--disable-plugins"
|
|
||||||
"--disable-sync"
|
|
||||||
"--disable-translate"
|
|
||||||
"--disable-background-networking"
|
|
||||||
"--disable-infobars"
|
|
||||||
"--disable-notifications"
|
|
||||||
"--disable-password-manager-reauthentication"
|
|
||||||
"--disable-permissions-api"
|
|
||||||
"--disable-popup-blocking"
|
|
||||||
"--disable-print-preview"
|
|
||||||
"--disable-session-crashed-bubble"
|
|
||||||
"--disable-system-notifications"
|
|
||||||
"--disable-web-security"
|
|
||||||
"--no-default-browser-check"
|
|
||||||
"--no-first-run"
|
|
||||||
"--single-process"
|
|
||||||
"--incognito"
|
|
||||||
"--disable-pinch"
|
|
||||||
"--overscroll-history-navigation=0"
|
|
||||||
"--app=`$BackendUrl"
|
|
||||||
)
|
|
||||||
|
|
||||||
Write-Host "Starte Chrome im Kiosk-Modus..." -ForegroundColor Green
|
|
||||||
|
|
||||||
# Starte Chrome
|
|
||||||
`$ChromePath = "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe"
|
|
||||||
if (!(Test-Path `$ChromePath)) {
|
|
||||||
`$ChromePath = "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe"
|
|
||||||
}
|
|
||||||
|
|
||||||
Start-Process -FilePath `$ChromePath -ArgumentList `$ChromeArgs -WindowStyle Maximized
|
|
||||||
"@
|
|
||||||
|
|
||||||
$kioskScript | Out-File -FilePath "$InstallPath\scripts\kiosk-start.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Backend-Start-Skript
|
|
||||||
$backendScript = @"
|
|
||||||
# MYP Backend Start Script für Windows
|
|
||||||
`$BackendPath = "$InstallPath\backend"
|
|
||||||
`$VenvPath = "`$BackendPath\venv"
|
|
||||||
`$AppPath = "`$BackendPath\app"
|
|
||||||
|
|
||||||
Write-Host "Starte MYP Backend..." -ForegroundColor Green
|
|
||||||
|
|
||||||
# Aktiviere Virtual Environment
|
|
||||||
if (Test-Path "`$VenvPath\Scripts\Activate.ps1") {
|
|
||||||
& "`$VenvPath\Scripts\Activate.ps1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Wechsle ins App-Verzeichnis
|
|
||||||
Set-Location `$AppPath
|
|
||||||
|
|
||||||
# Starte Backend
|
|
||||||
& python app.py --host 0.0.0.0 --port 443 --cert certs/backend.crt --key certs/backend.key
|
|
||||||
"@
|
|
||||||
|
|
||||||
$backendScript | Out-File -FilePath "$InstallPath\scripts\backend-start.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Überwachungsskript
|
|
||||||
$monitorScript = @"
|
|
||||||
# MYP Kiosk Monitor für Windows
|
|
||||||
while (`$true) {
|
|
||||||
# Prüfe Chrome-Prozess
|
|
||||||
if (!(Get-Process -Name "chrome" -ErrorAction SilentlyContinue)) {
|
|
||||||
Write-Host "`$(Get-Date): Chrome nicht gefunden, starte neu..." -ForegroundColor Yellow
|
|
||||||
& "$InstallPath\scripts\kiosk-start.ps1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prüfe Backend-Verfügbarkeit
|
|
||||||
try {
|
|
||||||
`$response = Invoke-WebRequest -Uri "https://localhost:443" -UseBasicParsing -SkipCertificateCheck -TimeoutSec 5
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Write-Host "`$(Get-Date): Backend nicht erreichbar, starte neu..." -ForegroundColor Yellow
|
|
||||||
& "$InstallPath\scripts\backend-start.ps1"
|
|
||||||
}
|
|
||||||
|
|
||||||
Start-Sleep -Seconds 30
|
|
||||||
}
|
|
||||||
"@
|
|
||||||
|
|
||||||
$monitorScript | Out-File -FilePath "$InstallPath\scripts\kiosk-monitor.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Windows-Service-Wrapper
|
|
||||||
$serviceScript = @"
|
|
||||||
# MYP Service Wrapper
|
|
||||||
`$BackendJob = Start-Job -ScriptBlock { & "$InstallPath\scripts\backend-start.ps1" }
|
|
||||||
Start-Sleep -Seconds 10
|
|
||||||
`$KioskJob = Start-Job -ScriptBlock { & "$InstallPath\scripts\kiosk-start.ps1" }
|
|
||||||
`$MonitorJob = Start-Job -ScriptBlock { & "$InstallPath\scripts\kiosk-monitor.ps1" }
|
|
||||||
|
|
||||||
# Warte auf Jobs
|
|
||||||
Wait-Job `$BackendJob, `$KioskJob, `$MonitorJob
|
|
||||||
"@
|
|
||||||
|
|
||||||
$serviceScript | Out-File -FilePath "$InstallPath\scripts\myp-service.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Autostart-Eintrag
|
|
||||||
Write-Host "Konfiguriere Autostart..." -ForegroundColor Yellow
|
|
||||||
$startupScript = @"
|
|
||||||
# MYP Autostart
|
|
||||||
Start-Sleep -Seconds 5
|
|
||||||
& "$InstallPath\scripts\myp-service.ps1"
|
|
||||||
"@
|
|
||||||
|
|
||||||
$startupPath = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
|
|
||||||
$startupScript | Out-File -FilePath "$startupPath\MYP-Kiosk.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Desktop-Verknüpfung für Notfall-Wiederherstellung
|
|
||||||
$emergencyScript = @"
|
|
||||||
# Notfall-Wiederherstellung
|
|
||||||
Write-Host "Deaktiviere Kiosk-Modus..." -ForegroundColor Yellow
|
|
||||||
|
|
||||||
# Stoppe alle MYP-Prozesse
|
|
||||||
Get-Process -Name "chrome" -ErrorAction SilentlyContinue | Stop-Process -Force
|
|
||||||
Get-Process -Name "python" -ErrorAction SilentlyContinue | Where-Object { `$_.Path -like "*MYP*" } | Stop-Process -Force
|
|
||||||
|
|
||||||
# Entferne Autostart
|
|
||||||
Remove-Item "$startupPath\MYP-Kiosk.ps1" -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
Write-Host "Kiosk-Modus deaktiviert. System neu starten für normalen Desktop." -ForegroundColor Green
|
|
||||||
"@
|
|
||||||
|
|
||||||
$emergencyScript | Out-File -FilePath "$InstallPath\scripts\emergency-restore.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Erstelle Desktop-Verknüpfung
|
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
|
||||||
$Shortcut = $WshShell.CreateShortcut("$env:PUBLIC\Desktop\MYP Notfall-Wiederherstellung.lnk")
|
|
||||||
$Shortcut.TargetPath = "powershell.exe"
|
|
||||||
$Shortcut.Arguments = "-ExecutionPolicy Bypass -File `"$InstallPath\scripts\emergency-restore.ps1`""
|
|
||||||
$Shortcut.WorkingDirectory = "$InstallPath\scripts"
|
|
||||||
$Shortcut.IconLocation = "shell32.dll,21"
|
|
||||||
$Shortcut.Description = "MYP Kiosk Notfall-Wiederherstellung"
|
|
||||||
$Shortcut.Save()
|
|
||||||
|
|
||||||
Write-Host "MYP Kiosk Installation abgeschlossen!" -ForegroundColor Green
|
|
||||||
Write-Host "Nächste Schritte:" -ForegroundColor Yellow
|
|
||||||
Write-Host "1. Backend-Code nach $InstallPath\backend kopieren" -ForegroundColor White
|
|
||||||
Write-Host "2. Python Virtual Environment einrichten" -ForegroundColor White
|
|
||||||
Write-Host "3. SSL-Zertifikate konfigurieren" -ForegroundColor White
|
|
||||||
Write-Host "4. System neu starten" -ForegroundColor White
|
|
||||||
Write-Host "Notfall-Wiederherstellung: Desktop-Verknüpfung verwenden" -ForegroundColor Red
|
|
@@ -1,216 +1,70 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# MYP Kiosk Installation Script
|
# MYP Kiosk Installation - Einfach und direkt
|
||||||
# Installiert und konfiguriert das komplette Kiosk-System
|
# Installiert Backend + Kiosk-Modus ohne venv oder nginx
|
||||||
|
|
||||||
set -euo pipefail
|
set -e
|
||||||
|
|
||||||
# Farben für Output
|
echo "=== MYP Kiosk Installation ==="
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
# Logging-Funktionen
|
|
||||||
log_info() {
|
|
||||||
echo -e "${BLUE}[INFO]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_success() {
|
|
||||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_warning() {
|
|
||||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_error() {
|
|
||||||
echo -e "${RED}[ERROR]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prüfe Root-Rechte
|
# Prüfe Root-Rechte
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
log_error "Dieses Skript muss als root ausgeführt werden"
|
echo "FEHLER: Dieses Skript muss als root ausgeführt werden"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_info "Starte MYP Kiosk Installation..."
|
|
||||||
|
|
||||||
# System-Update
|
|
||||||
log_info "Aktualisiere System-Pakete..."
|
|
||||||
apt update && apt upgrade -y
|
|
||||||
|
|
||||||
# Installiere benötigte Pakete
|
# Installiere benötigte Pakete
|
||||||
log_info "Installiere benötigte Pakete..."
|
echo "Installiere Pakete..."
|
||||||
apt install -y \
|
apt update
|
||||||
google-chrome-stable \
|
apt install -y python3.11 python3-pip chromium-browser lightdm openbox curl
|
||||||
xorg \
|
|
||||||
openbox \
|
|
||||||
lightdm \
|
|
||||||
curl \
|
|
||||||
systemd \
|
|
||||||
python3.11 \
|
|
||||||
python3.11-venv \
|
|
||||||
python3-pip \
|
|
||||||
unclutter \
|
|
||||||
xdotool
|
|
||||||
|
|
||||||
# Erstelle MYP-Benutzer falls nicht vorhanden
|
# Erstelle Verzeichnisse
|
||||||
if ! id "myp" &>/dev/null; then
|
echo "Erstelle Verzeichnisse..."
|
||||||
log_info "Erstelle MYP-Benutzer..."
|
mkdir -p /opt/myp/backend
|
||||||
useradd -m -s /bin/bash myp
|
mkdir -p /home/user/.config/openbox
|
||||||
usermod -aG audio,video,input myp
|
|
||||||
else
|
|
||||||
log_info "MYP-Benutzer bereits vorhanden"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Erstelle Verzeichnisstruktur
|
# Kopiere Backend-Code
|
||||||
log_info "Erstelle Verzeichnisstruktur..."
|
echo "Kopiere Backend-Code..."
|
||||||
mkdir -p /opt/myp/{backend,scripts,logs}
|
cp -r ../app /opt/myp/backend/
|
||||||
mkdir -p /home/myp/.config/openbox
|
cp ../requirements.txt /opt/myp/backend/
|
||||||
mkdir -p /home/myp/.config/google-chrome
|
|
||||||
|
|
||||||
# Kopiere Service-Dateien
|
# Installiere Python-Abhängigkeiten global
|
||||||
log_info "Installiere Service-Dateien..."
|
echo "Installiere Python-Abhängigkeiten..."
|
||||||
cp myp-backend.service /etc/systemd/system/
|
cd /opt/myp/backend
|
||||||
cp myp-kiosk.service /etc/systemd/system/
|
pip3 install -r requirements.txt
|
||||||
|
|
||||||
# Kopiere und setze Berechtigungen für Skripte
|
|
||||||
log_info "Installiere Kiosk-Skripte..."
|
|
||||||
cp kiosk-start.sh /opt/myp/scripts/
|
|
||||||
chmod +x /opt/myp/scripts/kiosk-start.sh
|
|
||||||
|
|
||||||
# Erstelle Openbox-Konfiguration für automatischen Kiosk-Start
|
|
||||||
log_info "Konfiguriere Openbox für Kiosk-Modus..."
|
|
||||||
cat > /home/myp/.config/openbox/autostart << 'EOF'
|
|
||||||
# MYP Kiosk Autostart
|
|
||||||
# Deaktiviere Bildschirmschoner und Energieverwaltung
|
|
||||||
xset -dpms &
|
|
||||||
xset s off &
|
|
||||||
xset s noblank &
|
|
||||||
|
|
||||||
# Verstecke Mauszeiger bei Inaktivität
|
|
||||||
unclutter -idle 0.1 -root &
|
|
||||||
|
|
||||||
# Verhindere versehentliche Tastenkombinationen
|
|
||||||
xdotool key ctrl+alt+t &
|
|
||||||
|
|
||||||
# Starte Kiosk-Service
|
|
||||||
systemctl --user start myp-kiosk.service &
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Erstelle LightDM-Konfiguration für automatischen Login
|
|
||||||
log_info "Konfiguriere automatischen Login..."
|
|
||||||
cat > /etc/lightdm/lightdm.conf.d/10-myp-kiosk.conf << 'EOF'
|
|
||||||
[Seat:*]
|
|
||||||
autologin-user=myp
|
|
||||||
autologin-user-timeout=0
|
|
||||||
user-session=openbox
|
|
||||||
autologin-session=openbox
|
|
||||||
greeter-session=unity-greeter
|
|
||||||
allow-guest=false
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Erstelle Desktop-Session für MYP
|
|
||||||
log_info "Erstelle Desktop-Session..."
|
|
||||||
cat > /usr/share/xsessions/myp-kiosk.desktop << 'EOF'
|
|
||||||
[Desktop Entry]
|
|
||||||
Name=MYP Kiosk
|
|
||||||
Comment=MYP Reservation Platform Kiosk Mode
|
|
||||||
Exec=openbox-session
|
|
||||||
Type=Application
|
|
||||||
DesktopNames=MYP
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Setze Berechtigungen
|
# Setze Berechtigungen
|
||||||
log_info "Setze Berechtigungen..."
|
echo "Setze Berechtigungen..."
|
||||||
chown -R myp:myp /home/myp
|
chown -R user:user /opt/myp
|
||||||
chown -R myp:myp /opt/myp
|
chown -R user:user /home/user
|
||||||
chmod 755 /opt/myp/scripts/kiosk-start.sh
|
|
||||||
|
|
||||||
# Systemd-Services aktivieren
|
# Installiere Services
|
||||||
log_info "Aktiviere Systemd-Services..."
|
echo "Installiere Services..."
|
||||||
|
cp myp-backend.service /etc/systemd/system/
|
||||||
|
cp myp-kiosk.service /etc/systemd/system/
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable myp-backend.service
|
systemctl enable myp-backend.service
|
||||||
systemctl enable myp-kiosk.service
|
systemctl enable myp-kiosk.service
|
||||||
|
|
||||||
# Erstelle Kiosk-Überwachungsskript
|
# Konfiguriere automatischen Login
|
||||||
log_info "Erstelle Überwachungsskript..."
|
echo "Konfiguriere automatischen Login..."
|
||||||
cat > /opt/myp/scripts/kiosk-monitor.sh << 'EOF'
|
cat > /etc/lightdm/lightdm.conf.d/10-autologin.conf << EOF
|
||||||
#!/bin/bash
|
[Seat:*]
|
||||||
# MYP Kiosk Monitor - Überwacht und startet Kiosk-Prozesse neu
|
autologin-user=user
|
||||||
|
autologin-user-timeout=0
|
||||||
while true; do
|
user-session=openbox
|
||||||
# Prüfe ob Chrome läuft
|
|
||||||
if ! pgrep -f "google-chrome.*kiosk" > /dev/null; then
|
|
||||||
echo "$(date): Chrome Kiosk nicht gefunden, starte neu..." >> /opt/myp/logs/kiosk-monitor.log
|
|
||||||
systemctl restart myp-kiosk.service
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prüfe ob Backend läuft
|
|
||||||
if ! curl -k -s https://localhost:443 > /dev/null 2>&1; then
|
|
||||||
echo "$(date): Backend nicht erreichbar, starte neu..." >> /opt/myp/logs/kiosk-monitor.log
|
|
||||||
systemctl restart myp-backend.service
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 30
|
|
||||||
done
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /opt/myp/scripts/kiosk-monitor.sh
|
# Konfiguriere Openbox für Kiosk-Start
|
||||||
|
echo "Konfiguriere Openbox..."
|
||||||
# Erstelle Monitor-Service
|
cat > /home/user/.config/openbox/autostart << EOF
|
||||||
cat > /etc/systemd/system/myp-monitor.service << 'EOF'
|
# Starte Kiosk-Service automatisch
|
||||||
[Unit]
|
systemctl --user start myp-kiosk.service &
|
||||||
Description=MYP Kiosk Monitor
|
|
||||||
After=myp-backend.service myp-kiosk.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
ExecStart=/opt/myp/scripts/kiosk-monitor.sh
|
|
||||||
Restart=always
|
|
||||||
RestartSec=10
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
systemctl enable myp-monitor.service
|
chown user:user /home/user/.config/openbox/autostart
|
||||||
|
|
||||||
# Deaktiviere Desktop-Umgebung und unnötige Services
|
echo "=== Installation abgeschlossen ==="
|
||||||
log_info "Deaktiviere unnötige Services..."
|
echo "System wird in 5 Sekunden neu gestartet..."
|
||||||
systemctl disable gdm3 2>/dev/null || true
|
sleep 5
|
||||||
systemctl disable sddm 2>/dev/null || true
|
reboot
|
||||||
systemctl disable plymouth 2>/dev/null || true
|
|
||||||
|
|
||||||
# Erstelle Backup-Wiederherstellungsskript
|
|
||||||
log_info "Erstelle Notfall-Wiederherstellungsskript..."
|
|
||||||
cat > /opt/myp/scripts/emergency-restore.sh << 'EOF'
|
|
||||||
#!/bin/bash
|
|
||||||
# Notfall-Wiederherstellung: Deaktiviert Kiosk-Modus und aktiviert normalen Desktop
|
|
||||||
|
|
||||||
echo "Deaktiviere Kiosk-Modus..."
|
|
||||||
systemctl disable myp-kiosk.service
|
|
||||||
systemctl disable myp-backend.service
|
|
||||||
systemctl disable myp-monitor.service
|
|
||||||
|
|
||||||
echo "Aktiviere normalen Desktop..."
|
|
||||||
systemctl enable gdm3 || systemctl enable sddm || systemctl enable lightdm
|
|
||||||
|
|
||||||
echo "Entferne automatischen Login..."
|
|
||||||
rm -f /etc/lightdm/lightdm.conf.d/10-myp-kiosk.conf
|
|
||||||
|
|
||||||
echo "Kiosk-Modus deaktiviert. System neu starten für normalen Desktop."
|
|
||||||
EOF
|
|
||||||
|
|
||||||
chmod +x /opt/myp/scripts/emergency-restore.sh
|
|
||||||
|
|
||||||
log_success "MYP Kiosk Installation abgeschlossen!"
|
|
||||||
log_info "Nächste Schritte:"
|
|
||||||
log_info "1. Backend-Code nach /opt/myp/backend kopieren"
|
|
||||||
log_info "2. Python Virtual Environment einrichten"
|
|
||||||
log_info "3. SSL-Zertifikate konfigurieren"
|
|
||||||
log_info "4. System neu starten: sudo reboot"
|
|
||||||
log_warning "Notfall-Wiederherstellung: /opt/myp/scripts/emergency-restore.sh"
|
|
@@ -1,95 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# MYP Kiosk Start Script
|
|
||||||
# Startet Chrome im sicheren Kiosk-Modus ohne Desktop-Zugriff
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Logging-Funktion
|
|
||||||
log() {
|
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S') [KIOSK] $1" | systemd-cat -t myp-kiosk
|
|
||||||
}
|
|
||||||
|
|
||||||
log "Starte MYP Kiosk-Modus..."
|
|
||||||
|
|
||||||
# Warte auf Backend-Verfügbarkeit
|
|
||||||
BACKEND_URL="https://localhost:443"
|
|
||||||
MAX_RETRIES=30
|
|
||||||
RETRY_COUNT=0
|
|
||||||
|
|
||||||
while ! curl -k -s "$BACKEND_URL" > /dev/null 2>&1; do
|
|
||||||
if [ $RETRY_COUNT -ge $MAX_RETRIES ]; then
|
|
||||||
log "FEHLER: Backend nicht erreichbar nach $MAX_RETRIES Versuchen"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
log "Warte auf Backend... Versuch $((RETRY_COUNT + 1))/$MAX_RETRIES"
|
|
||||||
sleep 2
|
|
||||||
((RETRY_COUNT++))
|
|
||||||
done
|
|
||||||
|
|
||||||
log "Backend ist verfügbar, starte Chrome Kiosk..."
|
|
||||||
|
|
||||||
# Beende alle laufenden Chrome-Prozesse
|
|
||||||
pkill -f "google-chrome" || true
|
|
||||||
pkill -f "chromium" || true
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
# Lösche Chrome-Cache und temporäre Dateien
|
|
||||||
rm -rf /home/myp/.cache/google-chrome/* 2>/dev/null || true
|
|
||||||
rm -rf /home/myp/.config/google-chrome/Default/Web\ Data* 2>/dev/null || true
|
|
||||||
rm -rf /home/myp/.config/google-chrome/Default/History* 2>/dev/null || true
|
|
||||||
|
|
||||||
# Erstelle Chrome-Konfigurationsverzeichnis falls nicht vorhanden
|
|
||||||
mkdir -p /home/myp/.config/google-chrome/Default
|
|
||||||
|
|
||||||
# Chrome Kiosk-Konfiguration
|
|
||||||
CHROME_OPTS=(
|
|
||||||
--kiosk
|
|
||||||
--no-sandbox
|
|
||||||
--disable-dev-shm-usage
|
|
||||||
--disable-gpu-sandbox
|
|
||||||
--disable-software-rasterizer
|
|
||||||
--disable-background-timer-throttling
|
|
||||||
--disable-backgrounding-occluded-windows
|
|
||||||
--disable-renderer-backgrounding
|
|
||||||
--disable-features=TranslateUI,BlinkGenPropertyTrees
|
|
||||||
--disable-ipc-flooding-protection
|
|
||||||
--disable-default-apps
|
|
||||||
--disable-extensions
|
|
||||||
--disable-plugins
|
|
||||||
--disable-sync
|
|
||||||
--disable-translate
|
|
||||||
--disable-background-networking
|
|
||||||
--disable-background-downloads
|
|
||||||
--disable-add-to-shelf
|
|
||||||
--disable-first-run-ui
|
|
||||||
--disable-infobars
|
|
||||||
--disable-notifications
|
|
||||||
--disable-password-generation
|
|
||||||
--disable-password-manager-reauthentication
|
|
||||||
--disable-permissions-api
|
|
||||||
--disable-popup-blocking
|
|
||||||
--disable-print-preview
|
|
||||||
--disable-prompt-on-repost
|
|
||||||
--disable-session-crashed-bubble
|
|
||||||
--disable-system-notifications
|
|
||||||
--disable-web-security
|
|
||||||
--no-default-browser-check
|
|
||||||
--no-first-run
|
|
||||||
--no-pings
|
|
||||||
--no-zygote
|
|
||||||
--single-process
|
|
||||||
--incognito
|
|
||||||
--disable-pinch
|
|
||||||
--overscroll-history-navigation=0
|
|
||||||
--disable-touch-editing
|
|
||||||
--disable-touch-drag-drop
|
|
||||||
--disable-pull-to-refresh-effect
|
|
||||||
--user-data-dir=/home/myp/.config/google-chrome
|
|
||||||
--app="$BACKEND_URL"
|
|
||||||
)
|
|
||||||
|
|
||||||
log "Starte Chrome mit Kiosk-Optionen..."
|
|
||||||
|
|
||||||
# Starte Chrome im Kiosk-Modus
|
|
||||||
exec /usr/bin/google-chrome "${CHROME_OPTS[@]}" 2>&1 | systemd-cat -t myp-kiosk
|
|
@@ -1,11 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Chromium Kiosk
|
|
||||||
PartOf=graphical-session.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=forking
|
|
||||||
ExecStart=/home/pi/kiosk.sh
|
|
||||||
Restart=on-abort
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=xsession.target
|
|
@@ -1,48 +1,14 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=MYP Backend Service (Python 3.11)
|
Description=MYP Backend Python Service
|
||||||
Documentation=https://github.com/myp-project/backend
|
After=network.target
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
Before=myp-kiosk.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=myp
|
User=user
|
||||||
Group=myp
|
|
||||||
WorkingDirectory=/opt/myp/backend/app
|
WorkingDirectory=/opt/myp/backend/app
|
||||||
Environment=PYTHONPATH=/opt/myp/backend/app
|
ExecStart=/usr/bin/python3.11 app.py --host 192.168.0.105 --port 80
|
||||||
Environment=FLASK_ENV=production
|
|
||||||
Environment=FLASK_APP=app.py
|
|
||||||
Environment=PYTHONUNBUFFERED=1
|
|
||||||
Environment=PYTHONDONTWRITEBYTECODE=1
|
|
||||||
ExecStartPre=/bin/sleep 5
|
|
||||||
ExecStart=/opt/myp/backend/venv/bin/python3.11 app.py --host 0.0.0.0 --port 443 --cert certs/backend.crt --key certs/backend.key
|
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=5
|
||||||
TimeoutStartSec=60
|
|
||||||
TimeoutStopSec=30
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal
|
|
||||||
SyslogIdentifier=myp-backend
|
|
||||||
|
|
||||||
# Sicherheitseinstellungen
|
|
||||||
NoNewPrivileges=true
|
|
||||||
PrivateTmp=true
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=true
|
|
||||||
ProtectKernelTunables=true
|
|
||||||
ProtectKernelModules=true
|
|
||||||
ProtectControlGroups=true
|
|
||||||
RestrictRealtime=true
|
|
||||||
RestrictSUIDSGID=true
|
|
||||||
ReadWritePaths=/opt/myp/backend/app/logs
|
|
||||||
ReadWritePaths=/opt/myp/backend/app/database
|
|
||||||
ReadWritePaths=/opt/myp/backend/app/uploads
|
|
||||||
|
|
||||||
# Ressourcenlimits
|
|
||||||
MemoryMax=1G
|
|
||||||
CPUQuota=80%
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
@@ -1,37 +1,16 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=MYP Kiosk Mode (Chrome Vollbild)
|
Description=MYP Kiosk Chromium Service
|
||||||
Documentation=https://github.com/myp-project/kiosk
|
|
||||||
After=graphical-session.target myp-backend.service
|
After=graphical-session.target myp-backend.service
|
||||||
Wants=graphical-session.target
|
Wants=graphical-session.target
|
||||||
Requires=myp-backend.service
|
|
||||||
PartOf=graphical-session.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=myp
|
User=user
|
||||||
Group=myp
|
|
||||||
Environment=DISPLAY=:0
|
Environment=DISPLAY=:0
|
||||||
Environment=XAUTHORITY=/home/myp/.Xauthority
|
|
||||||
WorkingDirectory=/home/myp
|
|
||||||
ExecStartPre=/bin/sleep 10
|
ExecStartPre=/bin/sleep 10
|
||||||
ExecStartPre=/usr/bin/xset -dpms
|
ExecStart=/usr/bin/chromium-browser --kiosk --no-sandbox --disable-infobars --disable-session-crashed-bubble --disable-restore-session-state http://192.168.0.105
|
||||||
ExecStartPre=/usr/bin/xset s off
|
|
||||||
ExecStartPre=/usr/bin/xset s noblank
|
|
||||||
ExecStart=/opt/myp/scripts/kiosk-start.sh
|
|
||||||
ExecStop=/usr/bin/pkill -f "google-chrome.*kiosk"
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
TimeoutStartSec=30
|
|
||||||
TimeoutStopSec=10
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal
|
|
||||||
SyslogIdentifier=myp-kiosk
|
|
||||||
|
|
||||||
# Sicherheitseinstellungen
|
|
||||||
NoNewPrivileges=true
|
|
||||||
PrivateTmp=true
|
|
||||||
ProtectHome=false
|
|
||||||
ProtectSystem=true
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=graphical-session.target
|
WantedBy=graphical-session.target
|
@@ -1,14 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=MYP Flask Backend (Python 3.11)
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=pi
|
|
||||||
WorkingDirectory=/opt/myp
|
|
||||||
ExecStart=/opt/myp/.venv/bin/python3.11 /opt/myp/app.py
|
|
||||||
Restart=always
|
|
||||||
Environment=PYTHONUNBUFFERED=1
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@@ -1,210 +0,0 @@
|
|||||||
# MYP Backend Setup Script für Windows
|
|
||||||
# Richtet das Python 3.11 Backend nach der Kiosk-Installation ein
|
|
||||||
|
|
||||||
param(
|
|
||||||
[string]$InstallPath = "C:\MYP"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Prüfe Administrator-Rechte
|
|
||||||
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
|
||||||
Write-Error "Dieses Skript muss als Administrator ausgeführt werden"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Starte MYP Backend Setup..." -ForegroundColor Blue
|
|
||||||
|
|
||||||
# Prüfe ob Kiosk-Installation vorhanden ist
|
|
||||||
if (!(Test-Path "$InstallPath")) {
|
|
||||||
Write-Error "Kiosk-Installation nicht gefunden. Führe zuerst install-kiosk.ps1 aus."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Kopiere Backend-Code
|
|
||||||
Write-Host "Kopiere Backend-Code..." -ForegroundColor Yellow
|
|
||||||
$currentDir = Get-Location
|
|
||||||
$appPath = Join-Path $currentDir.Path "..\app"
|
|
||||||
$requirementsPath = Join-Path $currentDir.Path "..\requirements.txt"
|
|
||||||
|
|
||||||
if (Test-Path $appPath) {
|
|
||||||
Copy-Item -Path $appPath -Destination "$InstallPath\backend\" -Recurse -Force
|
|
||||||
Copy-Item -Path $requirementsPath -Destination "$InstallPath\backend\" -Force
|
|
||||||
Write-Host "Backend-Code kopiert" -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Error "Backend-Code nicht gefunden. Stelle sicher, dass das Skript aus dem install-Verzeichnis ausgeführt wird."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle Python Virtual Environment
|
|
||||||
Write-Host "Erstelle Python 3.11 Virtual Environment..." -ForegroundColor Yellow
|
|
||||||
Set-Location "$InstallPath\backend"
|
|
||||||
|
|
||||||
# Finde Python 3.11
|
|
||||||
$python311 = Get-Command python3.11 -ErrorAction SilentlyContinue
|
|
||||||
if (!$python311) {
|
|
||||||
$python311 = Get-Command python -ErrorAction SilentlyContinue | Where-Object { $_.Version.Major -eq 3 -and $_.Version.Minor -eq 11 }
|
|
||||||
}
|
|
||||||
if (!$python311) {
|
|
||||||
Write-Error "Python 3.11 nicht gefunden. Installiere Python 3.11 zuerst."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle Virtual Environment
|
|
||||||
& $python311.Source -m venv venv
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
Write-Error "Fehler beim Erstellen des Virtual Environment"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Aktiviere Virtual Environment
|
|
||||||
& ".\venv\Scripts\Activate.ps1"
|
|
||||||
|
|
||||||
# Installiere Python-Abhängigkeiten
|
|
||||||
Write-Host "Installiere Python-Abhängigkeiten..." -ForegroundColor Yellow
|
|
||||||
& python -m pip install --upgrade pip
|
|
||||||
& pip install -r requirements.txt
|
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
Write-Error "Fehler beim Installieren der Python-Abhängigkeiten"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle SSL-Zertifikate falls nicht vorhanden
|
|
||||||
Write-Host "Erstelle SSL-Zertifikate..." -ForegroundColor Yellow
|
|
||||||
$certsPath = "$InstallPath\backend\app\certs"
|
|
||||||
New-Item -ItemType Directory -Path $certsPath -Force | Out-Null
|
|
||||||
|
|
||||||
$certFile = "$certsPath\backend.crt"
|
|
||||||
$keyFile = "$certsPath\backend.key"
|
|
||||||
|
|
||||||
if (!(Test-Path $certFile) -or !(Test-Path $keyFile)) {
|
|
||||||
Write-Host "Generiere selbstsignierte SSL-Zertifikate..." -ForegroundColor Yellow
|
|
||||||
|
|
||||||
# Prüfe ob OpenSSL verfügbar ist
|
|
||||||
$openssl = Get-Command openssl -ErrorAction SilentlyContinue
|
|
||||||
if ($openssl) {
|
|
||||||
& openssl req -x509 -newkey rsa:4096 -keyout $keyFile -out $certFile -days 365 -nodes -subj "/C=DE/ST=State/L=City/O=MYP/OU=Backend/CN=localhost"
|
|
||||||
} else {
|
|
||||||
# Verwende PowerShell für Zertifikatserstellung
|
|
||||||
$cert = New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My" -KeyUsage DigitalSignature,KeyEncipherment -KeyAlgorithm RSA -KeyLength 4096 -NotAfter (Get-Date).AddDays(365)
|
|
||||||
|
|
||||||
# Exportiere Zertifikat
|
|
||||||
$certPassword = ConvertTo-SecureString -String "myp-backend" -Force -AsPlainText
|
|
||||||
Export-PfxCertificate -Cert $cert -FilePath "$certsPath\backend.pfx" -Password $certPassword | Out-Null
|
|
||||||
|
|
||||||
# Konvertiere zu PEM-Format (vereinfacht)
|
|
||||||
$certBase64 = [Convert]::ToBase64String($cert.RawData)
|
|
||||||
$certPem = "-----BEGIN CERTIFICATE-----`n"
|
|
||||||
for ($i = 0; $i -lt $certBase64.Length; $i += 64) {
|
|
||||||
$line = $certBase64.Substring($i, [Math]::Min(64, $certBase64.Length - $i))
|
|
||||||
$certPem += "$line`n"
|
|
||||||
}
|
|
||||||
$certPem += "-----END CERTIFICATE-----"
|
|
||||||
$certPem | Out-File -FilePath $certFile -Encoding ASCII
|
|
||||||
|
|
||||||
Write-Host "Zertifikat erstellt (vereinfachtes Format)" -ForegroundColor Yellow
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Warning "Selbstsignierte Zertifikate erstellt. Für Produktion echte Zertifikate verwenden."
|
|
||||||
} else {
|
|
||||||
Write-Host "SSL-Zertifikate bereits vorhanden" -ForegroundColor Green
|
|
||||||
}
|
|
||||||
|
|
||||||
# Initialisiere Datenbank
|
|
||||||
Write-Host "Initialisiere Datenbank..." -ForegroundColor Yellow
|
|
||||||
Set-Location "$InstallPath\backend\app"
|
|
||||||
if (Test-Path "init_db.py") {
|
|
||||||
& python init_db.py
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-Host "Datenbank initialisiert" -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Warning "Fehler bei Datenbankinitialisierung"
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Warning "init_db.py nicht gefunden, überspringe Datenbankinitialisierung"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle Log-Verzeichnisse
|
|
||||||
Write-Host "Erstelle Log-Verzeichnisse..." -ForegroundColor Yellow
|
|
||||||
$logDirs = @("app", "auth", "errors", "jobs", "printers", "scheduler")
|
|
||||||
foreach ($dir in $logDirs) {
|
|
||||||
New-Item -ItemType Directory -Path "$InstallPath\backend\app\logs\$dir" -Force | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle Backup-Verzeichnis
|
|
||||||
New-Item -ItemType Directory -Path "$InstallPath\backend\app\database\backups" -Force | Out-Null
|
|
||||||
|
|
||||||
# Teste Backend-Konfiguration
|
|
||||||
Write-Host "Teste Backend-Konfiguration..." -ForegroundColor Yellow
|
|
||||||
try {
|
|
||||||
& python -c "import app; print('Backend-Import erfolgreich')"
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-Host "Backend-Konfiguration gültig" -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Error "Backend-Konfiguration fehlerhaft"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
Write-Error "Fehler beim Testen der Backend-Konfiguration: $_"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Erstelle Windows-Service für Backend
|
|
||||||
Write-Host "Erstelle Windows-Service..." -ForegroundColor Yellow
|
|
||||||
$serviceScript = @"
|
|
||||||
# MYP Backend Windows Service
|
|
||||||
`$BackendPath = "$InstallPath\backend\app"
|
|
||||||
`$VenvPath = "$InstallPath\backend\venv"
|
|
||||||
|
|
||||||
# Aktiviere Virtual Environment
|
|
||||||
& "`$VenvPath\Scripts\Activate.ps1"
|
|
||||||
|
|
||||||
# Wechsle ins App-Verzeichnis
|
|
||||||
Set-Location `$BackendPath
|
|
||||||
|
|
||||||
# Starte Backend
|
|
||||||
& python app.py --host 0.0.0.0 --port 443 --cert certs/backend.crt --key certs/backend.key
|
|
||||||
"@
|
|
||||||
|
|
||||||
$serviceScript | Out-File -FilePath "$InstallPath\scripts\backend-service.ps1" -Encoding UTF8
|
|
||||||
|
|
||||||
# Teste Backend-Start
|
|
||||||
Write-Host "Teste Backend-Start..." -ForegroundColor Yellow
|
|
||||||
$backendJob = Start-Job -ScriptBlock {
|
|
||||||
param($InstallPath)
|
|
||||||
Set-Location "$InstallPath\backend\app"
|
|
||||||
& "$InstallPath\backend\venv\Scripts\python.exe" -c "
|
|
||||||
import app
|
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
|
|
||||||
def start_app():
|
|
||||||
try:
|
|
||||||
app.app.run(host='0.0.0.0', port=8080, debug=False, ssl_context='adhoc')
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
thread = threading.Thread(target=start_app)
|
|
||||||
thread.daemon = True
|
|
||||||
thread.start()
|
|
||||||
time.sleep(5)
|
|
||||||
print('Backend-Test abgeschlossen')
|
|
||||||
"
|
|
||||||
} -ArgumentList $InstallPath
|
|
||||||
|
|
||||||
Wait-Job $backendJob -Timeout 15 | Out-Null
|
|
||||||
$result = Receive-Job $backendJob
|
|
||||||
Remove-Job $backendJob -Force
|
|
||||||
|
|
||||||
if ($result -like "*Backend-Test abgeschlossen*") {
|
|
||||||
Write-Host "Backend-Test erfolgreich" -ForegroundColor Green
|
|
||||||
} else {
|
|
||||||
Write-Warning "Backend-Test unvollständig, aber Installation fortgesetzt"
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "MYP Backend Setup abgeschlossen!" -ForegroundColor Green
|
|
||||||
Write-Host "Backend-Pfad: $InstallPath\backend" -ForegroundColor White
|
|
||||||
Write-Host "Nächste Schritte:" -ForegroundColor Yellow
|
|
||||||
Write-Host "1. System neu starten für Kiosk-Modus" -ForegroundColor White
|
|
||||||
Write-Host "2. Backend wird automatisch auf https://localhost:443 gestartet" -ForegroundColor White
|
|
||||||
Write-Host "3. Chrome Kiosk öffnet automatisch die Anwendung" -ForegroundColor White
|
|
||||||
Write-Host "Notfall-Wiederherstellung: Desktop-Verknüpfung verwenden" -ForegroundColor Red
|
|
@@ -1,144 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# MYP Backend Setup Script
|
|
||||||
# Richtet das Python 3.11 Backend nach der Kiosk-Installation ein
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Farben für Output
|
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
# Logging-Funktionen
|
|
||||||
log_info() {
|
|
||||||
echo -e "${BLUE}[INFO]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_success() {
|
|
||||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_warning() {
|
|
||||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
log_error() {
|
|
||||||
echo -e "${RED}[ERROR]${NC} $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prüfe Root-Rechte
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
|
||||||
log_error "Dieses Skript muss als root ausgeführt werden"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
log_info "Starte MYP Backend Setup..."
|
|
||||||
|
|
||||||
# Prüfe ob Kiosk-Installation vorhanden ist
|
|
||||||
if [ ! -d "/opt/myp" ]; then
|
|
||||||
log_error "Kiosk-Installation nicht gefunden. Führe zuerst install-kiosk.sh aus."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Kopiere Backend-Code
|
|
||||||
log_info "Kopiere Backend-Code..."
|
|
||||||
if [ -d "$(pwd)/../app" ]; then
|
|
||||||
cp -r "$(pwd)/../app" /opt/myp/backend/
|
|
||||||
cp "$(pwd)/../requirements.txt" /opt/myp/backend/
|
|
||||||
else
|
|
||||||
log_error "Backend-Code nicht gefunden. Stelle sicher, dass das Skript aus dem install-Verzeichnis ausgeführt wird."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Erstelle Python Virtual Environment
|
|
||||||
log_info "Erstelle Python 3.11 Virtual Environment..."
|
|
||||||
cd /opt/myp/backend
|
|
||||||
python3.11 -m venv venv
|
|
||||||
source venv/bin/activate
|
|
||||||
|
|
||||||
# Installiere Python-Abhängigkeiten
|
|
||||||
log_info "Installiere Python-Abhängigkeiten..."
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Erstelle SSL-Zertifikate falls nicht vorhanden
|
|
||||||
log_info "Erstelle SSL-Zertifikate..."
|
|
||||||
mkdir -p /opt/myp/backend/app/certs
|
|
||||||
cd /opt/myp/backend/app/certs
|
|
||||||
|
|
||||||
if [ ! -f "backend.crt" ] || [ ! -f "backend.key" ]; then
|
|
||||||
log_info "Generiere selbstsignierte SSL-Zertifikate..."
|
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout backend.key -out backend.crt -days 365 -nodes \
|
|
||||||
-subj "/C=DE/ST=State/L=City/O=MYP/OU=Backend/CN=localhost"
|
|
||||||
log_warning "Selbstsignierte Zertifikate erstellt. Für Produktion echte Zertifikate verwenden."
|
|
||||||
else
|
|
||||||
log_info "SSL-Zertifikate bereits vorhanden"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialisiere Datenbank
|
|
||||||
log_info "Initialisiere Datenbank..."
|
|
||||||
cd /opt/myp/backend/app
|
|
||||||
if [ -f "init_db.py" ]; then
|
|
||||||
python init_db.py
|
|
||||||
log_success "Datenbank initialisiert"
|
|
||||||
else
|
|
||||||
log_warning "init_db.py nicht gefunden, überspringe Datenbankinitialisierung"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setze Berechtigungen
|
|
||||||
log_info "Setze Berechtigungen..."
|
|
||||||
chown -R myp:myp /opt/myp/backend
|
|
||||||
chmod -R 755 /opt/myp/backend
|
|
||||||
chmod 600 /opt/myp/backend/app/certs/backend.key
|
|
||||||
chmod 644 /opt/myp/backend/app/certs/backend.crt
|
|
||||||
|
|
||||||
# Erstelle Log-Verzeichnisse
|
|
||||||
log_info "Erstelle Log-Verzeichnisse..."
|
|
||||||
mkdir -p /opt/myp/backend/app/logs/{app,auth,errors,jobs,printers,scheduler}
|
|
||||||
chown -R myp:myp /opt/myp/backend/app/logs
|
|
||||||
|
|
||||||
# Erstelle Backup-Verzeichnis
|
|
||||||
log_info "Erstelle Backup-Verzeichnis..."
|
|
||||||
mkdir -p /opt/myp/backend/app/database/backups
|
|
||||||
chown -R myp:myp /opt/myp/backend/app/database
|
|
||||||
|
|
||||||
# Teste Backend-Start
|
|
||||||
log_info "Teste Backend-Konfiguration..."
|
|
||||||
cd /opt/myp/backend/app
|
|
||||||
if sudo -u myp /opt/myp/backend/venv/bin/python3.11 -c "import app; print('Backend-Import erfolgreich')"; then
|
|
||||||
log_success "Backend-Konfiguration gültig"
|
|
||||||
else
|
|
||||||
log_error "Backend-Konfiguration fehlerhaft"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Starte Services
|
|
||||||
log_info "Starte MYP Services..."
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl start myp-backend.service
|
|
||||||
systemctl start myp-monitor.service
|
|
||||||
|
|
||||||
# Warte auf Backend-Start
|
|
||||||
log_info "Warte auf Backend-Start..."
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
# Teste Backend-Verfügbarkeit
|
|
||||||
if curl -k -s https://localhost:443 > /dev/null 2>&1; then
|
|
||||||
log_success "Backend erfolgreich gestartet und erreichbar"
|
|
||||||
else
|
|
||||||
log_error "Backend nicht erreichbar, prüfe Logs: journalctl -u myp-backend.service"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Zeige Service-Status
|
|
||||||
log_info "Service-Status:"
|
|
||||||
systemctl status myp-backend.service --no-pager -l
|
|
||||||
systemctl status myp-monitor.service --no-pager -l
|
|
||||||
|
|
||||||
log_success "MYP Backend Setup abgeschlossen!"
|
|
||||||
log_info "Backend läuft auf: https://localhost:443"
|
|
||||||
log_info "Logs anzeigen: journalctl -u myp-backend.service -f"
|
|
||||||
log_info "Kiosk-Modus starten: sudo reboot"
|
|
@@ -1,31 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=MYP Reservation Platform Backend (Python 3.11)
|
|
||||||
After=network.target
|
|
||||||
Wants=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=user
|
|
||||||
Group=user
|
|
||||||
WorkingDirectory=/home/user/Projektarbeit-MYP/backend/app
|
|
||||||
Environment=PYTHONPATH=/home/user/Projektarbeit-MYP/backend/app
|
|
||||||
Environment=FLASK_ENV=production
|
|
||||||
Environment=FLASK_APP=app.py
|
|
||||||
Environment=PYTHONUNBUFFERED=1
|
|
||||||
ExecStart=/home/user/Projektarbeit-MYP/backend/venv/bin/python3.11 app.py --host 0.0.0.0 --port 443 --cert certs/backend.crt --key certs/backend.key
|
|
||||||
Restart=always
|
|
||||||
RestartSec=10
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal
|
|
||||||
SyslogIdentifier=myp-backend
|
|
||||||
|
|
||||||
# Security settings
|
|
||||||
NoNewPrivileges=true
|
|
||||||
PrivateTmp=true
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=true
|
|
||||||
ReadWritePaths=/home/user/Projektarbeit-MYP/backend/app/logs
|
|
||||||
ReadWritePaths=/home/user/Projektarbeit-MYP/backend/app/database
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
132
myp_installer.sh
132
myp_installer.sh
@@ -1156,92 +1156,38 @@ EOF
|
|||||||
echo -e "${GREEN}✓ Backend für Kiosk-Modus konfiguriert${NC}"
|
echo -e "${GREEN}✓ Backend für Kiosk-Modus konfiguriert${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Kiosk-Modus installieren (verbesserte Version)
|
# Kiosk-Modus installieren (Einfache Version ohne venv/nginx)
|
||||||
install_kiosk_mode() {
|
install_kiosk_mode() {
|
||||||
show_header "Kiosk-Modus Installation"
|
show_header "Kiosk-Modus Installation"
|
||||||
|
|
||||||
echo -e "${BLUE}MYP Kiosk-Modus (Backend Web Interface) installieren${NC}"
|
echo -e "${BLUE}MYP Kiosk-Modus - Einfache Installation${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${YELLOW}Der Kiosk-Modus nutzt das Backend Flask Web Interface${NC}"
|
echo -e "${YELLOW}Installiert Backend + Chromium Kiosk ohne venv oder nginx${NC}"
|
||||||
echo -e "${YELLOW}als vollständiges Kiosk-System für Touchscreen-Bedienung.${NC}"
|
echo -e "${YELLOW}Backend läuft auf 192.168.0.105:80, automatischer Login als 'user'${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Backend muss installiert sein
|
# Prüfe Root-Rechte
|
||||||
if [ ! -d "$VENV_DIR" ]; then
|
if [ $is_root -ne 1 ]; then
|
||||||
echo -e "${RED}✗ Backend ist nicht installiert. Bitte installieren Sie zuerst das Backend.${NC}"
|
echo -e "${RED}✗ Root-Rechte erforderlich für Kiosk-Installation${NC}"
|
||||||
read -p "Drücken Sie ENTER, um fortzufahren..."
|
read -p "Drücken Sie ENTER, um fortzufahren..."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prüfen ob Backend läuft
|
# Führe das einfache Kiosk-Installationsskript aus
|
||||||
if ! curl -k -s --max-time 5 https://localhost:443/ > /dev/null 2>&1; then
|
echo -e "${BLUE}Starte einfache Kiosk-Installation...${NC}"
|
||||||
echo -e "${YELLOW}⚠ Backend scheint nicht zu laufen. Stellen Sie sicher, dass das Backend gestartet ist.${NC}"
|
cd "$PROJECT_DIR/backend/install"
|
||||||
echo -e "${BLUE}Backend starten mit: cd $APP_DIR && python3.11 app.py${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${GREEN}✓ Backend ist verfügbar${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Virtual Environment aktivieren
|
if [ ! -f "install-kiosk.sh" ]; then
|
||||||
source "$VENV_DIR/bin/activate"
|
echo -e "${RED}✗ Kiosk-Installationsskript nicht gefunden${NC}"
|
||||||
cd "$APP_DIR"
|
|
||||||
|
|
||||||
# Kiosk-Konfiguration sicherstellen
|
|
||||||
echo -e "${BLUE}1. Kiosk-Konfiguration sicherstellen...${NC}"
|
|
||||||
configure_backend_for_kiosk
|
|
||||||
|
|
||||||
# Systemd Service für automatischen Browser-Start
|
|
||||||
if [ $is_root -eq 1 ]; then
|
|
||||||
echo -e "${BLUE}2. Automatischen Kiosk-Start aktivieren...${NC}"
|
|
||||||
|
|
||||||
read -p "Soll der Kiosk-Browser automatisch beim System-Start gestartet werden? (j/n, Standard: n): " auto_start
|
|
||||||
if [ "$auto_start" = "j" ]; then
|
|
||||||
systemctl enable myp-kiosk-browser.service
|
|
||||||
echo -e "${GREEN}✓ Automatischer Kiosk-Start aktiviert${NC}"
|
|
||||||
echo -e "${BLUE}Der Browser startet automatisch nach dem nächsten Neustart${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW}⚠ Automatischer Start nicht aktiviert${NC}"
|
|
||||||
echo -e "${BLUE}Manuell aktivieren mit: sudo systemctl enable myp-kiosk-browser${NC}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "${YELLOW}⚠ Systemd-Service-Installation übersprungen (keine Root-Rechte)${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Kiosk jetzt starten (optional)
|
|
||||||
echo -e "${BLUE}3. Kiosk-Test...${NC}"
|
|
||||||
read -p "Möchten Sie den Kiosk-Modus jetzt testen? (j/n, Standard: n): " test_kiosk
|
|
||||||
if [ "$test_kiosk" = "j" ]; then
|
|
||||||
echo -e "${BLUE}Starte Kiosk-Test (Browser öffnet sich)...${NC}"
|
|
||||||
echo -e "${YELLOW}Drücken Sie F11 oder Alt+F4 um den Kiosk zu beenden${NC}"
|
|
||||||
sleep 3
|
|
||||||
"$APP_DIR/start_kiosk.sh" &
|
|
||||||
echo -e "${GREEN}✓ Kiosk-Browser gestartet${NC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
deactivate
|
|
||||||
cd "$PROJECT_DIR"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo -e "${GREEN}✓ Kiosk-Modus Installation abgeschlossen!${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${BLUE}🖥️ Kiosk-Modus verwenden:${NC}"
|
|
||||||
echo -e "${WHITE} - Backend starten: cd $APP_DIR && python app.py${NC}"
|
|
||||||
echo -e "${WHITE} - Kiosk manuell starten: $APP_DIR/start_kiosk.sh${NC}"
|
|
||||||
echo -e "${WHITE} - Systemd-Service: sudo systemctl start myp-kiosk-browser${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${BLUE}🌐 Kiosk-URLs:${NC}"
|
|
||||||
echo -e "${WHITE} - Hauptinterface: https://localhost:443/${NC}"
|
|
||||||
echo -e "${WHITE} - Dashboard: https://localhost:443/dashboard${NC}"
|
|
||||||
echo -e "${WHITE} - Drucker: https://localhost:443/printers${NC}"
|
|
||||||
echo -e "${WHITE} - Jobs: https://localhost:443/jobs${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${BLUE}🔧 Kiosk-Features:${NC}"
|
|
||||||
echo -e "${WHITE} - Vollbild-Web-Interface${NC}"
|
|
||||||
echo -e "${WHITE} - Touch-optimierte Bedienung${NC}"
|
|
||||||
echo -e "${WHITE} - Automatisches Login${NC}"
|
|
||||||
echo -e "${WHITE} - Deaktivierung mit Passwort: 744563017196A${NC}"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
read -p "Drücken Sie ENTER, um fortzufahren..."
|
read -p "Drücken Sie ENTER, um fortzufahren..."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod +x install-kiosk.sh
|
||||||
|
./install-kiosk.sh
|
||||||
|
|
||||||
|
# Das Skript startet automatisch neu, daher wird dieser Code nicht erreicht
|
||||||
|
echo -e "${GREEN}✓ Kiosk-Installation abgeschlossen${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Frontend installieren
|
# Frontend installieren
|
||||||
@@ -2406,32 +2352,30 @@ show_main_menu() {
|
|||||||
show_header "🎯 MYP Control Center - Hauptmenü"
|
show_header "🎯 MYP Control Center - Hauptmenü"
|
||||||
|
|
||||||
echo -e "${WHITE}🚀 Schnell-Installation:${NC}"
|
echo -e "${WHITE}🚀 Schnell-Installation:${NC}"
|
||||||
echo -e "${WHITE}1. 🖥️ Server-spezifische Installation (Empfohlen)${NC}"
|
echo -e "${WHITE}1. 🖥️ Kiosk-Modus installieren (Einfach - Backend + Chromium)${NC}"
|
||||||
echo -e "${WHITE}2. 🔧 Vollständige Installation (Backend + Frontend)${NC}"
|
echo -e "${WHITE}2. 🔧 Vollständige Installation (Backend + Frontend)${NC}"
|
||||||
echo -e "${WHITE}3. 🥧 Backend-Only Installation (mit Kiosk Web Interface)${NC}"
|
echo -e "${WHITE}3. 🥧 Backend-Only Installation${NC}"
|
||||||
echo -e "${WHITE}4. 🌐 Frontend-Only Installation${NC}"
|
echo -e "${WHITE}4. 🌐 Frontend-Only Installation${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${WHITE}⚙️ Granulare Installation:${NC}"
|
echo -e "${WHITE}⚙️ Granulare Installation:${NC}"
|
||||||
echo -e "${WHITE}5. Backend installieren (Flask API + Web Interface)${NC}"
|
echo -e "${WHITE}5. Backend installieren (Flask API + Web Interface)${NC}"
|
||||||
echo -e "${WHITE}6. Frontend installieren (Next.js)${NC}"
|
echo -e "${WHITE}6. Frontend installieren (Next.js)${NC}"
|
||||||
echo -e "${WHITE}7. Kiosk-Modus installieren (Backend Web Interface + Browser)${NC}"
|
echo -e "${WHITE}7. System-Abhängigkeiten installieren${NC}"
|
||||||
echo -e "${WHITE}8. Produktions-Setup (Backend + Kiosk Web Interface)${NC}"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${WHITE}🛠️ Entwicklung & Wartung:${NC}"
|
echo -e "${WHITE}🛠️ Entwicklung & Wartung:${NC}"
|
||||||
echo -e "${WHITE}9. Entwicklungs-Setup${NC}"
|
echo -e "${WHITE}8. Entwicklungs-Setup${NC}"
|
||||||
echo -e "${WHITE}10. System-Abhängigkeiten installieren${NC}"
|
echo -e "${WHITE}9. SSL-Zertifikate generieren${NC}"
|
||||||
echo -e "${WHITE}11. SSL-Zertifikate generieren${NC}"
|
echo -e "${WHITE}10. Logs anzeigen${NC}"
|
||||||
echo -e "${WHITE}12. Logs anzeigen${NC}"
|
echo -e "${WHITE}11. Services verwalten${NC}"
|
||||||
echo -e "${WHITE}13. Services verwalten${NC}"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${WHITE}0. Beenden${NC}"
|
echo -e "${WHITE}0. Beenden${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
read -p "Wählen Sie eine Option (0-13): " choice
|
read -p "Wählen Sie eine Option (0-11): " choice
|
||||||
|
|
||||||
case $choice in
|
case $choice in
|
||||||
1)
|
1)
|
||||||
show_server_specific_menu
|
install_kiosk_mode
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
install_full_setup
|
install_full_setup
|
||||||
@@ -2449,24 +2393,18 @@ show_main_menu() {
|
|||||||
install_frontend
|
install_frontend
|
||||||
;;
|
;;
|
||||||
7)
|
7)
|
||||||
install_kiosk_mode
|
|
||||||
;;
|
|
||||||
8)
|
|
||||||
install_production_setup
|
|
||||||
;;
|
|
||||||
9)
|
|
||||||
install_development_setup
|
|
||||||
;;
|
|
||||||
10)
|
|
||||||
install_system_dependencies
|
install_system_dependencies
|
||||||
;;
|
;;
|
||||||
11)
|
8)
|
||||||
|
install_development_setup
|
||||||
|
;;
|
||||||
|
9)
|
||||||
generate_ssl_certificates
|
generate_ssl_certificates
|
||||||
;;
|
;;
|
||||||
12)
|
10)
|
||||||
show_logs
|
show_logs
|
||||||
;;
|
;;
|
||||||
13)
|
11)
|
||||||
manage_services
|
manage_services
|
||||||
;;
|
;;
|
||||||
0)
|
0)
|
||||||
|
Reference in New Issue
Block a user