feat: tägliche datenbanksicherung
Konsistente Momentaufnahme per SQLite-Backup-API nach data/backups, geprüft mit PRAGMA integrity_check und komprimiert; erst eine geprüfte Datei bekommt den endgültigen Namen. Aufbewahrung 7 täglich + 4 wöchentlich, verpasste Sicherungen werden nach dem Start nachgeholt. lc-admin backup für manuelle Sicherungen, Status für Admins unter /api/admin/backup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4aebac5336
commit
7fd699c6af
6 files changed
+444
-2
No files matched your search
@@ -1,6 +1,7 @@
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
@@ -35,6 +36,12 @@ class Settings(BaseSettings):
|
||||
# Uploads are refused when the disk would drop below this; the server is shared
|
||||
file_min_free_bytes: int = 2 * 1024 * 1024 * 1024
|
||||
|
||||
# Daily consistent database snapshot to /data/backups (local time, see TZ)
|
||||
backup_enabled: bool = True
|
||||
backup_hour: int = Field(default=3, ge=0, le=23)
|
||||
backup_keep_daily: int = Field(default=7, ge=1)
|
||||
backup_keep_weekly: int = Field(default=4, ge=0)
|
||||
|
||||
initial_admin_username: str | None = None
|
||||
initial_admin_password: str | None = None
|
||||
|
||||
|
||||
Reference in new issue
Block a user