A lightweight Cloudflare Worker that allows VpnHood Manager to securely publish a farm-token.txt file to the edge — and serve it publicly from a fast, global CDN.
- ✅ Public GET: anyone can access
/farm-token.txt - ✅ Authenticated POST: only authorized clients can upload/update
- ✅ Built with Cloudflare Workers + KV storage
- ✅ Compatible with VpnHood’s “Farm Token URL” publishing
- ✅ No backend server needed
npm install -g wrangler
git clone https://github.com/your-username/vpnhood-token-updater.git
cd vpnhood-token-updater
wrangler login
wrangler kv:namespace create "FARM_TOKENS"
wrangler secret put API_TOKEN
wrangler deploy🔐 Security Model
| Method | Endpoint | Access |
|---|---|---|
| GET | /farm-token.txt | Public |
| POST | /farm-token.txt | Bearer Token (env.API_TOKEN) |
📥 VpnHood Configuration
| Field | Value |
|---|---|
| Publish URL | https://vpnhood-token-updater..workers.dev/farm-token.txt |
| Access Token | Your API token (e.g. wF9mX38UjPYr2nDbLkq7RZc0AH6BsEvo) |
| Auto Upload | POST |
| Headers | Authorization: Bearer {access_token} |
| Body | {farm_token} |