Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Cloudflare R2 #13376

Closed
ahrenstein opened this issue May 11, 2022 · 13 comments
Closed

Add support for Cloudflare R2 #13376

ahrenstein opened this issue May 11, 2022 · 13 comments
Labels
feature s3 AWS S3 Protocol Implementation
Milestone

Comments

@ahrenstein
Copy link

Is your feature request related to a problem? Please describe.
Cloudflare is launching a new S3 compatible object storage service called R2.
Cyberduck (and Mountain Duck) should definitely add support for this new service as it has a lot of benefits over AWS S3 in different cases. (One of which being zero cost on egress)

Describe the solution you'd like
I'd like to see support added for Cloudflare R2 (which is currently in open beta)

Describe alternatives you've considered
In the meantime, I'll see if I can create a custom profile to work with R2 but long term official support would be great.

Additional context
There is some official documentation along with the most relevant doc being the current API implementation status.
Additionally the document about using Wrangler to create and manage buckets might be important.

@juliancox
Copy link

juliancox commented May 12, 2022

Using S3 mode I can connect to R2 and list buckets but attempting to list objects in a bucket gives the following error:

Listing directory gc-public failed.
Internal Server Error. Request Error [InternalError]. Please contact your web hosting service provider for assistance.

@dkocher dkocher added the s3 AWS S3 Protocol Implementation label May 12, 2022
@AliveDevil
Copy link
Contributor

Can you check whether forcing path style requests works for R2? You can enable this profile in Cyberduck Preferences -> Profiles -> search for "S3 (Deprecated path style requests)"

There is a bunch of unsupported APIs which Cyberduck may depend on (Unimplemented object-level operations) - specifically ListObjects. Chances are higher if there is a Java SDK or OpenAPI specification to be implemented, though.

Cloudflare isn't that great of making sure their blog posts are accurate, though.
image
Referring in the text to "bucket.account.r2storage.com" while the anchor links to "account.r2.cloudflarestorage.com/bucket" isn't something I'd want to see.

@dkocher
Copy link
Contributor

dkocher commented May 12, 2022

Relates to #13379.

@dkocher dkocher changed the title Feature Request: Add support for Cloudflare R2 Add support for Cloudflare R2 May 12, 2022
@juliancox
Copy link

@AliveDevil I can confirm S3 (Deprecated path style requests) profile seems to allow R2 connections to work as expected I can list buckets, download and upload files without any problems.

Cloudflare docs do leave a lot to be desired - sigh!

@deepybee
Copy link

Yep I've also managed to get R2 working as desired with path style access 👍

@AliveDevil
Copy link
Contributor

Hint for the deprecated path style was this sample for the aws-sdk-js1, which explicitely forces the client to use path style.

  s3ForcePathStyle: true,

Footnotes

  1. https://developers.cloudflare.com/r2/examples/aws-sdk-js/

@AliveDevil
Copy link
Contributor

@juliancox @deepybee
Can one of you let me know what Cloudflare returns for a location request?

GET https://account.r2.cloudflarestorage.com/bucket/?location

@dkocher
Copy link
Contributor

dkocher commented May 13, 2022

@juliancox @deepybee Can one of you let me know what Cloudflare returns for a location request?

Querying the bucket location is not supported

<Error><Code>NotImplemented</Code><Message>GetBucketLocation not implemented</Message></Error>

@dkocher
Copy link
Contributor

dkocher commented May 14, 2022

it is not clear how to make objects publicly available

  • Pre-signed URLs do not work
  • ACLs on buckets or files don't seem to be supported

@juliancox
Copy link

At this stage R2 buckets are private only. The only way to make them public seems to be via a cloudflare worker. There is a public access setting under the bucket's settings tab on the cloudflare dashboard but this says "Private - This bucket and its objects are only visible to users, Workers, or services that have been granted explicit access. It is not publicly visible on the Internet." with not option to make it public. The learn more link just after leads to this page: https://developers.cloudflare.com/r2/get-started/#6-bucket-access-and-privacy
Which describes making a bucket public via workers but no details on how to make the bucket itself public. It looks like this is a planned option but something available yet while R2 still has the 'beta' tag.

@ahrenstein
Copy link
Author

Querying the bucket location is not supported

@dkocher Cloudflare R2 will be global for every bucket once out of beta, so trying to get location/region is probably not necessary.

dkocher added a commit that referenced this issue May 20, 2022
Allow to set placeholder for hostname in connection profile
ylangisc added a commit that referenced this issue May 20, 2022
Skip querying for multipart uploads when disabled in profile.
@dkocher dkocher added this to the 8.4.0 milestone May 20, 2022
@dkocher dkocher closed this as completed May 20, 2022
@raramuridesign
Copy link

Is there any documentation on how to setup R2 on Cyberduck?

@dkocher
Copy link
Contributor

dkocher commented Jun 14, 2022

Is there any documentation on how to setup R2 on Cyberduck?

Documentation pending in iterate-ch/docs#198. You can enable the connection profile in Preferences → Profiles..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature s3 AWS S3 Protocol Implementation
Projects
None yet
Development

No branches or pull requests

6 participants