feat: dateiaustausch im backend

Dateien als Clip-Art "file": gestreamter Upload mit Größengrenze, Kontingent
pro Benutzer und Mindestreserve an freiem Speicher. Download immer als
Anhang mit sandbox-CSP, Vorschau nur für geprüfte JPEG/PNG/GIF/WebP.
Ablauf nach 1/7/30 Tagen oder nie; der Aufräumjob löscht abgelaufene und
verwaiste Dateien.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dbildhauerandClaude Opus 5.5 committed 2026-10-25 14:01:10 +01:00
1 parent ae334d2248
commit 52a8fd019f
12 files changed
+1027 -11

No files matched your search

+9
View File
@@ -30,6 +30,11 @@ class Settings(BaseSettings):
clip_max_chars: int = 200_000
file_max_bytes: int = 100 * 1024 * 1024
file_quota_bytes: int = 1024 * 1024 * 1024
# Uploads are refused when the disk would drop below this; the server is shared
file_min_free_bytes: int = 2 * 1024 * 1024 * 1024
initial_admin_username: str | None = None
initial_admin_password: str | None = None
@@ -37,6 +42,10 @@ class Settings(BaseSettings):
def database_url(self) -> str:
return f"sqlite:///{self.data_dir / 'app.db'}"
@property
def files_dir(self) -> Path:
return self.data_dir / "files"
@property
def allowed_origin_list(self) -> list[str]:
return [o.strip().rstrip("/") for o in self.allowed_origins.split(",") if o.strip()]