-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration
This page covers all configuration options for Setup Manager HUD. Follow these steps in order for a new deployment, or jump to a specific section for reference.
Setup Manager HUD stores webhook events in Cloudflare D1. Without this, webhook and API responses return a configuration error and the dashboard shows a storage warning.
When using the Deploy to Cloudflare button from the main README, Cloudflare reads wrangler.toml and can provision the D1 binding declared there:
[[d1_databases]]
binding = "DB"
database_name = "setupmanagerhud-events"
database_id = "setupmanagerhud-events"The deploy script applies migrations with the binding name:
npx wrangler d1 migrations apply DB --remoteDuring Deploy Button setup, Cloudflare may ask for WEBHOOK_TOKEN. Enter a long random value, save it somewhere secure, and use that exact same value in Setup Manager. Do not leave it blank. After deployment, verify the Worker has a D1 binding named DB and that WEBHOOK_TOKEN is set before sending real Setup Manager webhooks.
No CLI needed - everything in the browser.
1. Create the database:
- Log in to the Cloudflare dashboard
- Go to Workers & Pages -> D1 SQL Database in the left sidebar
- Click Create database
- Name it
setupmanagerhud-events - Click Add
2. Bind it to your Worker:
- Go to Workers & Pages -> click your Worker
- Go to Settings -> Bindings
- Click Add binding -> D1 Database
- Variable name:
DB(must be exactly this) - Select your database from the dropdown
- Click Save and Deploy
Note
Dashboard bindings can be removed if you later redeploy from GitHub with a wrangler.toml D1 section that points somewhere else. For persistent GitHub/CLI deploys, use the CLI method and commit your database ID to your fork.
3. Apply the migration:
If you created the database in the dashboard, apply the migration from a local clone:
npx wrangler d1 migrations apply DB --remoteBindings persist across redeploys when configured in wrangler.toml.
# Create the database
npx wrangler d1 create setupmanagerhud-events
# Copy the database_id from the outputEdit wrangler.toml and replace the Deploy Button placeholder ID with the UUID from wrangler d1 create:
[[d1_databases]]
binding = "DB"
database_name = "setupmanagerhud-events"
database_id = "paste-your-d1-database-id-here"Apply migrations:
npx wrangler d1 migrations apply DB --remoteRedeploy:
npm run deploySecrets are encrypted and never exposed in logs or code.
| Secret | Purpose | Required |
|---|---|---|
WEBHOOK_TOKEN |
Shared token for webhook authentication | Yes |
WEBHOOK_SECRET |
Legacy fallback name for existing installs | No |
Set a secret:
npx wrangler secret put WEBHOOK_TOKEN
# Paste your token when promptedUse a non-empty value you know and have saved. Cloudflare hides Worker secrets after they are saved, so if you lose the value, generate a new token and update both the Worker secret and Setup Manager.
List secrets:
npx wrangler secret listDelete a secret:
npx wrangler secret delete WEBHOOK_TOKENSee Security for complete webhook token setup instructions.
Non-sensitive configuration stored in wrangler.toml.
| Variable | Purpose | Default |
|---|---|---|
CF_ACCESS_AUD |
Cloudflare Access audience tag | (not set) |
CF_ACCESS_TEAM_DOMAIN |
Cloudflare Access team domain | (not set) |
RETENTION_DAYS |
Number of days to keep D1 events | 90 |
[vars]
CF_ACCESS_AUD = "your-audience-tag"
CF_ACCESS_TEAM_DOMAIN = "your-team.cloudflareaccess.com"
RETENTION_DAYS = "90"Important
If CF_ACCESS_AUD and CF_ACCESS_TEAM_DOMAIN are not set, the Worker skips JWT validation. The dashboard works but doesn't verify that requests came through Cloudflare Access.
Set these only after creating a Cloudflare Access application for the dashboard. See Security#optional-verify-cloudflare-access-jwts-in-the-worker for why this is recommended, where to find the values, and how to redeploy from a local clone or GitHub Actions.
For local development with npm run dev:worker, create a .dev.vars file:
WEBHOOK_TOKEN=local-test-token
See .dev.vars.example for a template. This file is gitignored.
The wrangler.toml file configures your Worker deployment. Key sections:
name = "setupmanagerhud"
main = "src/index.ts"
compatibility_date = "2024-12-01"
compatibility_flags = ["nodejs_compat"]-
name: Your Worker name (becomes the subdomain) -
main: Entry point file -
compatibility_date: Cloudflare runtime version -
compatibility_flags: Enable Node.js compatibility
[[d1_databases]]
binding = "DB"
database_name = "setupmanagerhud-events"
database_id = "setupmanagerhud-events"Deploy Button installs can use the placeholder-style database_id above during Cloudflare provisioning. Manual CLI/GitHub deploys should replace database_id with the D1 UUID from npx wrangler d1 create setupmanagerhud-events.
[triggers]
crons = ["0 3 * * *"]The scheduled Worker deletes D1 events older than RETENTION_DAYS. If RETENTION_DAYS is not set, the Worker keeps 90 days of history.
[[durable_objects.bindings]]
name = "DASHBOARD_ROOM"
class_name = "DashboardRoom"
[[migrations]]
tag = "v1"
new_sqlite_classes = ["DashboardRoom"]The Durable Object handles WebSocket connections. This is pre-configured and shouldn't need changes.
[assets]
directory = "dist"The React dashboard is built to dist/ and served as static assets.
[vars]
CF_ACCESS_AUD = "your-audience-tag"
CF_ACCESS_TEAM_DOMAIN = "your-team.cloudflareaccess.com"Verify your configuration via the health endpoint:
curl https://your-worker.workers.dev/api/healthResponse:
{
"status": "healthy",
"timestamp": 1735689600000,
"d1": "connected",
"durable_objects": "connected",
"connections": 0
}| Field | Healthy Value | Problem Value |
|---|---|---|
status |
healthy |
degraded |
d1 |
connected |
not configured or error
|
durable_objects |
connected |
not configured or error
|
If any field shows a problem value, see Troubleshooting.
GET /api/events returns an array of stored events. The endpoint supports server-side filtering for larger deployments.
| Parameter | Values |
|---|---|
limit |
1 to 1000
|
offset |
0 or higher |
eventType |
started, finished, failed
|
failedOnly |
true |
macOSVersion |
partial version text |
model |
partial model name |
serial |
partial serial number |
search |
searches serial, model, computer name, macOS version, and user ID |
timeRange |
hour, day, week
|
Example:
curl "https://your-worker.workers.dev/api/events?eventType=failed&timeRange=week&limit=50"