BUG: SetupRequired middleware blocks /health, /s/*, and /api/* before initial setup #108
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: HIGH
File & Line
internal/middleware/middleware.go:394-430andinternal/server/routes.go:29Description
SetupRequiredis applied as global middleware on ALL routes (s.router.Use(s.mw.SetupRequired())). When no user exists (fresh install), it redirects everything except/setupto/setup.This breaks:
/health— returns 303 redirect instead of 200 JSON. Load balancers and monitoring systems will consider the service down during the setup window./s/*(static assets) — CSS/JS for the setup page itself cannot load, so the setup page renders unstyled./api/v1/*— API routes get HTML redirects instead of JSON errors./webhook/*— webhooks return redirects.Impact
Suggested Fix
Exempt paths that should work without setup: