fix: redirect to setup wizard on fresh deployments when public page is first request

On a fresh CF deployment, if the first request hits a public page, the
middleware fast-path skips runtime init. Template helpers like
getSiteSettings() then query an empty database and crash with
'no such table: options'.

Add a one-time setup probe in the middleware fast-path: check if the
migrations table exists, and redirect to the setup wizard if not.
The check is cached for the worker lifetime after first success.

Also includes release workflow update to use GitHub App token and
admin branding changeset.
This commit is contained in:
Matt Kane
2026-04-01 14:14:05 +01:00
parent 4925c6014f
commit 3c319ed641
3 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"emdash": patch
---
Fix crash on fresh deployments when the first request hits a public page before setup has run. The middleware now detects an empty database and redirects to the setup wizard instead of letting template helpers query missing tables.