Add media (object storage) and the background worker (Phase 1)

Media model + migration; an ObjectStore interface with an S3/MinIO (boto3) implementation behind the service layer. Upload (multipart) stores bytes in object storage + a metadata row (checksum, size, content-type, optional attach to person/event/source); list returns presigned URLs; delete is soft. Editor-gated, privacy-filtered, audited. 24 tests pass (object store faked).

Introduces the worker container (same image, 'python -m app.worker'): its first job is the scheduled 30-day soft-delete purge across tables + media object cleanup. Compose gains worker + S3 env on backend/worker; dev override builds the worker too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Justin Paul <justin@jpaul.me>
This commit is contained in:
2026-06-06 21:46:09 -04:00
parent 049545fcc8
commit 34d30e3134
19 changed files with 697 additions and 1 deletions
+2
View File
@@ -5,6 +5,7 @@ from app.models.audit import AuditEntry
from app.models.auth import Session, UserToken
from app.models.base import Base
from app.models.event import Event
from app.models.media import Media
from app.models.person import Name, Person
from app.models.place import Place, PlaceName
from app.models.relationship import Relationship
@@ -28,4 +29,5 @@ __all__ = [
"AuditEntry",
"Session",
"UserToken",
"Media",
]