Commit Graph

3 Commits

Author SHA1 Message Date
SlimusMinus
871b16a038 Add video attachments to chat messages
- browser uploads the source straight to MinIO via presigned PUT (type and
  exact size are signed, up to 100 MB); upload is confirmed once by its owner
- message is created with a PROCESSING video, transcoded in the background
  (chatVideoExecutor): H.264/AAC, short side up to 720px, faststart,
  metadata (incl. location) stripped, poster frame; up to 60 s
- the updated message is re-broadcast over WebSocket when READY or FAILED;
  stuck processing is failed after 30 min
- message_attachments: status, poster_key, duration_ms, processing_started_at
- chat deletion and orphan cleanup handle video posters; rate limit chat-video

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:00:11 +03:00
SlimusMinus
2f6aa0cd1e Add photo attachments to chat messages
- message_attachments table (cascade with messages); files stored under
  chat/{chatId}/ in the images bucket
- POST /api/v1/chats/{chatId}/messages (multipart, up to 10 photos + text);
  message is broadcast over WebSocket as before
- photos are always re-encoded so EXIF (geotag, device) never reaches storage
- presigned links (6h) only in participant-checked responses, refresh via
  GET /api/v1/chats/{chatId}/attachments/{id}/url
- public /api/v1/files no longer serves or deletes chat/ keys
- chat deletion removes files; orphan cleanup keeps referenced attachments
- rate limit chat-photo: 60/hour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:26:37 +03:00
SlimusMinus
4ff61d8eda Delete orphan files from the image bucket nightly
OrphanFileCleanupService (03:30, ShedLock) lists the bucket and deletes objects
older than 24 hours that no images.url or users.avatar_url points to (full
URLs in legacy rows are normalised to keys), at most 5000 per run. Such files
appear when an upload via POST /api/v1/files is never attached or a request
fails between upload and save. Deleted files stay recoverable for 30 days as
noncurrent versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 01:42:39 +03:00