Giter Club home page Giter Club logo

cf-b2cdn's Introduction

B2 CDN

Screenshot of a Directory Listing Page

A Cloudflare Worker for serving and browsing content in a private Backblaze B2 bucket.

  • Serve the content in your B2 bucket for free
  • Browse the content in your B2 bucket

Why?

  • Backblaze B2 is cheap file storage
  • Downloading from Backblaze B2 is normally $0.01 per GB
  • Downloading from Backblaze B2 through Cloudflare's CDN is free
  • Private buckets prevent people from downloading from your bucket directly

Setup

Install Wrangler

See Cloudflare's documentation for more information.

wrangler.toml

Copy wrangler.toml.example to wrangler.toml and fill in your own information into the variables. Refer to Cloudflare's documentation for more information.

Secrets

Secrets are like vars but... secret. This Worker only needs one secret named B2SECRET which should contain the applicationKey (the secret part) of your Backblaze B2 application key.

Protected File Listings

You can use Cloudflare Access to require a login for certain subdomains. Let's say you want to publicly share the files in your B2 Bucket, but not allow others to list the files in it, you can set up a separate DIR_DOMAIN and place Cloudflare Access in front of it. There's a lot of supported identity providers. You can make it so only a certain IP can access the directory listing, or only particular Google Accounts.

To Do

  • Implement pagination for enormous folders
  • Implement more efficient calls to b2_list_file_names

License

MIT

cf-b2cdn's People

Contributors

phistrom avatar exvuma avatar kristianfreeman avatar everlastingbugstopper avatar grempe avatar xtuc avatar ashleygwilliams avatar zaherg avatar 13rac1 avatar shagamemnon avatar adaptive avatar jdanyow avatar rita3ko avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.