2.7 KiB
2.7 KiB
Admin Panel - Quick Start Guide
Get your admin panel up and running in 5 minutes.
Prerequisites
✅ Basic system is already set up (R2 bucket, worker deployed) ✅ Wrangler CLI is authenticated ✅ Python 3.8+ installed
Setup Steps
1. Run Admin Setup Script
./scripts/setup-admin.sh
This will:
- Create a KV namespace for video metadata
- Prompt you to set an admin password
- Update configuration automatically
Set a strong password! This protects your admin panel.
2. Build the Worker
python3 scripts/build-worker.py
This embeds the admin interface into your Cloudflare Worker.
3. Update Wrangler Config
cd worker
cp wrangler-enhanced.toml wrangler.toml
Verify the KV namespace ID is correct in wrangler.toml:
[[kv_namespaces]]
binding = "VIDEO_METADATA"
id = "abc123..." # Should be filled in automatically
4. Deploy
wrangler deploy
5. Access Admin Panel
Open: https://videos.jeffemmett.com/admin
Login with the password you set in step 1.
Quick Usage
Set Video Visibility
- Find your video in the list
- Click the dropdown
- Choose:
- Private (🔒): Only you can access
- Shareable (🔗): Anyone with link
- Clip Shareable (✂️): Only clips are public
Create a Shareable Clip
- Click "Create Clip" on any video
- Enter start time:
1:30(1 minute 30 seconds) - Enter end time:
3:00(3 minutes) - Click "Generate Clip Link"
- Share the URL!
Delete a Video
- Click "Delete" button
- Confirm deletion
- Video is permanently removed from R2
Troubleshooting
"Unauthorized" Error
Reset your password:
cd worker
wrangler secret put ADMIN_PASSWORD
KV Namespace Not Found
List your namespaces:
wrangler kv:namespace list
Update the ID in wrangler.toml.
Admin Panel Shows Placeholder
The admin HTML wasn't embedded. Run:
python3 scripts/build-worker.py
cd worker && wrangler deploy
Default Behavior
- New uploads are Shareable by default
- Public gallery shows only Shareable videos
- Private videos return 403 to non-admin users
- Clip Shareable videos require auth for full video
Security Tips
✅ Use a strong, unique password ✅ Don't share your admin credentials ✅ Review video permissions regularly ✅ Sessions expire after 24 hours ✅ HTTPS-only cookies
Next Steps
- Read ADMIN.md for complete documentation
- Learn about API endpoints
- Explore advanced features
Need Help?