Skip to content

dryadsystems/r2-public-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to upload:

(rclone)[https://rclone.org/install/]

curl https://rclone.org/install.sh | sudo bash

[r2]

type = s3
provider = Cloudflare
access_key_id = <id>

secret_access_key = <key>

endpoint = https://<endpoint>.r2.cloudflarestorage.com
acl = private

r2-public-worker

A Cloudflare Worker to make your R2 bucket public!

Minimum Requirements

  1. Cloudflare Account
  2. wrangler >= 2.0.2

Note: Ensure you are using at the minimum specified version of wrangler.

Setup

  1. Fork this repo

  2. Install dependencies (including Wrangler 2)

npm install
  1. Create a bucket to be made public
wrangler r2 bucket create public
  1. Update the wrangler.toml to bind the R2 bucket
[[r2_buckets]]
binding = 'PUBLIC' # <~ valid JavaScript variable name
bucket_name = 'public'
  1. Deploy the worker!
wrangler publish
  1. 🎉 You've got a public bucket

Give it a try: https://r2-public-worker.cdmacken.workers.dev/duck.png

URL's even support spaces! https://r2-public-worker.cdmacken.workers.dev/space%20duck.webp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published