strapi
strapi copied to clipboard
Add Cloudflare R2 Support to AWS S3 Provider
What does it do?
Cloudflare R2 is using a AWS S3 compatible API but has some slight changes. 1.) No support for 'public-read' ACL. Therefore I added an config option to control the ACL settings of the Provider. 2.) Access of the bucket is performed via a different URL as the write request. Therefore I added another config option to set the read Endpoint URL
Why is it needed?
This is needed to make cloudflare R2 work with strapi.
How to test it?
Create a new bucket in cloudflare R2 and assign it a domain. Then setup the config as described in the updated README.
Related issue(s)/PR(s)
no Related Issues
Is this done, and just waiting for testing?
@niklasfjeldberg Hi, I want to have a discussion with @alexandrebodin about this actually.
I want to know if there is a plan or an idea to make the provider more configurable.
The customParams
field in the upload method could be used for the ACL configuration.
I will try to discuss this with him this week.
The
customParams
field in the upload method could be used for the ACL configuration.
Alright. Seems like I missed this. But still the config.customReadEndpoint would be necessary for cloudflare r2
Hi @tilman we just merged https://github.com/strapi/strapi/pull/13040 that is adding CDN support and refactoring the base configs.
For the ACL things indeed the customParams are here for this :) I think we can close this PR now that we have everything to support the requirements.
I'll close for now. If you think something is still missing let me know :)