Skip to content

K2GO-552 feat(auth): change, repair and reset admin passwords in Settings, warn at start - #812

Merged
luisguzman-adfa merged 22 commits into
mainfrom
feat/K2GO-552-auth-password-change
Nov 22, 2026
Merged

luisguzman-adfa merged 22 commits into
mainfrom
feat/K2GO-552-auth-password-change

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

  • dash-node 1.6.4: POST /credentials/:service/password, POST /credentials/:service/reset and GET /credentials/:service/status. The password changes inside Kolibri, Calibre-Web and Forgejo with each service's own admin tool, then the stored copy follows.
  • One password rule for the three services: 8+ characters with upper case, lower case, digit and symbol (Calibre-Web's policy, the strictest).
    • Changed: 6 characters with a letter and a digit, in any script; Forgejo keeps its own minimum (MIN_PASSWORD_LENGTH, 8 by default). Calibre-Web's policy does not apply (the hash goes to its database) and Kolibri has no rule. The status sends minLength and letterAndDigit, so the app shows the rule from one source.
  • Status is a live sign-in (ok, mismatch, unreachable, plus factoryDefault). It is never stored.
  • Settings > Authentication > : Change password, Repair (only while the service rejects the stored password) and Reset to the factory password. The old "Use a custom sign-in" switch goes.
  • Start notice: a password changed outside the app (auto-login fails), or services that still use the factory password. "Don't show again" asks first and keeps the time of the choice; a switch in Settings > Authentication turns the reminder on again.
    • UI changes: 41 new strings (all 33 locales, machine-translated, pending human review); 13 strings of the old screen removed; k2go_auth_hint replaced by k2go_auth_list_hint. Light and dark verified.
  • No admin account (no_account): the row is gray and does not open (a snackbar says why), and the notice leaves the service out. The reminder switch locks while no service has an account it can manage.
  • A stopped service reads "Not running" (a 404 reads "Not installed"); a tap asks only that service again. Home and Settings share one probe (PlatformProbe). The notice waits for Home "Ready" and asks only the installed services.
    • UI changes (added): k2go_auth_chip_no_account "No admin account", k2go_auth_pw_state_no_account "The admin account is not present in this service.", k2go_auth_no_account_snack "%1$s (%2$s) has no admin account.", k2go_auth_chip_not_running "Not running". Changed: notice title "Factory passwords in use" -> "Factory password in use"; message start "%1$s still use the factory admin password." -> "The factory admin password still works in: %1$s."
    • Notice layout: the services as bullets in two columns (screen name, product name in parentheses below); k2go_auth_notice_factory_msg split into k2go_auth_notice_factory_lead "The factory admin password still works in:" and k2go_auth_notice_factory_risk "Anyone on the same Wi-Fi or hotspot can sign in and change your library. Change it in Settings, Authentication." (each locale cut at the list, no new translation); "Don't show again" in the warn colour; the notice comes after the boot gate.
    • Change password: three live checks with a check mark; the button turns on only when all three are met. k2go_auth_pw_rule removed; added k2go_auth_pw_rule_length (plurals) "At least %1$d characters", k2go_auth_pw_rule_kinds "Letters and numbers", k2go_auth_pw_rule_match "Both passwords match". Changed k2go_auth_pw_state_factory: "... can sign in." -> "... can sign in as admin." The user name is in bold.

Why

  • The factory password (Admin / changeme) is public. Before, the user had to change it in each service and type it again in Settings.

Steps to QA

  • Baseline (main): Settings > Authentication only stores a sign-in; the service keeps changeme; no notice at start.
  • Change:
    1. Open the app with factory passwords: the notice names Calibre-Web, Kolibri, Forgejo.
    2. Settings > Authentication > Read a book: change to a valid password; the state turns green; Books opens signed in.
    3. Change the password inside the service: next start shows "Automatic sign-in does not work"; the row shows "Does not match"; Repair with the real password turns it green.
    4. Reset to the factory password: the service takes changeme again.

Verifications

  • Tested on Samsung A16 (Kolibri 0.19.5, Calibre-Web 0.6.28b, Forgejo 17.0.1): two changes per service, outside change, repair, reset, notice, "Don't show again", reminder switch; English light and Spanish dark.
  • Tested on OnePlus 7T (app and box from this branch, main merged): the notice comes at "Ready" and names only the services with an account; Forgejo without an admin shows "No admin account"; Kolibri and Calibre-Web stopped show "Not running" and lock the reminder switch; a tap after the start shows "Default" again.
  • Tested on OnePlus 7T and Samsung A16 (app and box from this branch): the notice in two columns after the boot gate, light and dark, with 2 and 3 services; the three checks (Kolibri 6 characters, Forgejo 8); the button stays off until all three are met.
  • dash-node tests (185), app JVM tests and lint pass. Evidence is in the Jira ticket.
  • Deferred: the list and the service screen each run a status sign-in (one extra failed Calibre-Web sign-in per visit while it does not match).

Notes

  • Calibre-Web locks sign-in for one minute after 3 failed tries and answers it like a wrong password. A change whose tool exits 0 saves the copy and reports verified: false; the status turns ok after the minute.
  • The Forgejo CLI takes the password only in argv (inside the box, for about 1 s).
  • Removed on purpose: storing a sign-in for a service that is not running, and choosing another admin account.

… services

Kolibri, Calibre-Web and Forgejo get the new password through their own admin tool, then the
stored copy follows. Status is a live sign-in, never stored. dash-node 1.6.4.
…ings, warn at start

Settings > Authentication drives the dash-node password routes; the old custom sign-in switch
goes. A start notice names a broken auto-login, or the services that still use a factory password.
Machine-translated, pending human review. The list hint now names Host code and the in-place change.
@luisguzman-adfa luisguzman-adfa added ui change or edit to UI strings changes or updates on xml strings files labels Nov 21, 2026
The notice asked the three services at app start and asked again every 15 s
(8 tries) while one did not answer. A service that is not installed never
answers, so on a phone without Kolibri and Forgejo the notice came after
2 minutes.

Now Home starts the check when its header turns "Ready" (the services
answered their probes). The check asks only the services that the Home
probes did not find absent (PlatformEvidence, the source of the
"Not installed" card), one time each. The retry loop goes.
Right after the cards are built, the Home header can say "Ready" before
any probe answered: a card starts GRAY, and GRAY does not gate. The
notice then asked all three services at once, they answered
"unreachable", and no notice came.

Home now reports "ready" for the notice only when the header says Ready
and every card has probe evidence in this process. Each probe answer
updates the header, so Home asks on every Ready update; the activity
runs the check once per launch.
A probe that gets no answer (NONE: nginx is up, the service is not yet)
also records evidence, and it records it before the card shows it. On a
cold start the header said "Ready" with Books still at NONE, and the
Calibre-Web status check failed as "unreachable".

Home is ready for the notice only when every card has PRESENT or ABSENT.
… mismatch

A Forgejo installed from the app can have no admin account yet: its seed
creates the account with the stored copy. Its sign-in rejects the stored
password, and the status said "mismatch", so the app showed "changed
outside this app" and offered a Repair that cannot work.

probeLogin now asks forgejoStatus (the owner of the "admin exists" fact)
after a Forgejo rejection: no admin account means "unreachable" (nothing
to check yet), an existing account means "rejected". Status, change and
reset all use probeLogin. No version bump while the PR is open.
…ervices

"%1$s still use the factory admin password" was wrong with one service,
and the title "Factory passwords in use" too. The new text does not
depend on the count: "Factory password in use" / "The factory admin
password still works in: %1$s." Each locale gets its own natural
sentence (machine translation, pending human review); the rest of the
message is unchanged. Translator comments on the strings with a
placeholder (K2G-4).
When a service rejects the stored password, dash-node now asks whether
the admin account is present: Forgejo through forgejoStatus, Calibre-Web
in its app.db, Kolibri with its manage shell. Not present (never created,
or deleted by the user) gives the status "no_account" and the change
error "no_account" (409), not "mismatch". If the check cannot tell, it
stays "mismatch", so a real changed password is never hidden.
…esent

The status "no_account" maps to PasswordState.Sync.NO_ACCOUNT. Settings >
Authentication shows "No admin account" in the list (row gray) and
"The admin account is not present in this service." on the service
screen, with Change and Reset off. The start notice ignores it. Two new
strings in all locales (machine translation, pending human review), with
translator comments.
…-in answer

Kolibri answers an unknown user name with HTTP 400 NOT_FOUND on
"username" (a wrong password is a 401). dash-node classified that 400 as
a protocol error, so the status said "unreachable". Now it is "absent"
(no_account). The manage-shell check for Kolibri goes: the sign-in
answer is the source, and it is faster.
- Settings > Authentication: a service without an admin account does not
  open; a tap shows "<screen> (<product>) has no admin account."
  (new string, all locales). The fields on the service screen are off too.
- The factory reminder switch shows off and locked when no service has an
  admin account. It reads the rows' live answers; the stored choice does
  not change.
- AuthServices: one ordered service list for Settings and the start
  notice, so a new service is added in one place.
PlatformProbe is the one probe of a box platform page. It records each
answer in PlatformEvidence before the caller's view gate. Home calls it
instead of its private copy. AuthServices.homeEndpoint is the one map
from a service to its probe key.
… again

Settings > Authentication uses the shared probe, so a 404 is "Not
installed" and no answer is "Not running" (the old probe called a 404
"up"). A tap on such a row asks only that service again: no timer, and
no new sign-in to the other services. The reminder lock reads the last
answer of each row, so it opens again when a service with an account
comes back. A row opens its screen only after the service answers.
The start notice shows each service as a bullet item in two columns:
the screen name over the product name in parentheses. The rows grow as
N / 2. The message is split into the lead line and the risk line; each
locale keeps its approved words (cut at the list). "Don't show again"
uses the warn colour token: allowed, but not advised. The notice comes
only after the boot gate animation ended. AuthScreenNames is the one
place for the screen name of a service.
A new admin password needs 6 characters and nothing more (NIST SP
800-63B: no mix of character kinds). Calibre-Web's own policy does not
apply, because the hash goes to its database, and Kolibri has no rule.
Forgejo keeps its own minimum (MIN_PASSWORD_LENGTH in app.ini, 8 by
default). The status gives minLength per service, so the app reads the
rule from one source.
Two checks under the fields show a check mark when they are met: "At
least N characters" (N from the box status) and "Both passwords match".
"Change password" turns on only when both are met. The old rule line
(upper case, lower case, digit, symbol) is removed in all locales.
The rule is now 6 characters (Forgejo: its own minimum) with at least
one letter and one digit, in any script. It keeps out the factory
password. The status sends letterAndDigit with minLength, so the app
shows the whole rule from one source.
"Change password" shows three checks: the length, letters and numbers,
and the same two fields. The button turns on when all three are met.
The user name is in bold, and the factory line says the risk: anyone
can sign in as admin. The test strings are ASCII escapes.
…uttons

The empty cell after the last service was a plain View, which takes all
the height it is offered: the risk line and the buttons went off the
screen. A Space measures 0 high. Seen with three services on the
Samsung A16.
@luisguzman-adfa
luisguzman-adfa merged commit 8cf37e3 into main Nov 22, 2026
5 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-552-auth-password-change branch November 22, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

strings changes or updates on xml strings files ui change or edit to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant