Kyrodan / KeeAnywhere

A cloud storage provider plugin for KeePass Password Safe
https://keeanywhere.de
MIT License
710 stars 87 forks source link

Cloudflare R2 - Cannot Save to R2 #424

Open hockey6611 opened 3 months ago

hockey6611 commented 3 months ago

Describe the bug KeeAnywhere is unable to save to Cloudflare R2 (using KeeAnywhere S3 compatible account). This appears to be due R2 not implementing streaming SigV4, and KeeAnywhere received the error: (501): Not Implemented, STREAMING-AWS4-HMAC-SHA256-PAYLOAD.

According to these R2 Docs issues:

package attempts streaming SigV4 so the operations need to be given the DisablePayloadSigning = true option https://github.com/cloudflare/cloudflare-docs/issues/6133 https://github.com/cloudflare/cloudflare-docs/issues/4683

Searching for the error leads to other projects that have the same issues that are fixed by disabling payload signing: https://forum.duplicati.com/t/back-up-to-cloudflare-r2-storage-fails/15511/19

To Reproduce Steps to reproduce the behavior:

  1. Successfully setup Cloudflare R2 as an Amazon S3 account in KeeAnywhere.
  2. Open your database
  3. Make a change, and save. Receive error in screenshot below.

Expected behavior KeeAnywhere should be able to utilize Cloudflare R2 as an S3-compatible account provider

Screenshots image image

Environment:

Additional context I realize that Cloudflare R2 could be considered not "compatible" with Amazon S3 if they do no implement all operations. It would still be nice to be able to use cloudflare R2 with KeeAnywhere 😀

Hau-Hau commented 3 months ago

According to sources which you have find looks that we would need to add DisablePayloadSigning = true to https://github.com/Kyrodan/KeeAnywhere/blob/d563e88b35987d80c6975cf81fa03204bc70f176/KeeAnywhere/StorageProviders/AmazonS3/AmazonS3StorageProvider.cs#L70