Skip to content

Lost the first-run password: reset-admin; the Your account step; adding a missing book; invite and job wording - #307

Merged
KodeStar merged 10 commits into
mainfrom
docs/new-user-c
Nov 14, 2026
Merged

KodeStar merged 10 commits into
mainfrom
docs/new-user-c

Conversation

@KodeStar

@KodeStar KodeStar commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Documents v2.7.0 batch C on the server.

  • First run: where the password is in a NAS or Docker container's log, the start-up reminder, and reset-admin with the exact command per install type (our image, Unraid/linuxserver, Synology, Linux package, a terminal), its refusals and exit codes. The setup flow's nine steps, with Your account first and Connect a phone last, and the marketplace preselect.
  • Troubleshooting: "I lost the first-run admin password" now leads with reset-admin before resetting the database.
  • Matching: the Overview/Books notice, Add it to the community database (new "Adding a missing book" section in community/meta-site.md), and Health's "ASIN not in the community database" state.
  • Invites and Bridge: both certificate warnings, the typed-code invite wording, and a failed job's last step.
  • Developer Docs: the additive API fields and codes (printed_password, metadata.region_chosen, PATCH /admin/users username, current_password_incorrect, username_required, unknown_asin, the /setup 303), the first-run state, and the token cache's one-minute re-read.
  • Screenshots: a new setup/account.png; the setup flow, the login page, and the Overview and Books shots with the not-matched notice recaptured.

Reviewed at high (Opus) with every command, string and field fact-checked against the server branches. npm run build green.

Pairs with KodeStar/audiosilo-server#389 and KodeStar/audiosilo-server#390.

…and invite wording

Set up your server gains Your account as step 1 and moves Connect a phone to
the end, with how signing in works. A lost first-run password is now fixed
with reset-admin (the sign-in reminder each start prints, and the command for
Docker, Unraid, Synology, a package or a terminal) before any database reset.
The marketplace is preselected from the browser until one is chosen. Health
gains the ASIN-not-in-the-database card, Not found rows and the match dialog
offer Add it, the overview and Books point at Match automatically, the
certificate warning follows self-signed mode, and failed Bridge jobs keep
their last step.

Part of server#369, server#192, server#370 and server#386.
…API fields

Documents the reset-admin command (refusals, exit codes, what it revokes and
how a running server sees it), the start's sign-in hint and the server_state
keys first_admin and metadata_region_chosen, the token cache's one-minute
re-read, PATCH /admin/users username, username_required and
current_password_incorrect, GET /admin/setup printed_password and the new step
order, GET /admin/settings metadata.region_chosen, and Health's unknown_asin
kind. The console notes cover the login hint, the region preselect, Add it,
the not-matched notice, the invite certificate rule, the typed invite code
and a failed job's last step.

Part of server#369, server#192, server#370 and server#386.
…console notices

capture-setup.mjs drives the flow in its new order (Your account first, the
Bridge skipped, Connect a phone last with Finish setup) in an en-GB browser, so
the metadata step shows the marketplace preselected from the browser. Adds
setup/account.png and recaptures the setup shots, the sign-in page's first-run
hint, and the not-matched notice on the overview and Library > Books. The
finish card's alt text now says it lists one skipped step, as it does.

Part of server#369, server#192 and server#370.
…iobookshelf step

The invite card's certificate notice now says why the browser will warn: the
server's self-signed certificate, or https at an IP address. The Audiobookshelf
step records done on Continue whether or not the import was opened, the
nearest-marketplace lookup falls back to the US store, and the lost-password
entry points at the command table, since the start's reminder stops once an
admin signs in.

Part of server#369, server#192 and server#386.
… not-matched notice

The palette, bell, phone-width overview and books table shots are taken over
the overview or Library > Books, which now lead with the not-matched notice.
The capture comments and the finish card's hint say what the flow really
records: the Audiobookshelf step done, the Bridge step skipped.

Part of server#370.
…'s order

A server never started with --setup now answers GET /setup with the same
303 to /admin as a closed wizard, not 404, so the console's sign-in probe
logs no failed request. reset-admin on the first-run admin turns
printed_password false, so the Your account step stops saying the password
came from the log. The step changes the password before the rename, so a
wrong current password leaves the username unchanged. Also folds the
token-cache detail into one sentence that links to Tokens, and points the
unknown-ASIN generation rule at its one home in Overview.

Part of server#369.
The restore refusal and the failed auth-code revoke were explained only in
Troubleshooting, so a reader sent from an install page to "If you lose the
password" never saw them. They now sit in that section's list, and
Troubleshooting links to it. Also fixes a capture comment that still spoke
of two skipped setup steps after the phone step stopped being skipped.

Part of server#369.
A username given on a server with no admin is a usage error (exit 2), not
the "no admin yet" exit 1. A server running as root prints its docker exec
line without -u. reset-admin notes its password through
auth.NoteOwnPassword, the rule a password the admin chose follows.

Part of server#369.
…ng apply

Health leaves the unknown_asin kind out whenever the report can't run:
report_unknown off, community metadata off, or a demo server, not only the
first. The setup flow's metadata step saves the region only while lookups
are on, so turning them off leaves region_chosen false. A public name gets
the self-signed invite warning while the server runs self-signed, since a
proxy in front of it can't be told apart.

Part of server#369 and server#370.
Any admin's password sign-in ends the start's reminder, the apps' sign-in
included, not only the console's. The data folder list again says that
backups/ holds them only unless another backups folder is set, a caveat
lost in the rewrite.

Part of server#369.
KodeStar added a commit to KodeStar/audiosilo-server that referenced this pull request Nov 14, 2026
…t in setup, the nearest Audible marketplace (#389)

A server installed with Docker (or any headless start) creates `admin`
with a random password and prints it once. Recreate the container and it
is gone, the console had no way to choose your own, and the sign-in page
pointed at a setup link the log never had. This makes first sign-in
recoverable and lets the admin pick their own account.

Closes #369, closes #192.

## What changes

**Lost the first-run password: `reset-admin`**
- New command `audiosilo [--data DIR] reset-admin [username]`. It sets a
fresh random password for the only admin (or the one named) through the
console's own set-password path, prints it, and revokes the first-run
auth code printed beside the old password. Sessions end. A running
server accepts the new password at once, and a cached session ends
within a minute (restart to end it at once).
- It refuses a missing or non-AudioSilo database, pending migrations,
and a backup restore waiting for the next start. Exit codes: 0 ok, 1
refused or failed (if revoking the code fails, the new password is still
printed first), 2 usage.
- Until the first-run admin first signs in to the console with a
password (or changes it), every later start logs a reminder with the
exact command for where it runs: `docker exec -u <uid>:<gid> <container>
audiosilo --data /data reset-admin` in our image (the server's own ids,
so no root-owned files), the full `/app/audiosilo/audiosilo --data
/config` path on the linuxserver image. The plaintext is never stored;
the reminder is a hint only (owner decision, V2.7.0-PLAN decision 6).
- The state is a `server_state` row `first_admin` written only by
`ensureAdmin` when it creates the admin, so upgraded servers and
`--setup` installs never show the reminder. No migration.
- The auth token cache re-reads a cached row once it is a minute old, so
a reset from another process reaches a running server.

**Console setup flow**
- New first step **Your account**: change the username and choose a
password (skippable). Reverses FIRST-RUN-PLAN.md decision 1 (V2.7.0-PLAN
decision 5). The password changes before the rename, so a wrong current
password leaves the name alone.
- **Connect a phone** moves to the end and explains sign-in: scan with
the app, the log's auth code works there, other people need an invite.
- The sign-in page says what a new server's username and password are
and where the password is; the "open the setup link" line shows only
while `/setup` is open.
- **#192:** the Audible marketplace step preselects the marketplace
nearest the admin (browser language region, then time zone,
nearest-marketplace mapping, US fallback) while no region was ever
chosen; config.yaml and `AUDIOSILO_METADATA_REGION` are never
overridden. Settings > Community metadata offers the same suggestion as
a row until a region is chosen. (The issue assumed the default was `us`;
it is "No preference".)

## Wire (all additive)
- `GET /admin/setup`: `printed_password` (bool).
- `GET /admin/settings`: `metadata.region_chosen` (bool).
- `PATCH /admin/users/{id}`: optional `username`; 400
`username_required`, 409 `username_taken`. `POST /admin/users` also
answers `username_required`.
- `POST /auth/password`: a wrong current password is still 401, now with
`code: current_password_incorrect` (shared with the player; shipped
builds unaffected).
- `GET /setup` on a server that never enabled the wizard now 303s to
`/admin` (was 404), the same answer as a closed wizard, so the console's
probe logs no 404 and a signed-out caller learns less than before.
- Setup step ids: `account` first, `phone` last.

## Tests and review
- Go: reset-admin (one admin, named, several unnamed, unknown name, no
admin, foreign file, pending migrations, pending restore, revoke
failure, the code it revokes and keeps), the reminder state (upgrade,
`--setup`, once-only writes, failed mark), rename authz (allowed and
denied), the /setup answers, the token cache re-read. Console: the
account step (order, wrong password, refused name), the locale/time zone
mapping, preselect only when never chosen.
- Gate green: `scripts/build-admin.sh`, `go build/vet/test -race`,
golangci-lint, and the native-engine vet/test/lint.
- Review: /simplify + /code-review two passes at the ★ level (high-x2,
Fable 5.2), then two fix rounds at high (Opus).

## Verified live (Playwright, real builds)
- Fresh headless start: banner; restart: the reminder; `reset-admin`
while running: the new password signs in at once, the old code and
sessions get 401; after a console sign-in, no reminder. A data dir from
main (3b03e1c) upgraded: no reminder. `--setup`: no reminder.
- Docker: the printed `docker exec -u 1026:100 ...` command works on a
non-root volume and files stay 1026:100.
- Sign-in page: hint shown, no console errors, setup line only with
`/setup` open.
- Setup: Your account first (wrong password message in English and
German, rename + new password, skip), phone step last with its Invite
link.
- Marketplace: en-GB/London -> United Kingdom, de-AT/Vienna -> Germany,
unmapped -> United States, env-locked and config values kept, the
Settings offer row.

Not verified: a real NAS (Synology/Unraid) container run.

Pairs with #390 (independent) and
KodeStar/audiosilo-docs#307.
KodeStar added a commit to KodeStar/audiosilo-server that referenced this pull request Nov 14, 2026
… found, ASINs the database doesn't know; invite and Bridge job polish (#390)

A new user moving from Audiobookshelf could not find bulk matching, hit
a dead end when a book was not in the community database, and had no way
to see books whose own ASIN the database does not know. This puts Match
automatically where people look, gives "not found" a next step, and
folds in the invite and Bridge-job polish left from batch B.

Closes #370. Part of #386 (everything except the player's `has_cover`,
which needs a player change and stays open there).

## server#370: matching surfaces
- Overview and Library > Books show "N books not matched" with **Match
automatically**, opening the bulk match card.
- A **Not found** row in bulk match and the match dialog's empty state
say the book is not in the community database yet and still plays as
normal, with **Add it**, a link to
`https://meta.audiosilo.app/add?q=...` prefilled with, in order, an ASIN
the admin typed, the book's ASIN, the search words, or title and author.
(meta's add page is `/add`; `/contribute` takes no prefill.)
- Health gets its own state, **ASIN not in the community database**,
from the existing `unknown_asin_reports` table, listed while the
unknown-ASIN report (Help complete the community database) is on. Such
books still count as matched: making them unmatched would let Match
automatically replace an ASIN the admin set (follow-up). The table's
userstate rule now moves the content generation on a new or flipped row
so the Health cache stays exact (measured: one move per report commit).
- Findings that were wrong: tag ASINs have not counted as matched since
0067; Overview already linked to Not matched.

## server#386: polish
- Invite dialog: the certificate warning shows for https when the server
runs self-signed (any name) or the link is at an IP address, with a
sentence for each reason.
- Invite page: wording for someone who typed a code rather than
following a link.
- A second Share press while the share sheet is open is ignored.
- Settings > Bridge > Jobs: failed and cancelled jobs keep their last
step.
- LibriVox fetch ids are checked with `model.ValidSlug`; the `Adopted`
tri-state has named states; one console `failureCode`; `useTrackedJob`
moved into the bridge feature.

## Wire
Admin API only, additive: issue kind `unknown_asin` in `/admin/issues`,
`?issue=`, and the ignore endpoint. No migration, nothing the player
reads.

## Tests and review
- Go: the issue kind (listing, gating on the report, ignore allowed for
an admin, 403 member, 401 anonymous), the userstate writers against the
content generation on both engines. Console: the new surfaces, Add it
URL building (encoding of `&`, `#`, `+`, `%`, `=`, non-ASCII, lone
surrogates), certificate reasons per case, share in flight, jobs' last
step.
- Gate green: `scripts/build-admin.sh`, `go build/vet/test -race`,
golangci-lint, native-engine vet/test/lint.
- Review: /simplify + /code-review at the full level (high, Fable 5.2);
copy fixes after live verification (gate only).

## Verified live (Playwright, real builds)
- Overview + Books notice opens bulk match; Not found rows and the empty
match dialog show the wording and Add it with the expected `q`; meta's
`/add` page takes the prefill.
- A real unknown-ASIN report run (through a local proxy so the made-up
ASIN never reached meta) shows the Health state; ignoring it holds.
- Certificate warning: self-signed at a name, TLS off at an https IP,
none on plain http.
- Typed-code invite wording on an iPhone viewport; failed and cancelled
jobs' last step (seeded jobs, no Bridge).
- Second Share press: with a stubbed share only; **a real phone run is
still owed**.

Pairs with #389 (independent) and
KodeStar/audiosilo-docs#307.
@KodeStar
KodeStar merged commit 0a7f29c into main Nov 14, 2026
1 check passed
@KodeStar
KodeStar deleted the docs/new-user-c branch November 14, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant