-
Notifications
You must be signed in to change notification settings - Fork 11
Quick Start Guide
Get R2-Manager-Worker up and running in just a few minutes.
git clone https://github.com/neverinfamous/R2-Manager-Worker.git
cd R2-Manager-Worker
npm installcp .env.example .env
cp wrangler.toml.example wrangler.tomlnpx wrangler loginThis opens a browser window for authentication. Follow the prompts.
Create an R2 bucket:
npx wrangler r2 bucket create my-filesEdit wrangler.toml:
[[r2_buckets]]
binding = "BUCKET"
bucket_name = "my-files"- Go to GitHub Settings → Developer Settings → OAuth Apps
- Click New OAuth App
- Fill in:
- Application name: "R2 Manager"
-
Homepage URL:
https://yourteam.cloudflareaccess.com -
Authorization callback URL:
https://yourteam.cloudflareaccess.com/cdn-cgi/access/callback
- Click Register application
- Copy Client ID and Client Secret
- Go to Zero Trust Dashboard
- Navigate to Settings → Authentication → Login methods
- Click Add new → GitHub
- Paste your GitHub Client ID and Client Secret
- Click Save
- Go to Access → Applications → Add an application → Self-hosted
- Enter:
- Application name: "R2 Manager"
- Session Duration: 24 hours
- Click Add public hostname
- Select your domain or use
workers.dev - Click Next
- Create Allow policy:
- Policy name: "Allow authenticated users"
- Action: Allow
- Include: GitHub (select your identity provider)
- Click Save
- Go to Access → Applications → Select "R2 Manager"
- On Overview tab, copy Application Audience (AUD) Tag
- Go to Settings → Custom Pages to find your Team Domain
Set each secret when prompted:
Account ID (from Cloudflare Dashboard):
npx wrangler secret put ACCOUNT_IDCloudflare Email:
npx wrangler secret put CF_EMAILAPI Token (create at https://dash.cloudflare.com/profile/api-tokens):
npx wrangler secret put API_KEYTeam Domain (format: https://yourteam.cloudflareaccess.com):
npx wrangler secret put TEAM_DOMAINApplication Audience (AUD) Tag:
npx wrangler secret put POLICY_AUDBuild the frontend:
npm run buildDeploy to Cloudflare:
npx wrangler deployYour app is now live! 🎉
-
Workers.dev URL:
https://r2-manager-worker.<your-subdomain>.workers.dev -
Custom domain (if configured):
https://your-domain.com
- ✅ Log in with your GitHub account
- 📦 Create a new bucket to test
- 📤 Upload a test file
- 📖 Read the Installation & Setup guide for detailed explanations
Want to develop locally? Start both servers:
Terminal 1:
npm run devTerminal 2:
npx wrangler devThen visit http://localhost:5173
Note: Authentication is disabled on localhost for easier development.
| Issue | Solution |
|---|---|
| Authentication fails | Check TEAM_DOMAIN includes https://
|
| Bucket not found | Verify bucket_name in wrangler.toml matches exactly |
| Deploy fails | Run npx wrangler login again |
| Secrets not working | Check: npx wrangler secret list
|
Q: Do I need a custom domain?
A: No! Use the free workers.dev subdomain. You can add a custom domain later.
Q: What's the cost?
A: Free tier is generous! Typically $0/month for small-to-medium usage.
Q: Can I use a different identity provider?
A: Yes! Cloudflare Access supports many providers (Google, Azure AD, Okta, etc.).
Q: How do I update my deployment?
A: Just run npm run build && npx wrangler deploy again.
Need more details? Check the Installation & Setup guide or Troubleshooting page.
Ready to explore? See the API Reference for available operations.
- Home - Documentation overview
- Quick Start Guide - Get up and running in minutes
- Installation & Setup - Complete deployment guide
- Configuration Reference - Environment variables and settings
- Upgrade Guide - Database schema migrations
- Bucket Management - Create, rename, delete buckets
- Object Lifecycles - Automate expiration and IA transitions ⭐ NEW
- Local Uploads - Faster uploads via nearby edge storage ⭐ NEW
- Job History - Track bulk operations with audit trail ⭐ NEW
- Webhooks - Configure HTTP notifications for events ⭐ NEW
- AI Search - Semantic search with Cloudflare AI
- S3 Import - Migrate from AWS S3 to R2 ⭐ NEW
- Cross-Bucket Search - Search across all buckets with filters
- File Operations - Upload, download, move, copy, delete files
- Folder Management - Organize files hierarchically
- Signed URLs & Sharing - Generate secure shareable links
- Advanced Filtering - Filter by extension, size, and date
- Development Guide - Local setup and development workflow
- API Reference - Complete endpoint documentation
- Architecture Overview - Technical stack and design
- Authentication & Security - Zero Trust implementation
- JWT Validation - JWT token validation and verification
- Troubleshooting - Common issues and solutions
- FAQ - Frequently asked questions
- Roadmap - Planned features and enhancements