Open lintoncaldecott opened 5 months ago
Is there anyone able to provide feedback for this?
upload: {
config: {
provider: 'strapi-provider-cloudflare-r2',
providerOptions: {
accessKeyId: env('CF_ACCESS_KEY_ID'),
secretAccessKey: env('CF_SECRET_ACCESS_KEY'),
/**
* `https://<ACCOUNT_ID>.r2.cloudflarestorage.com`
*/
endpoint: env('CF_ENDPOINT'),
params: {
Bucket: env('CF_BUCKET'),
},
/**
* Set this Option to store the CDN URL of your files and not the R2 endpoint URL in your DB.
* Can be used in Cloudflare R2 with Domain-Access or Public URL: https://pub-<YOUR_PULIC_BUCKET_ID>.r2.dev
* This option is required to upload files larger than 5MB, and is highly recommended to be set.
* Check the cloudflare docs for the setup: https://developers.cloudflare.com/r2/data-access/public-buckets/#enable-public-access-for-your-bucket
*/
cloudflarePublicAccessUrl: env('CF_PUBLIC_ACCESS_URL'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
@lintoncaldecott I'm not sure about the public access URL you are using - maybe that is the problem. We used a real one here: CF_PUBLIC_ACCESS_URL=https://static-dev.ch-source.de could you try that one out?
@JannikZed Just tried it now, I get the same error
[2024-05-24 14:04:48.857] error: The specified bucket does not exist. NoSuchBucket: The specified bucket does not exist.
I'm unable to reproduce this. Have you tried to 'hardcode' the variables in the config file and got it working with it? My first guess would be that bucket env variables are not correctly set.
Other reason could be that you have some old AWS_...
env variables set which are conflicting with this plugin as mentioned in the readme.
.
I am using the very simplest configuration according to the docs at https://market.strapi.io/providers/strapi-provider-cloudflare-r2 My configuration looks like this;
A 1.8MB image upload fails with the response
My environment variables look like this
I could say I copy and pasted my bucket name here, but I have quadruple checked the bucket 'resources' exists in my cloudflare R2 console.