Add media storage integration #24

Closed
opened 2026-05-19 19:51:45 -05:00 by erik · 2 comments
Owner

Goal

Wire the template website to S3-compatible media storage and public media URL generation.

Spec: docs/web-specs/07-media-storage-integration.md

Requirements

  • Add an S3-compatible storage client configuration for endpoint, bucket, credentials, public URL, max upload size, and allowed MIME types.
  • Store media file metadata in SQLite.
  • Implement reusable media storage service functions for upload, URL generation, metadata persistence, and delete.
  • Validate file size and MIME type before storing media.
  • Ensure storage errors return contextual, safe errors through API callers.
  • Document storage environment variables in .env.example.
  • Add tests using fake/mock storage where practical.

Acceptance criteria

  • Media upload service stores a file in S3-compatible storage or a test fake.
  • Media metadata is created in SQLite.
  • Public media URL generation uses configured public base URL.
  • Delete removes media from storage and database where possible.
  • Unsupported media type fails with standard API error data.
  • Oversized upload fails with standard API error data.
  • .env.example documents required media storage variables.
  • Relevant lint/test checks pass.

Dependencies

  • task-69937fe4
## Goal Wire the template website to S3-compatible media storage and public media URL generation. Spec: `docs/web-specs/07-media-storage-integration.md` ## Requirements - Add an S3-compatible storage client configuration for endpoint, bucket, credentials, public URL, max upload size, and allowed MIME types. - Store media file metadata in SQLite. - Implement reusable media storage service functions for upload, URL generation, metadata persistence, and delete. - Validate file size and MIME type before storing media. - Ensure storage errors return contextual, safe errors through API callers. - Document storage environment variables in `.env.example`. - Add tests using fake/mock storage where practical. ## Acceptance criteria - [ ] Media upload service stores a file in S3-compatible storage or a test fake. - [ ] Media metadata is created in SQLite. - [ ] Public media URL generation uses configured public base URL. - [ ] Delete removes media from storage and database where possible. - [ ] Unsupported media type fails with standard API error data. - [ ] Oversized upload fails with standard API error data. - [ ] `.env.example` documents required media storage variables. - [ ] Relevant lint/test checks pass. ## Dependencies - task-69937fe4
erik 2026-06-03 07:37:33 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-03T13:17:17.391Z

Completed

  • Implemented S3-compatible media storage configuration, AWS SDK storage adapter, SQLite media metadata migration, and reusable media upload/delete/public URL services.
  • Added local Garage support through make dev and documented media storage environment variables.
  • Added fake-backed media tests covering upload, metadata persistence, URL generation, delete, validation errors, and safe storage error API mapping.
  • Verified: ./scripts/pre-pr.sh passed locally, Forgejo CI run #99 passed, and PR #87 was merged into main.
_Synced from todu comment by @todu on 2026-06-03T13:17:17.391Z_ ### Completed - Implemented S3-compatible media storage configuration, AWS SDK storage adapter, SQLite media metadata migration, and reusable media upload/delete/public URL services. - Added local Garage support through `make dev` and documented media storage environment variables. - Added fake-backed media tests covering upload, metadata persistence, URL generation, delete, validation errors, and safe storage error API mapping. - Verified: `./scripts/pre-pr.sh` passed locally, Forgejo CI run `#99` passed, and PR #87 was merged into `main`.
Author
Owner

Synced from todu comment by @todu on 2026-06-03T13:15:34.181Z

Review update

  • PR: #87 is open and CI is green.
  • Result: approved; all 8 acceptance criteria are met after adding media API error response mapping in 0d4a2b2.
  • Verified: ./scripts/pre-pr.sh passed locally and Forgejo CI run #99 succeeded.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-06-03T13:15:34.181Z_ ### Review update - PR: #87 is open and CI is green. - Result: approved; all 8 acceptance criteria are met after adding media API error response mapping in `0d4a2b2`. - Verified: `./scripts/pre-pr.sh` passed locally and Forgejo CI run `#99` succeeded. - Follow-up: waiting for explicit human merge approval.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#24
No description provided.