B2 Worker is a front-end for private Backblaze B2 storage using Cloudflare Worker.
- Directory Listing
- File upload API via
PUT
method - File uploader form at
/uploader
- Basic authentication
- Prevent direct bucket access
- Serve content from B2 bucket for free from Cloudflare's CDN
- I'm using asdf to manage Node and PNPM, you can install it or install PNPM yourself
- Clone the repository
pnpm install
- In Backblaze, create a new Application Key, with only access to single bucket
- Copy
config/private.example.ts
toconfig/private.ts
, copy the keys into it - You need to also put at least a username and password pair
- In Cloudflare Dashboard, create a new KV Namespace
- Copy
wrangler.example.toml
towrangler.toml
, copy the KV id there pnpm run deploy
- Add custom domain to the worker and disable the
workers.dev
route (to enable response caching)
- File deletion