r2-webdav/README.md
2023-10-25 17:30:46 +08:00

1.0 KiB

r2-webdav

Deploy to Cloudflare Workers

Use Cloudflare Workers to provide a WebDav interface for Cloudflare R2.

Configuration

Change wrangler.toml to your own.

[[r2_buckets]]
binding = 'webdav' # <~ valid JavaScript variable name
bucket_name = 'webdav'

[vars]
PROTOCOL = "r2"
BUCKET_NAME = "webdav"
USERNAME = "USERNAME"
PASSWORD = "PASSWORD"
  • PROTOCOL: r2 only now.
  • BUCKET_NAME: The bucket name of R2.
  • USERNAME: The username of WebDav.
  • PASSWORD: The password of WebDav.

Development

With wrangler, you can build, test, and deploy your Worker with the following commands:

# run your Worker in an ideal development workflow (with a local server, file watcher & more)
$ npm run dev

# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)
$ npm run deploy

Read the latest worker crate documentation here: https://docs.rs/worker