FlareDrive is a Cloudflare Worker + R2 based WebDAV drive with a React web UI.
It provides:
- Standard WebDAV access for common clients
- Browser uploads with multipart support for large files
- Optional temporary share links backed by KV
- Upload integrity headers (
fd-sha256/x-fd-sha256)
- Frontend: React + Vite (
src/components,src/features) - Worker entry:
src/worker.ts - WebDAV / HTTP handlers:
src/webdav - Storage: Cloudflare R2 binding (
BUCKET) - Share metadata: Cloudflare KV binding (
SHARE_KV, optional)
- File list, search, create folder, move/copy/delete
- Drag-and-drop uploads
- Multipart uploads for large files
- Thumbnail metadata support
- Temporary share links with expiration
- WebDAV protocol endpoints under
/webdav
- Cloudflare account
- R2 enabled with at least one bucket
- Node.js and npm
npm install- Copy
wrangler.jsonc.exampleto your Wrangler config file and fill bindings. - Set secrets for authentication:
wrangler secret put WEBDAV_USERNAME
wrangler secret put WEBDAV_PASSWORD- Optional local development variables: copy
.dev.vars.exampleto.dev.vars.
npm run build:app
npm run dev:workernpm run deployASSETS: static frontend assets bindingBUCKET: R2 bucket binding for file storage
SHARE_KV: KV namespace for share links
| Name | Required | Default | Description |
|---|---|---|---|
WEBDAV_USERNAME |
Yes | - | Basic Auth username |
WEBDAV_PASSWORD |
Yes | - | Basic Auth password |
WEBDAV_PUBLIC_READ |
No | false |
Allow unauthenticated GET/HEAD/PROPFIND |
SHARE_ENABLED |
No | false |
Enable /api/share and /s/<token> |
SHARE_DEFAULT_EXPIRE_SECONDS |
No | 3600 |
Share-link TTL in seconds |
FlareDrive uses fd-sha256 (client-provided SHA-256) and x-fd-sha256 (server response) to validate uploads.
- Worker accepts
fd-sha256for uploads. - Worker returns
x-fd-sha256using client-provided checksum when present.
Endpoint:
https://<your-domain>/webdav
Notes:
- Uses standard WebDAV paths.
- Typical operations (
PROPFIND,GET,PUT,DELETE,COPY,MOVE,MKCOL) are supported. - Large uploads are handled by the web UI multipart flow.
When SHARE_ENABLED=true and SHARE_KV is configured:
POST /api/sharecreates expiring links.- Download links are served via
/s/<token>. - Only one active token is kept per file path.
src/
components/ # UI components
features/ # Frontend feature modules (transfer/share)
webdav/ # Worker-side auth + WebDAV handlers
worker.ts # Worker fetch entry
App.tsx
main.tsx
npm run dev:appstart Vite dev servernpm run buildbuild frontend assetsnpm run dev:workerrun Worker locally via Wranglernpm run typecheck:workertype-check Worker codenpm run deploybuild + deploy
- Always use strong
WEBDAV_USERNAME/WEBDAV_PASSWORD. - Keep
WEBDAV_PUBLIC_READ=falseunless public read access is intentional. - Consider external rate-limiting controls in front of Basic Auth endpoints.
WebDAV-related implementation is based on r2-webdav by abersheeran.