/admin/ is the review queue and the deployment’s state: a Worker route on the DB binding
Go live creates, open to the accounts named in admin.emails. An admin is
an account: you sign in on /login/ like any submitter — email and password, or Google — and
open /admin/.
-
Name the admins.
site.config.ts features: { submissions: true, accounts: true },admin: { emails: ['you@acme.com'] },Accounts have to be on —
pnpm check:configsaysfeatures.accounts … must be true while admin.emails names anyoneotherwise.admin.email(singular) is a different field: where the operator’s notifications go, elsesite.contactEmail. -
Set the signing secret —
pnpm cf:setupgenerates and uploads it; to rotate it by hand:Terminal pnpm cf:secrets TOKEN_SECRETThe value comes from
.env.prod, 32 characters or more;node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"makes one. -
Deploy, then sign in with a proven address.
Terminal pnpm deployOpen
https://<your domain>/admin/: it sends you to/login/. Sign in with Google, or ask for a password-reset link on/login/forgot/and open it — either proves the address is yours, and/admin/opens. A password typed into/signup/alone does not: signing up checks nothing, so/admin/answers “Prove this address first” until Google or the link has been through.
Verify
Section titled “Verify”| What to check | Where | You should see |
|---|---|---|
| The gate | /admin/, signed out |
a 302 to /login/?next=%2Fadmin%2F |
| Who gets in | /admin/, signed in as a listed, proven address |
the review queue, your address beside Sign out |
| Who does not | /admin/, signed in as anybody else |
403 at /admin/login/: “Not an admin”, with the address and the fix |
| The report | /admin/ |
a “Configuration” card, or none |
| The jobs | Workers & Pages → your Worker → Logs | one jobs: … line an hour |

Worth knowing
Section titled “Worth knowing”- Locally it is the same: put your address in
admin.emails, runpnpm dev, and sign in with Google (GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETin.env), or sign up with a password and prove the address with the reset linkproviders.email: 'console'prints in the terminal. - A signed-in admin’s account menu and dashboard sidebar carry an Admin entry; nobody else’s
do.
/admin/is still checked on every request — the entry is a convenience, not the guard. - Read the “Configuration” card after every deploy — each state is silent otherwise.
error: on and broken —
Missing secret DEPLOY_HOOK_URL — run: wrangler secret put DEPLOY_HOOK_URL (local: add to .env); warning: lossy (providers.rebuild is "none", so approvals never reach the site). - Approve takes an optional slug; Reject… needs a reason of three characters or more,
emailed verbatim, and “Awaiting payment” rows cannot be approved. Delete refuses a paid row
and takes its R2 objects with it; Mark as paid by hand writes a
manual:paymentsrow, Resend the status email flushes the outbox. /admin/listings/?q=&status=&tier=&page=browses everything and bookmarks. One listing (/admin/listings/<id>/) previews through the real normaliser, so a category dropped fromsite.config.tsreads “This row cannot be rendered yet”.- Sign out on
/admin/ends the account’s session on the whole site; each write leaves anaudit_logrow.

The hourly jobs
Section titled “The hourly jobs”One cron trigger, 0 * * * * in wrangler.jsonc, runs runJobs() in this order.
| Job | What it does |
|---|---|
expireFeatured |
demotes a closed paid window, asks a rebuild |
adminDigest |
queues the daily reminder at queue.digestHourUtc while anything waits |
flushOutbox |
sends up to 20 queued messages, five attempts each |
retryRebuilds |
refires the oldest failed build |
purgeUnpaid |
deletes submissions unpaid past limits.unpaidTtlDays |
sweepAuth |
with features.accounts, deletes expired sessions and password-reset links |
jobs: expireFeatured=0 flushOutbox=2 retryRebuilds=0 purgeUnpaid=0 adminDigest=0 (cron=0 * * * *, in 41ms)pnpm exec wrangler tail streams it; skipped: no DB binding, emailFailures=<n> and
errors: … join it only when relevant. Locally: pnpm build, pnpm exec wrangler dev, then
curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=0+*+*+*+*" — under pnpm dev that URL
is the 404 page.
When it is off or degraded
Section titled “When it is off or degraded”| State | Visitor sees | /admin/ reports |
Fix |
|---|---|---|---|
| Signed out | 302 to /login/?next=… |
— | sign in |
| Signed in, not listed | 403 “Not an admin” at /admin/login/ |
— | add the address to admin.emails, deploy |
| Listed, not proven | 403 “Prove this address first” |
— | sign in with Google, or open a reset link |
admin.emails empty |
“Admin is not set up” at /admin/login/ |
error: admin.emails is empty: nobody can sign in to /admin/ (pnpm cf:doctor says the same) |
name an address, deploy |
TOKEN_SECRET missing |
status and checkout links cannot be signed; /submit/ refuses |
error: nothing can be signed | pnpm cf:secrets TOKEN_SECRET |
TOKEN_SECRET is the example value |
every link is forgeable | error: “still the value from .env.example” | generate a value, upload it |
triggers missing from wrangler.jsonc |
nothing expires, mail waits | no jobs: line |
restore the cron, deploy |
Configuration
Section titled “Configuration”admin.emails, admin.email and providers.adminNotify — admin, providers.
Directorysrc/
Directorypages/admin/
login.astrois the page that says why/admin/is shut- …
Directorytemplates/admin/
- …
Directorycomponents/admin/ ConfigGaps, RebuildBar, QueueTable, ListingForms
- …
- layouts/Admin.astro
- actions/admin.ts
- middleware.ts the guard
Directoryserver/
- admin-auth.ts
isAdminEmail(),adminAccess() - audit.ts
- queries.ts
- secrets.ts
configGaps() - jobs.ts
runJobs()
- admin-auth.ts
- worker.ts
scheduled()
- scripts/dev-setup.ts
- wrangler.jsonc the cron trigger
- tests/e2e/admin.spec.ts the gate, the queue, an approval, in a browser