Repository navigation
K2GO-552 feat(auth): change, repair and reset admin passwords in Settings, warn at start - #812
Merged
Merged
Conversation
… 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
POST /credentials/:service/password,POST /credentials/:service/resetandGET /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).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 sendsminLengthandletterAndDigit, so the app shows the rule from one source.ok,mismatch,unreachable, plusfactoryDefault). It is never stored.k2go_auth_hintreplaced byk2go_auth_list_hint. Light and dark verified.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.PlatformProbe). The notice waits for Home "Ready" and asks only the installed services.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."k2go_auth_notice_factory_msgsplit intok2go_auth_notice_factory_lead"The factory admin password still works in:" andk2go_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.k2go_auth_pw_ruleremoved; addedk2go_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". Changedk2go_auth_pw_state_factory: "... can sign in." -> "... can sign in as admin." The user name is in bold.Why
Steps to QA
Verifications
Notes
verified: false; the status turnsokafter the minute.