B2 Worker is a front-end for private Backblaze B2 storage using Cloudflare Worker
- Directory Listing
- File upload API via
PUTmethod - File uploader form at
/uploader - Basic authentication and authorization
- Prevent direct bucket access
- Serve content from B2 bucket for free from Cloudflare's CDN
I used this project to host a directory listing for the Maven server for my Minecraft mods.
The PUT API is also for easy Maven publishing.
- I'm using asdf to manage Node and PNPM, you can install it or install PNPM yourself
- Run
curl -L https://bai.lol/b2-worker | bash, the source here pnpm install- In Backblaze, create a new Application Key, with only access to single bucket
- Fill out
config/config.ts - You need to also put at least a username and password pair
- In Cloudflare Dashboard, create a new KV Namespace
- Fill out
wrangler.toml, copy the KV id there pnpm run deploy- Add custom domain to the worker and disable the
workers.devroute (to enable response caching) git add . && git pushto your private repository
- File deletion