Sign-in lockout with console unlock, and forgotten-password reset
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s

- Wrong passwords in a row are counted across every device and kept in
  the database. The first 3 are free; from the 3rd the next attempt
  waits 15 s, 30 s, 1, 2, 5, 15 and 30 minutes; the 10th locks sign-in
  until the unlock code printed to the server log (and saved to
  unlock-code.txt) is entered. Signed-in devices keep working. Only one
  password check runs at a time, so parallel guesses cannot skip a wait.
- "Forgot password?" prints a reset code to the log (reset-code.txt),
  valid once for 15 minutes. It sets a new password, signs out every
  device, lifts any lockout and signs in. Asking again while a code is
  valid prints nothing new.
- Codes are stored hashed; wrong codes count toward the per-address
  limit. RESET_ADMIN_PASSWORD also lifts a lockout.
- Sign-in page: a live countdown during a wait, an unlock step and a
  reset step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-16 15:46:16 -07:00
parent fe94dbf876
commit 917954d12d
7 changed files with 522 additions and 18 deletions

View file

@ -51,6 +51,26 @@ when an existing V2 schema needs upgrading. A database from a newer app version
The first visit asks for the setup code from the container log or `/data/setup-code.txt`.
After setup, the password is stored as a salted scrypt hash. No registration exists.
## Sign-in lockout and password reset
Wrong passwords are counted in a row across every device, and the count is kept in the
database, so restarting does not clear it. The first 3 are free. From the 3rd, the next
attempt must wait 15 s, then 30 s, 1, 2, 5, 15 and 30 minutes. The **10th** wrong password
locks sign-in. Devices that are already signed in keep working. To lift a lockout, enter the
**unlock code** on the sign-in page. It is printed to the container log
(`docker logs <container>`) and saved to `/data/unlock-code.txt`. Lifting the lockout does not
sign you in, and the count starts again. A correct password also starts the count again.
**Forgot password?** on the sign-in page prints a **reset code** to the log and saves it to
`/data/reset-code.txt`. Asking again while a code is valid prints nothing new. The code works
once, for 15 minutes. It sets a new password, signs out every device, lifts any lockout and
signs you in. Both codes need access to the server, as the setup code does. Wrong codes count
toward the per-address limit (8 in 15 minutes).
Anyone who can reach the sign-in page can use up the 10 attempts and lock it. A lockout never
reveals or weakens the password, and the console code always gets you back in.
`RESET_ADMIN_PASSWORD` (below) still works too and also lifts a lockout.
## Reverse proxy
Point your proxy to the container's port 3726 (or the host's mapped port). Forward `Host`,