# SpaFu02 – LXC Setup (System "Gen") tags: [sparfuchs, spafu02, lxc, proxmox, infrastruktur] erstellt: 2026-06-13 status: aktiv --- ## Übersicht System "Gen" läuft auf LXC 106 (preisdb) auf Proxmox `pve`. Es ist zuständig für IMAP-Abruf, PDF-Verarbeitung und SQLite-Schreibzugriff. --- ## LXC Konfiguration | Eigenschaft | Wert | |-------------|------| | LXC-ID | 106 | | Name | preisdb | | Proxmox-Host | pve (192.168.2.181) | | IP | 192.168.2.181 | | CPU | 2 Kerne | | RAM | 1 GB (bei Bedarf auf 2 GB erhöhen) | | Disk | 10 GB | | OS | Ubuntu (Python 3.11) | --- ## Verzeichnisstruktur ``` /opt/preisdb/ ├── app/ │ ├── main.py # FastAPI Backend │ ├── importer.py # marktguru Import (läuft noch) │ ├── run_import.py # Import-Einstiegspunkt systemd │ ├── config.py # DB_PATH, API-Keys (nicht in GitHub) │ ├── page_processor.py # pdfplumber Seitenverarbeitung (NEU) │ └── index.html # Web-Frontend ├── data/ │ ├── preisdb.sqlite # SQLite DB (Schema v6) │ ├── preisdb_backup_v5.sqlite # Backup vor Migration │ ├── mails/ # gespeicherte .eml Dateien │ └── prospekte/ # heruntergeladene PDFs └── migrate_v5_to_v6.sql # ausgeführt 2026-06-13 ``` --- ## Installierte Pakete | Paket | Zweck | |-------|-------| | fastapi + uvicorn | API-Backend | | pdfplumber | PDF-Textextraktion | | python-dotenv | .env Konfiguration | --- ## IMAP-Konfiguration | Eigenschaft | Wert | |-------------|------| | Server | imap.secureserver.net | | Port | 993 | | Verbindung | SSL/TLS | | Benutzer | [email protected] | | Passwort | in .env (nicht in GitHub) | --- ## systemd Services | Service | Beschreibung | |---------|-------------| | `preisdb-api.service` | FastAPI-Backend, autostart | | `preisdb-import.timer` | marktguru Import täglich 02:00 (läuft noch) | | `preisdb-import.service` | einmalig aufgerufen durch Timer | --- ## Ressourcen-Hinweise - LXC läuft nur wöchentlich unter Last (PDF-Verarbeitung) - pdfplumber: leicht, kein GPU nötig - Cloud-Dienste (Claude API, Azure etc.): nur HTTP-Requests, kaum lokale Last - Bei paralleler Nutzung mehrerer Cloud-Systeme: RAM auf 2 GB erhöhen --- ## Nützliche Befehle ```bash # Service neustarten pct exec 106 -- systemctl restart preisdb-api # Import manuell auslösen pct exec 106 -- python3 /opt/preisdb/app/run_import.py # PDF-Test pct exec 106 -- python3 /opt/preisdb/app/page_processor.py /opt/preisdb/data/newsletter.pdf # DB-Zugriff pct exec 106 -- sqlite3 /opt/preisdb/data/preisdb.sqlite ``` --- ## Verwandte Dateien - [SpaFu02-Vorgaben.md](SpaFu02-Vorgaben.md) - [schema_v6.sql](schema_v6.sql) - [migrate_v5_to_v6.sql](migrate_v5_to_v6.sql) - [03 Backend.md](03%20Backend.md)