Skip to content

Add the function to customize the S3 domain#5411

Closed
Euruson wants to merge 2 commits intousememos:mainfrom
Euruson:cdn-domain
Closed

Add the function to customize the S3 domain#5411
Euruson wants to merge 2 commits intousememos:mainfrom
Euruson:cdn-domain

Conversation

@Euruson
Copy link

@Euruson Euruson commented Jan 3, 2026

This PR adds support for configuring a custom domain (CDN) for S3 storage. When configured, attachment URLs will be generated using the custom domain instead of the default S3 presigned URLs. This allows for serving assets via a CDN or a custom domain name. Existing attachments will automatically migrate to the new URL format via the background runner immediately upon saving settings.

A lot of people asked for this feature to accelerate accessing and reduce network traffic costs:
#3575
#3717
#3819
#4852
#5191

@Euruson Euruson requested a review from johnnyjoygh as a code owner January 3, 2026 10:02
@Euruson
Copy link
Author

Euruson commented Jan 4, 2026

Also, I use filePathTemplate for attachment naming to avoid unpredictable filenames returned by S3.

Some S3-compatible providers return the bucket name as part of the filename for large files but not for small ones. This inconsistency stems from the multipart upload mechanism used for larger files, which can return a different key format than the single PUT mechanism used for smaller files.

@boojack boojack force-pushed the main branch 2 times, most recently from a196c72 to 71e8a06 Compare February 10, 2026 01:15
@boojack boojack self-requested a review as a code owner February 24, 2026 14:23
@boojack boojack force-pushed the main branch 2 times, most recently from 2b6b987 to 47d9414 Compare February 24, 2026 14:55
@boojack boojack added the Stale label Mar 4, 2026
@boojack boojack closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants