Maintenance mode
Enable maintenance mode to show a static page to public visitors while staff continue working.
Enable
MAINTENANCE_MODE=true
MAINTENANCE_MESSAGE="We're upgrading THE HCLAB. Back shortly."
Optional bypass for preview:
MAINTENANCE_BYPASS_SECRET=your-secret-token
Visit any URL with ?bypass=your-secret-token to set a 24-hour bypass cookie.
Behavior
When MAINTENANCE_MODE=true:
- Public routes rewrite to
/maintenance - Staff with admin panel roles pass through normally
- Allowed paths without bypass:
/login,/api/auth/*, Stripe webhook, cron routes, robots, sitemap
Implementation: src/middleware.ts and src/lib/maintenance.ts.
Who can access during maintenance
Users with roles in ADMIN_PANEL_ROLES (Admin, Editor, Contributor, Researcher) bypass the maintenance page automatically when signed in.
Public access during maintenance
/docs remains available during maintenance so operational documentation stays reachable. Staff with admin panel roles also bypass the maintenance page when signed in.
Set MAINTENANCE_MODE=false or remove the variable, then redeploy.