feat: login page says a locked instance is suspended instead of drawing the form
Chart Release / chart (push) Successful in 20s
Server Deploy / deploy (push) Successful in 4m4s

This commit is contained in:
2026-09-11 09:05:44 +00:00
parent 2d96cb4224
commit 5ca705c88c
8 changed files with 180 additions and 16 deletions
+7 -3
View File
@@ -1002,9 +1002,13 @@ plane, each of which this codebase enforces:
- **Disputes lock and purge instances.** HQ writes `instances.locked_at` when
an account is disputed and `instances.purge_after` only once the dispute
fails. `services.InstanceLocked` (60s cache) refuses sessions, API tokens
and agents on a locked instance, and `GetInstanceBySlug` hides it from the
host resolver. The check in `auth.Middleware` is explicit because the host
guard only runs when a host resolves. `ReapTerminatedInstances` purges once
and agents on a locked instance, and `InstanceForHost` and `SoleInstance`
resolve it to nothing. The check in `auth.Middleware` is explicit because the
host guard only runs when a host resolves. `HostLocked` is the one place that
tells "locked" from "unknown", so the login page can say access is suspended
rather than draw a form; `resolveLoginInstance` refuses a locked instance on
the single-instance fallback too, which otherwise served its sign-in page.
A locked instance's public status page stays an ordinary 404. `ReapTerminatedInstances` purges once
both fields are present and `purge_after` has passed, independent of
`FREE_INSTANCE_REAP_AFTER`, and `ReapFreeInstances` skips locked instances
so a restore finds them intact.