Cloudflare Backblaze



  • Feature request:

    It would be great with a “How to” about using “Cloudflare Workers” for hosting and delivering video through the Cloudflare CDN network.
    https://www.cloudflare.com/products/cloudflare-workers/

    Currently using Backblaze.com for hosting and Cloudflare CDN for distribution.

    Using Cloudflare for both hosting and CDN would be faster.

Also, cloudflare CEO mentioned that if you're using cloudflare worker to pass all your images requests, you can use cloudflare to serve images. Only limitation is video files, since they've their own dedicated product for that, and they don't want you to use cheaper medium such worker, which is per request based, instead of bandwidth consumed. Backblaze is all about simplicity of storage and driving the usage of cloud storage at scale. Backblaze and Packet.net, another Bandwidth Alliance member, also have zero egress fees between their networks, allowing customers to use Backblaze storage, packet compute and Cloudflare’s global performance and security network.

  • Hello tbtnoas,

    Office 2016 for mac kms activation. Thanks for amazing recommendations! I’m going to check Cloudflare hosting and CDN later this week and I’ll discuss it with our development team.

    If the Cloudflare will meet our requirements we for sure should have nice and clear step-by-step documentation just like we have for AWS.

    I’ll get in touch with you with more information in the close future.

    Thanks,
    Juraj

    Helo tbtnoas,

    we worked with that BackBlaze + Cloudflare setup before and it’s quite complex, if the BackBlaze videos are private and you use Cloudflare Worker with BackBlaze API keys to be able to fetch the files.

    I’m not sure how do the Cloudflare Web Workers help with your video hosting though. Are you sure you can host videos on Cloudflare directly?

    Thanks,
    Martin

    Hello tbtnoas,

    so is your website using Cloudflare for CDN? Then you can try to host some video on it and the Cloudflare CDN should already be taking that over, like any other file (JS, CSS, …), am I right? I don’t see need for any special steps, but don’t know everything about Cloudflare from top of my head. My advice would be just to try it and do some video download speed tests.

    Thanks,
    Martin

    Hello tbtnoas,

    we are currently concentrating on a easier workflow for encrypted HLS streams. Once you upload the video to your video hosting (S3 or Digital Ocean Spaces) it should be a 1 click action to encrypt it.

    With Cloudflare Workers you can potentially add URL tokens, but it’s a part of the Cloudflare Business plan too. Another thing it can do is to fetch files from private video CDNs, such as Backblaze – you already sent a link for that.

    Thanks,
    Martin

Backblaze

TL;DR Adding workers to the cloudflare proxy, as in the official tutorial, seems to conflict with the authentication in rclone. The following is how I reached the speculation.

I was setting up rclone with backblaze b2, with RCLONE_B2_DOWNLOAD_URL set to Cloudflare to proxy requests. Meanwhile I followed the official blog from Backblaze 'How to allow Cloudflare to fetch content from a Backblaze B2 private bucket – Backblaze Help'(couldn't post links) to enable public access to a private bucket.

I had a VPS working but on multiple clients rclone showed errors when copying an object.

I did some search and found one post concerning Backblaze with Cloudflare. 'Correct format for RCLONE_B2_DOWNLOAD_URL variable? - Help and Support - rclone forum' It wasn't the same case, but it came to me that it might due to the difference between versions. So I did a binary search on the releases. It happens that some commit between v1.52.3 and v1.53.0 breaks it. I looked up the commits between them and located a seemingly relevant commit 957311. I confirmed that with this commit reverted the problem resolves, but applying the revert to the latest commit does not do the same.

I added some debug info to confirm that this issues is raised by the different styles of api: fetch object by id or by name. I looked at the errors again and it came to me that maybe this has something to do with Cloudflare tampering the authentication headers. The worker script in the tutorial is as follows.

Cloudflare BackblazeBackblaze

I removed the worker and everything got smooth. It took me a whole evening. Whew!

Cloudflare Backblaze

This post is for sharing my solution to people who encounter the same problems. I have some questions, too. The script enables public access to private buckets by settings the 'Authorization' header. I confirmed that with the worker I can publicly fetch the files from cloudflare. How did that conflict with the credentials in rclone? The files are requested by filenames but not file ids, so are there other authentication schemes?

Backblaze B2 Cloudflare

Cloudflare

Cloudflare Workers Backblaze

I don't know golang, so apologies if I missed anything. Thanks in advance!