"feat: Update Raspberry Pi installation scripts and templates for calendar

This commit is contained in:
2025-05-29 16:10:49 +02:00
parent 7ce9294968
commit 147e9ecbde
3 changed files with 437 additions and 621 deletions

View File

@@ -144,16 +144,40 @@ sudo -u "$APP_USER" ./venv/bin/pip install --upgrade pip
# Installiere Python-Abhängigkeiten
log "Installiere Python-Abhängigkeiten..."
if [ -f "requirements.txt" ]; then
sudo -u "$APP_USER" ./venv/bin/pip install -r requirements.txt
# Erstelle korrigierte requirements.txt ohne Verweis auf andere Datei
cat > "$APP_DIR/requirements_fixed.txt" << 'EOF'
# MYP Platform - Python Dependencies
Flask==3.0.0
Flask-Login==0.6.3
Flask-WTF==1.2.1
Flask-Limiter==3.5.0
SQLAlchemy==2.0.41
PyP100
Werkzeug==3.0.1
bcrypt==4.1.2
redis==5.0.1
cryptography==42.0.8
pytest==7.4.3
pytest-cov==4.1.0
gunicorn==21.2.0
psutil==5.9.6
requests==2.31.0
Jinja2==3.1.2
MarkupSafe==2.1.3
itsdangerous==2.1.2
EOF
sudo -u "$APP_USER" ./venv/bin/pip install -r requirements_fixed.txt
else
# Fallback: Installiere grundlegende Pakete
sudo -u "$APP_USER" ./venv/bin/pip install \
flask \
flask-login \
flask-sqlalchemy \
flask-wtf \
flask-limiter \
sqlalchemy \
werkzeug \
requests \
python-dotenv \
gunicorn
fi
@@ -162,17 +186,25 @@ if [ -f "package.json" ]; then
log "Installiere Node.js Abhängigkeiten..."
sudo -u "$APP_USER" npm install
# Baue Frontend-Assets
# Baue Frontend-Assets falls Tailwind vorhanden
if [ -f "tailwind.config.js" ]; then
log "Baue Frontend-Assets..."
sudo -u "$APP_USER" npm run build || true
log "Baue Frontend-Assets mit Tailwind CSS..."
sudo -u "$APP_USER" npm run build:css || true
fi
fi
# Datenbank initialisieren
log "Initialisiere Datenbank..."
if [ -f "init_db.py" ]; then
sudo -u "$APP_USER" ./venv/bin/python init_db.py
if [ -f "models.py" ]; then
# Erstelle einfaches DB-Init-Skript
cat > "$APP_DIR/init_simple_db.py" << 'EOF'
from app import app, db
with app.app_context():
db.create_all()
print("Datenbank wurde initialisiert")
EOF
sudo -u "$APP_USER" ./venv/bin/python init_simple_db.py || true
rm -f "$APP_DIR/init_simple_db.py"
else
sudo -u "$APP_USER" touch database.db
fi