Skip to content

An extremely simple app to upload stuff to my R2 bucket which I can share with anyone

License

Notifications You must be signed in to change notification settings

flashblaze/files

Repository files navigation

File Uploader

This is a simple file uploader built with React Router, Shadcn (themed via tweakcn), and Lucide.

Getting Started

  1. Create a public R2 bucket and give it a custom domain
  2. Edit the CORS policy like so:
[
  {
    "AllowedOrigins": [
      "http://localhost:5173",
      "your-custom-domain.com"
    ],
    "AllowedMethods": [
      "GET",
      "PUT",
      "HEAD"
    ],
    "AllowedHeaders": [
      "*"
    ],
    "ExposeHeaders": [
      "ETag"
    ],
    "MaxAgeSeconds": 3600
  }
]
  1. Clone the repository and create a .dev.vars file from dev.vars.example
  2. Follow API Token to create access key and secret key
  3. Replace the variables in the .dev.vars file with your own
  4. Install dependencies via pnpm i
  5. Run the development server via pnpm dev
  6. Put the main domain behind Cloudflare Access so you only can access and you're good to go!

Deploying

Add R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY to Variables and Secrets with type set to Secret

About

An extremely simple app to upload stuff to my R2 bucket which I can share with anyone

Topics

Resources

License

Stars

Watchers

Forks