Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom URL for S3 compatible services #2

Open
lvalics opened this issue Feb 8, 2025 · 2 comments
Open

Custom URL for S3 compatible services #2

lvalics opened this issue Feb 8, 2025 · 2 comments

Comments

@lvalics
Copy link

lvalics commented Feb 8, 2025

S3 Bucket to be used from other S3 compatible services.
Could be added to ENV file an AWS_S3_URL and also that to be customizable, to use for example Cloudflare, Minio, Hetzner File system (or other)?

like this, just I cannot test yet cause I am on localhost now.

const s3Client = new S3Client({
region: process.env.AWS_S3_REGION,
endpoint: process.env.AWS_S3_URL,
credentials: {
accessKeyId: process.env.AWS_S3_IAM_ACCESS_KEY!,
secretAccessKey: process.env.AWS_S3_IAM_SECRET_KEY!,
},
forcePathStyle: true,
});

AWS_S3_URL=https://cc6db1e5fb4e.eu.r2.cloudflarestorage.com

Copy link

github-actions bot commented Feb 8, 2025

Thank you for bringing issues to our attention!

@mathewlewallen
Copy link
Owner

Supporting custom storage providers is a great idea for the template. However, my approach with this template has been to provide a fully functional and opinionated setup rather than adding multiple configuration options. When building it, I found that having too many choices made it harder to maintain a simple starting point.

That said, if there's enough interest, we could consider adding an alternative version that supports an AWS_S3_URL environment variable to override the default AWS endpoint. This should work with providers that follow the S3 API standard.

A few things that come to mind:

  • Not all S3-compatible services support the full AWS S3 feature set. For example, signed URLs may work differently across providers.
  • The forcePathStyle: true option is required for some S3-compatible services, but others may need different authentication methods.
  • Since you're testing locally, you could try using a MinIO instance or a Cloudflare R2 bucket to verify.

Are you planing on testing these changes? If so, which providers are you planning to use? I'd be happy to hear your findings and see if it makes sense to include an alternative version.

I don't want to turn away from these types of collaborations, but I do want to still provide a full working template that is made to plug and play. What I would like to do is have multiple versions of this template that has different options, but is fully functional. I believe that will be the most beneficial for startups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants