[IMPLEMENTED] Cloudflare R2 is not working as an asset store

I have…

  • [x] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Minimal reproduction of the problem

Configure the asset store with Cloudflare R2 like this:

{
    "assetStore": {
        "type": "AmazonS3",
        "amazonS3": {
            "serviceUrl": "https://<CLOUDFLARE ACCOUNT ID>.r2.cloudflarestorage.com",
            "bucket": "squidex",
            "bucketFolder": "squidex-assets",
            "regionName": "auto",
            "accessKey": "<MY_KEY>",
            "secretKey": "<MY_SECRET>",
            "forcePathStyle": false
        }
    }
}

Cloudflare R2 documentation

Environment

  • [x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 7.4.0

Others:
Log

Cloudflare R2 is an S3 compatible storage but not working as an asset store.
When I try to upload an asset, I get this exception:

{
    "type": "Amazon.S3.AmazonS3Exception",
    "message": "STREAMING-AWS4-HMAC-SHA256-PAYLOAD not implemented"
}

Although I can’t say for sure, but I found this about the .NET AWS SDK and this might be the problem: Cloudflare R2 and AWS’s SDK for .NET (kian.org.uk)

I don’t consider that a bug. I tested the implementation again S3 and it works fine there and if a provider does not support everything, then it is nothing that should just work out of the box.

If you are a developer you could create a PR for this project: https://github.com/Squidex/libs/tree/main/assets

I have introduced a new flag to disable the signing of requests. Furthermore another change was needed, because Cloudflare does not support the R2 operation.

See: https://github.com/Squidex/squidex/blob/master/backend/src/Squidex/appsettings.json#L445

This topic was automatically closed after 2 days. New replies are no longer allowed.