···75757676# ---------------------------------------------------------------------------
7777# Cron secret — protects the worker tick endpoint (`/api/jobs/run`) from
7878-# unauthenticated callers. In prod, Vercel Cron sends this automatically;
7979-# locally, `pnpm jobs:tick` reads it from this env var.
7878+# unauthenticated callers. Vercel auto-injects this as the `Authorization:
7979+# Bearer` header on cron invocations, so the name must be exactly CRON_SECRET
8080+# (not NUXT_-prefixed). Locally, `pnpm jobs:tick` reads the same var.
8081# Generate with: pnpm gen:cron-secret
8182# ---------------------------------------------------------------------------
8282-NUXT_CRON_SECRET=<base64url-encoded 32 bytes>
8383+CRON_SECRET=<base64url-encoded 32 bytes>
83848485# Optional: per-invocation worker time budget in milliseconds.
8586# Default 25_000. Set lower in dev so `pnpm jobs:tick` returns sooner when
···3838```bash
3939pnpm gen:jwk # NUXT_ATPROTO_PRIVATE_JWK
4040pnpm gen:encryption-key # NUXT_ENCRYPTION_KEY and NUXT_SESSION_PASSWORD
4141-pnpm gen:cron-secret # NUXT_CRON_SECRET
4141+pnpm gen:cron-secret # CRON_SECRET
4242```
43434444The rest (`NUXT_DATABASE_URL`, the `NUXT_GITHUB_APP_*` values) come from your
···7272 Mark the secrets (`NUXT_DATABASE_URL`, `NUXT_GITHUB_APP_PRIVATE_KEY`,
7373 `NUXT_GITHUB_APP_CLIENT_SECRET`, `NUXT_ATPROTO_PRIVATE_JWK`,
7474 `NUXT_ENCRYPTION_KEY`, `NUXT_SESSION_PASSWORD`,
7575- `NUXT_GITHUB_WEBHOOK_SECRET`, `NUXT_CRON_SECRET`) as **Sensitive**.
7575+ `NUXT_GITHUB_WEBHOOK_SECRET`, `CRON_SECRET`) as **Sensitive**.
76763. Set `NUXT_PUBLIC_URL` to your real origin, point the GitHub App webhook at
7777 `https://<your-domain>/api/github/webhook`, and set the App's Setup +
7878 Callback URLs to `https://<your-domain>/connect` and
···11/**
22 * Trigger the worker tick endpoint locally.
33 *
44- * Reads `NUXT_CRON_SECRET` from `.env` (loaded by Node's --env-file when run
55- * via `pnpm jobs:tick`) and POSTs to /api/jobs/run with the matching
66- * `Authorization: Bearer …` header.
44+ * Reads `CRON_SECRET` from `.env` (loaded by Node's --env-file when run via
55+ * `pnpm jobs:tick`) and GETs /api/jobs/run with the matching
66+ * `Authorization: Bearer …` header — the same shape Vercel Cron sends.
77 *
88- * In production, Vercel Cron does this automatically every minute; this
99- * script is the local equivalent.
88+ * In production, Vercel Cron does this automatically; this script is the
99+ * local equivalent.
1010 */
11111212import process from 'node:process'
13131414const url = process.env.JOBS_TICK_URL ?? 'http://127.0.0.1:3000/api/jobs/run'
1515-const secret = process.env.NUXT_CRON_SECRET
1515+const secret = process.env.CRON_SECRET
16161717if (!secret) {
1818- console.error('NUXT_CRON_SECRET not set; copy from .env or run `pnpm gen:cron-secret`')
1818+ console.error('CRON_SECRET not set; copy from .env or run `pnpm gen:cron-secret`')
1919 process.exit(1)
2020}
21212222const response = await fetch(url, {
2323- method: 'POST',
2323+ method: 'GET',
2424 headers: { authorization: `Bearer ${secret}` },
2525})
2626