# Deployment (Proxmox-LXC + Nginx Proxy Manager) ## Installation Im LXC (Debian/Ubuntu) das Repo klonen und als root installieren: ```bash git clone /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. ## Nginx Proxy Manager Neuen **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. Da HTTPS extern terminiert, sind die Sitzungs-Cookies `Secure` (`APP_COOKIE_SECURE=true`). Der Dienst selbst lauscht nur auf `127.0.0.1`. ## 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.