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

Adds support for private Backblaze buckets #43

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

allancalix
Copy link
Contributor

Using the client that is already used by B2 storage to make the Get call, this PR adds support for reading to/from both private and public buckets. Incidentally, this also makes setting the b2-url field in the config unnecessary.

Note that removing the B2Url field from the config struct is a breaking change so I left it as is, I'm happy to do something different according to the project's update policy.

@Bren2010
Copy link
Contributor

I believe this was actually intentional because Backblaze will charge you for egress if you do it this way. But if you set your bucket up to be accessed through Cloudflare, then it's free because of Bandwidth Alliance.

@allancalix
Copy link
Contributor Author

I see, it looks like it is possible to support this using Cloudflare workers with private buckets. In this change's current state, I'm happy to close this PR if it's not something the project wants to support or make the following changes:

  1. Update docs to note egress savings via Cloudflare CDN
  2. Provide a configuration option to override the Backblaze domain to continue to support the use case
  3. Otherwise, use the client for easier setup / private bucket support

@Bren2010
Copy link
Contributor

Yes, I think that would be good. You can leave the documentation changes out though and I'll add that in another PR since I've done it before

@allancalix
Copy link
Contributor Author

SGTM, updated the PR. This should should essentially be noop for existing configurations but support private buckets / api-based public downloads.

@Bren2010
Copy link
Contributor

Awesome, thanks so much! I'll write the docs I said I would tonight

@Bren2010 Bren2010 merged commit 2c33130 into cloudflare:master Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants