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>
64 lines
2.5 KiB
Markdown
64 lines
2.5 KiB
Markdown
# 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 12 / Ubuntu 24.04) das Repo klonen und als root installieren:
|
||
|
||
```bash
|
||
git clone <repo-url> /opt/certain-finance
|
||
cd /opt/certain-finance
|
||
sudo ./deploy/install.sh
|
||
```
|
||
|
||
Das Skript installiert Python/Node, richtet eine venv ein, baut das Frontend,
|
||
erzeugt `/etc/certain-finance/env` (mit Zufallsgeheimnissen), legt den systemd-
|
||
Dienst `certain-finance` an und startet ihn. Node wird **nur zum Bauen** gebraucht;
|
||
der laufende Dienst ist reines Python.
|
||
|
||
## Direktzugriff (http://IP:Port)
|
||
|
||
Standardmäßig lauscht der Dienst auf `0.0.0.0:<APP_PORT>` (Standard-Port `8071`) und
|
||
ist damit direkt im LAN erreichbar: `http://<LXC-IP>:8071`. Dafür ist
|
||
`APP_COOKIE_SECURE=false` gesetzt (sonst speichert der Browser die Sitzung über
|
||
reines HTTP nicht). Möchtest du den Zugriff auf einen Reverse-Proxy **auf demselben
|
||
Host** beschränken, setze `APP_BIND_HOST=127.0.0.1` in `/etc/certain-finance/env`.
|
||
|
||
## Optional: HTTPS über Nginx Proxy Manager
|
||
|
||
Wenn du von außen per HTTPS zugreifen willst, einen **Proxy Host** anlegen:
|
||
|
||
- **Domain Names:** deine (Sub-)Domain
|
||
- **Scheme:** `http`
|
||
- **Forward Hostname / IP:** IP dieses LXC
|
||
- **Forward Port:** Wert von `APP_PORT` (Standard `8071`)
|
||
- **Block Common Exploits:** an
|
||
- **Websockets Support:** nicht nötig
|
||
- **SSL:** Let's Encrypt-Zertifikat anfordern, „Force SSL" an
|
||
|
||
Für spätere CSV-/PDF-Uploads in den *Advanced*-Einstellungen des Hosts
|
||
`client_max_body_size 20m;` setzen.
|
||
|
||
Bei ausschließlichem HTTPS-Zugriff kannst du `APP_COOKIE_SECURE=true` in
|
||
`/etc/certain-finance/env` setzen (danach `systemctl restart certain-finance`) –
|
||
dann werden die Sitzungs-Cookies nur über HTTPS gesendet. Für gemischten Zugriff
|
||
(HTTP im LAN **und** HTTPS von außen) belasse es bei `false`.
|
||
|
||
## Betrieb
|
||
|
||
```bash
|
||
systemctl status certain-finance # Status
|
||
journalctl -u certain-finance -f # Logs
|
||
systemctl restart certain-finance # Neustart
|
||
sudo ./deploy/update.sh # Update (git pull + build + Migration + Neustart)
|
||
```
|
||
|
||
## Backup
|
||
|
||
Die Datenbank liegt unter `/var/lib/certain-finance/app.db`. `update.sh` legt vor
|
||
jeder Migration automatisch eine Kopie unter `/var/lib/certain-finance/backups/`
|
||
an. Zusätzlich empfiehlt sich ein Proxmox-`vzdump`-Snapshot des Containers.
|