fix(db): auto-create DB directory and improve open error messages
Open() now creates the parent directory of the database path itself, so e.g. DB_PATH=/data/app.db works on first start without a prior mkdir. Open, ping, and migration errors are wrapped with context and hints about writable directories and Docker bind-mount ownership (chown 1000:1000 or use a named volume). Also add a README troubleshooting section for the "database could not be opened" error.
This commit is contained in:
parent
d096295997
commit
bfae47f584
2 changed files with 24 additions and 3 deletions
|
|
@ -92,6 +92,14 @@ Hinter einem Reverse-Proxy / mit Domain zusätzlich setzen:
|
|||
|
||||
Wichtig: `JWT_SECRET` und `ENCRYPTION_KEY` dauerhaft setzen (Container-Neustarts sonst neue Secrets → Logins/Token ungültig), und die Google-Redirect-URI auf `{APP_URL}/api/calendars/google/callback` konfigurieren. Das SQLite-File liegt im Volume `/data`.
|
||||
|
||||
**Troubleshooting „Datenbank konnte nicht geöffnet werden“:** Der Server legt Verzeichnis und Datei selbst an, braucht dafür aber Schreibrechte. Der Container läuft als User 1000 (`app`). Bei einem **Bind-Mount** (`-v /pfad/auf/host:/data`) muss das Host-Verzeichnis diesem User gehören:
|
||||
|
||||
```bash
|
||||
sudo chown -R 1000:1000 /pfad/auf/host
|
||||
```
|
||||
|
||||
Docker erstellt nicht-existierende Bind-Mount-Pfade automatisch als root – deshalb entweder den Pfad vorher anlegen und `chown`en, oder den **Named Volume** nutzen (`-v wannpassts-data:/data` bzw. die docker-compose.yml), wo das automatisch passt.
|
||||
|
||||
### PWA-Hinweise
|
||||
|
||||
- Der Service Worker wird nur im Production-Build registriert (`npm run build` + Auslieferung über `STATIC_DIR`), nicht im Vite-Dev-Modus.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue