"feat: Update dependencies in requirements.txt and installer script"
This commit is contained in:
@@ -16,7 +16,7 @@ SQLAlchemy==2.0.41
|
|||||||
# Smart Plug Steuerung (Tapo)
|
# Smart Plug Steuerung (Tapo)
|
||||||
# HINWEIS: Version 0.1.2 ist die letzte stabile Version
|
# HINWEIS: Version 0.1.2 ist die letzte stabile Version
|
||||||
# Version 0.1.4 hat bekannte Authentifizierungsprobleme mit neuerer Tapo-Firmware
|
# Version 0.1.4 hat bekannte Authentifizierungsprobleme mit neuerer Tapo-Firmware
|
||||||
PyP100==0.1.2
|
PyP100
|
||||||
|
|
||||||
# Passwort-Hashing
|
# Passwort-Hashing
|
||||||
Werkzeug==3.0.1
|
Werkzeug==3.0.1
|
||||||
|
@@ -20,7 +20,7 @@ requests==2.31.0
|
|||||||
urllib3==2.0.4
|
urllib3==2.0.4
|
||||||
|
|
||||||
# Smart Plug Control (Tapo)
|
# Smart Plug Control (Tapo)
|
||||||
PyP100==0.1.2
|
PyP100
|
||||||
|
|
||||||
# System Monitoring
|
# System Monitoring
|
||||||
psutil==5.9.5
|
psutil==5.9.5
|
||||||
|
@@ -139,15 +139,62 @@ install_production_backend() {
|
|||||||
chmod 600 app/certs/backend.key
|
chmod 600 app/certs/backend.key
|
||||||
chmod 644 app/certs/backend.crt
|
chmod 644 app/certs/backend.crt
|
||||||
|
|
||||||
# Systemd Service installieren
|
# Alte Services entfernen und neue systemd Services installieren
|
||||||
if [ $is_root -eq 1 ]; then
|
if [ $is_root -eq 1 ]; then
|
||||||
prod_log_info "Installiere systemd Service..."
|
prod_log_info "Entferne alte Services..."
|
||||||
cp myp.service /etc/systemd/system/
|
# Alte Services stoppen und deaktivieren
|
||||||
|
for old_service in "myp.service" "myp-platform.service" "myp-backend.service"; do
|
||||||
|
if systemctl is-enabled "$old_service" >/dev/null 2>&1; then
|
||||||
|
systemctl stop "$old_service" 2>/dev/null || true
|
||||||
|
systemctl disable "$old_service" 2>/dev/null || true
|
||||||
|
prod_log_info "Alter Service $old_service entfernt"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
prod_log_info "Installiere neuen systemd Service mit Python 3.11..."
|
||||||
|
|
||||||
|
# Neuen Service mit Python 3.11 erstellen
|
||||||
|
cat > "/etc/systemd/system/myp.service" << EOF
|
||||||
|
[Unit]
|
||||||
|
Description=MYP Reservation Platform Backend (Python 3.11)
|
||||||
|
After=network.target
|
||||||
|
Wants=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=$USER
|
||||||
|
Group=$USER
|
||||||
|
WorkingDirectory=$PROJECT_DIR/backend/app
|
||||||
|
Environment=PYTHONPATH=$PROJECT_DIR/backend/app
|
||||||
|
Environment=FLASK_ENV=production
|
||||||
|
Environment=FLASK_APP=app.py
|
||||||
|
Environment=PYTHONUNBUFFERED=1
|
||||||
|
ExecStart=$PROJECT_DIR/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=$PROJECT_DIR/backend/app/logs
|
||||||
|
ReadWritePaths=$PROJECT_DIR/backend/app/database
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable myp.service
|
systemctl enable myp.service
|
||||||
|
prod_log_success "Neuer systemd Service mit Python 3.11 installiert"
|
||||||
else
|
else
|
||||||
prod_log_warning "systemd Service-Installation übersprungen (keine Root-Rechte)"
|
prod_log_warning "systemd Service-Installation übersprungen (keine Root-Rechte)"
|
||||||
prod_log_info "Manuell ausführen: sudo cp backend/myp.service /etc/systemd/system/ && sudo systemctl daemon-reload && sudo systemctl enable myp.service"
|
prod_log_info "Manuell ausführen: sudo systemctl stop myp.service && sudo systemctl disable myp.service"
|
||||||
|
prod_log_info "Dann neuen Service erstellen mit Python 3.11 Pfad"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Datenbank initialisieren
|
# Datenbank initialisieren
|
||||||
@@ -578,18 +625,22 @@ setup_python_node_environment() {
|
|||||||
|
|
||||||
echo -e "${BLUE}1. Python-Umgebung prüfen...${NC}"
|
echo -e "${BLUE}1. Python-Umgebung prüfen...${NC}"
|
||||||
|
|
||||||
# Python prüfen
|
# Python 3.11 prüfen (erforderlich für MYP Backend)
|
||||||
python_cmd=""
|
python_cmd=""
|
||||||
if check_command python3; then
|
if check_command python3.11; then
|
||||||
|
python_cmd="python3.11"
|
||||||
|
python_version=$(python3.11 --version 2>&1)
|
||||||
|
echo -e "${GREEN}✓ $python_version${NC}"
|
||||||
|
elif check_command python3; then
|
||||||
python_cmd="python3"
|
python_cmd="python3"
|
||||||
python_version=$(python3 --version 2>&1)
|
python_version=$(python3 --version 2>&1)
|
||||||
echo -e "${GREEN}✓ $python_version${NC}"
|
echo -e "${YELLOW}⚠ $python_version gefunden, aber Python 3.11 wird empfohlen${NC}"
|
||||||
elif check_command python; then
|
elif check_command python; then
|
||||||
python_cmd="python"
|
python_cmd="python"
|
||||||
python_version=$(python --version 2>&1)
|
python_version=$(python --version 2>&1)
|
||||||
echo -e "${GREEN}✓ $python_version${NC}"
|
echo -e "${YELLOW}⚠ $python_version gefunden, aber Python 3.11 wird empfohlen${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${RED}✗ Python nicht gefunden${NC}"
|
echo -e "${RED}✗ Python nicht gefunden. Bitte installieren Sie Python 3.11${NC}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -639,16 +690,19 @@ install_backend() {
|
|||||||
echo -e "${BLUE}MYP Backend (Flask API + Web Interface) installieren${NC}"
|
echo -e "${BLUE}MYP Backend (Flask API + Web Interface) installieren${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Python prüfen
|
# Python 3.11 prüfen (erforderlich für MYP Backend)
|
||||||
python_cmd=""
|
python_cmd=""
|
||||||
if check_command python3; then
|
if check_command python3.11; then
|
||||||
|
python_cmd="python3.11"
|
||||||
|
echo -e "${GREEN}✓ Python 3.11 gefunden${NC}"
|
||||||
|
elif check_command python3; then
|
||||||
python_cmd="python3"
|
python_cmd="python3"
|
||||||
echo -e "${GREEN}✓ Python 3 gefunden${NC}"
|
echo -e "${YELLOW}⚠ Python 3 gefunden, aber Python 3.11 wird empfohlen${NC}"
|
||||||
elif check_command python; then
|
elif check_command python; then
|
||||||
python_cmd="python"
|
python_cmd="python"
|
||||||
echo -e "${GREEN}✓ Python gefunden${NC}"
|
echo -e "${YELLOW}⚠ Python gefunden, aber Python 3.11 wird empfohlen${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${RED}✗ Python nicht gefunden. Bitte installieren Sie Python 3.8+${NC}"
|
echo -e "${RED}✗ Python nicht gefunden. Bitte installieren Sie Python 3.11${NC}"
|
||||||
read -p "Drücken Sie ENTER, um fortzufahren..."
|
read -p "Drücken Sie ENTER, um fortzufahren..."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -908,7 +962,7 @@ install_kiosk_mode() {
|
|||||||
# Prüfen ob Backend läuft
|
# Prüfen ob Backend läuft
|
||||||
if ! curl -k -s --max-time 5 https://localhost:443/ > /dev/null 2>&1; then
|
if ! curl -k -s --max-time 5 https://localhost:443/ > /dev/null 2>&1; then
|
||||||
echo -e "${YELLOW}⚠ Backend scheint nicht zu laufen. Stellen Sie sicher, dass das Backend gestartet ist.${NC}"
|
echo -e "${YELLOW}⚠ Backend scheint nicht zu laufen. Stellen Sie sicher, dass das Backend gestartet ist.${NC}"
|
||||||
echo -e "${BLUE}Backend starten mit: cd $APP_DIR && python app.py${NC}"
|
echo -e "${BLUE}Backend starten mit: cd $APP_DIR && python3.11 app.py${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}✓ Backend ist verfügbar${NC}"
|
echo -e "${GREEN}✓ Backend ist verfügbar${NC}"
|
||||||
fi
|
fi
|
||||||
@@ -1599,7 +1653,7 @@ start_application() {
|
|||||||
if [ -d "$VENV_DIR" ]; then
|
if [ -d "$VENV_DIR" ]; then
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
source "$VENV_DIR/bin/activate"
|
source "$VENV_DIR/bin/activate"
|
||||||
python app.py &
|
python3.11 app.py &
|
||||||
echo -e "${GREEN}Backend gestartet: https://localhost:443${NC}"
|
echo -e "${GREEN}Backend gestartet: https://localhost:443${NC}"
|
||||||
deactivate
|
deactivate
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
@@ -1654,7 +1708,7 @@ start_debug_server() {
|
|||||||
if [ -d "$VENV_DIR" ]; then
|
if [ -d "$VENV_DIR" ]; then
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
source "$VENV_DIR/bin/activate"
|
source "$VENV_DIR/bin/activate"
|
||||||
python app.py --debug
|
python3.11 app.py --debug
|
||||||
deactivate
|
deactivate
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
else
|
else
|
||||||
@@ -1780,9 +1834,11 @@ create_ssl_certificates() {
|
|||||||
# SSL-Zertifikate mit Python und cryptography erstellen
|
# SSL-Zertifikate mit Python und cryptography erstellen
|
||||||
echo -e "${BLUE}Erstelle SSL-Zertifikate mit Python...${NC}"
|
echo -e "${BLUE}Erstelle SSL-Zertifikate mit Python...${NC}"
|
||||||
|
|
||||||
# Überprüfen, ob Python verfügbar ist
|
# Überprüfen, ob Python verfügbar ist (bevorzugt Python 3.11)
|
||||||
python_cmd=""
|
python_cmd=""
|
||||||
if check_command python3; then
|
if check_command python3.11; then
|
||||||
|
python_cmd="python3.11"
|
||||||
|
elif check_command python3; then
|
||||||
python_cmd="python3"
|
python_cmd="python3"
|
||||||
elif check_command python; then
|
elif check_command python; then
|
||||||
python_cmd="python"
|
python_cmd="python"
|
||||||
|
Reference in New Issue
Block a user