Skip to content

zakonet/FlareDrive

Repository files navigation

FlareDrive

Cloudflare Pages + R2 file library with public browsing and scoped admin uploads.

Features

  • Public file browsing and downloads
  • R2-backed uploads, folders, rename, delete, copy, and move
  • Large file multipart uploads
  • Image/video/PDF thumbnails
  • Multiple admin accounts with per-directory write permissions

Cloudflare Pages Setup

  1. Connect this repository to Cloudflare Pages.
  2. Set the build command to npm run build.
  3. Set the build output directory to build.
  4. Add environment variables:
Variable name Value
PUBURL Public R2 bucket URL, for example https://pub-xxxx.r2.dev
admin:123456 *
user1:123456 user1/

The admin variable name is username:password. The value is the directory the account can write to. Use * for full write access. Multiple directories can be separated with commas, semicolons, or new lines.

If Cloudflare rejects : in variable names, use one variable named FD_ADMINS instead:

admin:123456=*
user1:123456=user1/
  1. Start the first deployment.
  2. Bind the R2 bucket to the Pages project with binding name BUCKET.
  3. Redeploy so the BUCKET binding is available to Pages Functions.

Open the deployed site to browse files publicly. Use the top-right menu to sign in before uploading, creating folders, renaming, or deleting files. A scoped account can only write inside its configured directory; for example user1:123456 = user1/ can create and modify files under user1/.

Local Development

npm run dev

The dev script builds the React app and starts Cloudflare Pages Functions with a local R2 binding named BUCKET. For local admin accounts, create .dev.vars and prefer FD_ADMINS:

PUBURL=
FD_ADMINS="admin:123456=*
user1:123456=user1/"

API Notes

The original WebDAV endpoint has been removed. The web app now uses Pages Functions under /api/*.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages