fix: systemd ohne ProtectHome (venv unter /root sichtbar) + Phase-3-Backend
Deployment-Fixes (Dienst startete nicht -> 203/EXEC "uvicorn not found"): - Unit ohne ProtectHome/ProtectSystem: Repo/venv dürfen unter /root oder /home liegen (ProtectHome=true blendete diese Pfade für den Dienst aus). - install.sh: Python-3.11+-Prüfung mit klarer Meldung; prüft nach der Installation, dass uvicorn wirklich in der venv liegt. - EZB-Kursabruf läuft beim Start jetzt im Hintergrund (blockiert den Start nie). Phase-3-Backend (Dashboard): - Modell + Migration 0004: dashboard_layouts (JSON-Layout je Nutzer). - routers/dashboard: Layout speichern/laden/zurücksetzen + Kartendaten (Budget-Donut, Budget-Fortschritt, Einnahmen/Ausgaben, Kontostände, Vermögensverlauf, letzte Buchungen). - Frontend-Infrastruktur: Chart-Komponenten (Donut/Line), palette, API-Methoden, react-grid-layout. (Dashboard-Seite folgt im nächsten Commit.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -1,8 +1,12 @@
|
||||
# Deployment (Proxmox-LXC + Nginx Proxy Manager)
|
||||
|
||||
> **Voraussetzung: Python 3.11+** – also ein **Debian-12-** oder **Ubuntu-24.04**-LXC
|
||||
> (Debian 11 hat nur Python 3.9 und wird nicht unterstützt). `install.sh` prüft das
|
||||
> und bricht mit einer klaren Meldung ab, falls die Version zu alt ist.
|
||||
|
||||
## Installation
|
||||
|
||||
Im LXC (Debian/Ubuntu) das Repo klonen und als root installieren:
|
||||
Im LXC (Debian 12 / Ubuntu 24.04) das Repo klonen und als root installieren:
|
||||
|
||||
```bash
|
||||
git clone <repo-url> /opt/certain-finance
|
||||
|
||||
@@ -21,10 +21,10 @@ ExecStart=/opt/certain-finance/backend/.venv/bin/uvicorn app.main:app --host ${A
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
|
||||
# Härtung
|
||||
# Härtung. Bewusst KEIN ProtectHome/ProtectSystem: das Repo (inkl. venv) darf
|
||||
# auch unter /root oder /home liegen; ProtectHome=true würde diese Pfade für den
|
||||
# Dienst ausblenden und zu "Failed to locate executable .../uvicorn" führen.
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/var/lib/certain-finance
|
||||
|
||||
|
||||
+20
-2
@@ -46,6 +46,18 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -y
|
||||
apt-get install -y python3 python3-venv python3-dev build-essential curl ca-certificates git
|
||||
|
||||
# --- Python-Version prüfen (3.11+ erforderlich) ------------------------------
|
||||
PY_VER="$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])' 2>/dev/null || echo 0.0)"
|
||||
PY_MAJOR="${PY_VER%%.*}"
|
||||
PY_MINOR="${PY_VER##*.}"
|
||||
if [[ "$PY_MAJOR" -lt 3 || ( "$PY_MAJOR" -eq 3 && "$PY_MINOR" -lt 11 ) ]]; then
|
||||
error "Python 3.11+ wird benötigt – gefunden: $PY_VER."
|
||||
error "Bitte einen Debian-12- oder Ubuntu-24.04-LXC verwenden (dort ist Python 3.11+ dabei)."
|
||||
error "Ältere Systeme (z. B. Debian 11 = Python 3.9) werden nicht unterstützt."
|
||||
exit 1
|
||||
fi
|
||||
info "Python $PY_VER gefunden."
|
||||
|
||||
# --- Node.js (nur zum Bauen des Frontends nötig) -----------------------------
|
||||
ensure_node() {
|
||||
local major=0
|
||||
@@ -76,6 +88,11 @@ info "Richte Python-venv ein und installiere Abhängigkeiten …"
|
||||
python3 -m venv "$REPO_DIR/backend/.venv"
|
||||
"$REPO_DIR/backend/.venv/bin/pip" install --upgrade pip >/dev/null
|
||||
"$REPO_DIR/backend/.venv/bin/pip" install -r "$REPO_DIR/backend/requirements.txt"
|
||||
if [[ ! -x "$REPO_DIR/backend/.venv/bin/uvicorn" ]]; then
|
||||
error "uvicorn wurde nicht in die venv installiert – die Abhängigkeiten sind unvollständig."
|
||||
error "Bitte die Ausgabe oben auf pip-Fehler prüfen."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- Frontend bauen ----------------------------------------------------------
|
||||
info "Baue das Frontend (Node wird nur hier gebraucht) …"
|
||||
@@ -146,9 +163,10 @@ ExecStart=$REPO_DIR/backend/.venv/bin/uvicorn app.main:app --host \${APP_BIND_HO
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
# Bewusst KEIN ProtectHome/ProtectSystem: das Repo (inkl. venv) darf auch unter
|
||||
# /root oder /home liegen; ProtectHome=true würde diese Pfade für den Dienst
|
||||
# ausblenden -> "Failed to locate executable .../uvicorn".
|
||||
ReadWritePaths=$DATA_DIR
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user