strapi icon indicating copy to clipboard operation
strapi copied to clipboard

Add Cloudflare R2 Support to AWS S3 Provider

Open tilman opened this issue 2 years ago • 3 comments

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

tilman avatar Sep 27 '22 19:09 tilman

Is this done, and just waiting for testing?

niklasfjeldberg avatar Oct 16 '22 10:10 niklasfjeldberg

@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.

Marc-Roig avatar Oct 17 '22 07:10 Marc-Roig

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

tilman avatar Oct 18 '22 16:10 tilman

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 :)

alexandrebodin avatar Mar 22 '23 10:03 alexandrebodin