Next.js app with dashboard for managing Cloudflare R2
Don't wanna deal with all this? We got you covered.
Fully hosted version with authentication and a database (thanks to a Neon Postgres Integration)
NOTE: If deploying on vercel your static file upload limit is 100MB for Hobby accounts and 1GB for Pro accounts. https://vercel.com/docs/limits#static-file-uploads
cp .env.example .env.local
1.5. Getting Cloudflare Variables:
Click "Manage API Tokens"
Click "Create API Token"
Make sure the API token you create has ADMIN READ AND WRITE, otherwise you will not be able to list/create/edit and delete buckets.
Token Value -> CLOUDFLARE_API_TOKEN Access Key ID -> CLOUDFLARE_ACCESS_KEY_ID Secret Access Key -> CLOUDFLARE_SECRET_ACCESS_KEY
Click "Finish"
Click "← R2"
Then click "API" -> "Use R2 with APIs"
Account ID -> CLOUDFLARE_ACCOUNT_ID S3 Compatable API Endpoint -> CLOUDFLARE_R2_ENDPOINT
.env.local
:CLOUDFLARE_ACCOUNT_ID
: Your Cloudflare account ID (found in the Cloudflare dashboard URL)CLOUDFLARE_ACCESS_KEY_ID
: R2 access key ID (generate in Cloudflare R2 dashboard → "Manage R2 API Tokens")CLOUDFLARE_SECRET_ACCESS_KEY
: R2 secret access key (shown when generating the token above)CLOUDFLARE_API_TOKEN
: API token with R2 permissions (create in Cloudflare dashboard → "My Profile" → "API Tokens")CLOUDFLARE_R2_ENDPOINT
: Your R2 endpoint URL (format: https://<ACCOUNT_ID>.r2.cloudflarestorage.com
)First, run the development server:
bun i
bun dev
Open http://localhost:3000 with your browser to see the result. It will take a few seconds to load the first time & properly load/cache the data. It will show all of your buckets and the files within them.
type:image
- Filter by file type (image, document, code, media, archive)size>1mb
- Files larger than 1MBsize<1gb
- Files smaller than 1GBafter:2024-01-01
- Files modified after datebefore:2024-12-31
- Files modified before dateTo learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
CURRENTLY THERE IS NO AUTHENTICATION ON THIS APP. ANYONE WITH ACCESS TO THE URL OF THIS APP CAN VIEW AND EDIT ALL OF YOUR BUCKETS AND FILES. ONLY USE THIS APP ON A PRIVATE NETWORK IF YOU ARE OK WITH THIS. WE ARE NOT RESPONSIBLE FOR ANY DATA LOSS OR LEAKAGE.
This project is licensed under the MIT License - see the LICENSE file for details.