Cloudflare Workers Edge Deployment
The Cloudflare Workers deployment allows you to run a globally distributed, high-availability DoH resolver with zero infrastructure management.
Method 1: Git-Connected Automated Deployment (Recommended)
Section titled “Method 1: Git-Connected Automated Deployment (Recommended)”- Fork the Repository: Click
Forkat the top right of the GitHub repository to clone it to your account. - Create D1 Database:
- In Cloudflare Dashboard, go to
Workers & Pages>D1; - Create a database named
dns_worker_dband copy the generated Database ID.
- In Cloudflare Dashboard, go to
- Configure wrangler.toml:
- In your forked repository, edit
wrangler.toml; - Replace
database_idwith your database ID.
- In your forked repository, edit
- Deploy Application:
- Go to
Workers & Pages>Create application>Continue with GitHub; - Connect your repository and configure build settings:
- Build command:
npm run build - Deploy command:
npm run deploy - Output directory:
/
- Build command:
- Go to
- Set Secrets:
- After initial deployment, go to
Settings>Variables and secrets; - Add
JWT_SECRET(type:Secret, strong random string); - (Optional) Add
KEK_v1(type:Secret) for server-side credential envelope encryption.
- After initial deployment, go to
Method 2: Local CLI Development & Deployment
Section titled “Method 2: Local CLI Development & Deployment”# 1. Clone repository and install dependenciesnpm install
# 2. Initialize and migrate local D1 databasenpm run db:setupnpm run db:migrate:dev
# 3. Configure local development secrets (.dev.vars)echo "JWT_SECRET=your_secure_random_jwt_secret" > .dev.varsecho "KEK_v1=your_secure_kek_v1_secret" >> .dev.vars
# 4. Start local development servernpm run dev
# 5. Deploy to Cloudflare Workersnpm run deployCloudflare D1 Database Studio & Inspection
Section titled “Cloudflare D1 Database Studio & Inspection”Once deployed, all users, profiles, rules, and query logs are persisted in your Cloudflare D1 database. You can inspect live tables, schema, and query records directly in the Cloudflare Dashboard under Workers & Pages > D1 > your database > Console / Explore Data.
