Repository navigation
Audiobookshelf import: name an untrusted certificate, import inside setup, offer Match automatically - #395
Merged
Conversation
An https Audiobookshelf with a self-signed certificate (or one for another name, or expired) failed the import's connect as abs_unreachable, and /status read it as not_abs, so the console said the address was wrong. The client now recognises the handshake's verification errors and answers abs_certificate (still a 502, and a failed import's error_code), so the console can point at ABS's plain http:// address instead. Nothing is trusted that wasn't before. Part of #366.
The connect form shows the new code under the address field with what to do (use ABS's plain http:// address on the network), and a failed import that met it says the same as its hint. Words added in all six languages. Part of #366.
…matching The abs step only linked to Settings > Import in a new tab, so someone moving from Audiobookshelf left the flow to do the one thing the step is for. The import (connect card, review cards, past imports) is now ImportFlow, shared by Settings > Import and the abs step, which renders it inline (compact: no step counter of its own) with Continue and Skip as before. While a books library's first scan runs, Connect waits with a line saying so: the import matches against the books the scan finds. The libraries the flow already polls say that; no new field. Once an import is applied the past imports' card offers Match automatically (UnmatchedPrompt, shown only while books are unmatched; it never starts a run), and the abs step offers it once the scan is done; in the flow it opens Health in a new tab so the step stays open. Part of #366.
…urns crypto/tls wraps every verification failure of the server's certificate (unknown authority, another name, expired) in *tls.CertificateVerificationError, so the three x509 targets beside it never matched on their own. One check says the same thing, and CONVENTIONS no longer reads as if there were a second path. The redirect test answers /status with the shared absStatus. Part of #366.
The prop hides the step counter and also opens the match offer in a new tab: both follow from being hosted in a flow that has its own steps and must stay open, not from being smaller. The old name would have handed new-tab links to any later host that only wanted the tighter layout. Part of #366.
The abs step and import tests each rebuilt the no-scan progress and Health's summary with n books not matched; both now come from test/fixtures (idle, and a new unmatchedSummary). Drops an assertion on a link label that no longer exists in any language, so it could not fail. Part of #366.
net/http turns the handshake's tls.RecordHeaderError into ErrSchemeMismatch when the answer was plain HTTP, so the type the import notes named is never what the ABS client returns. The behaviour (abs_unreachable) is unchanged. Part of #366.
The abs step's test spelled out all fourteen fields of an import that the import tests' own factory already defaulted, so a new required field would need adding in each copy. Both now build on importRow in test/fixtures. Part of #366.
ImportFlow decides where the offer goes from whether an import is applied, but read that from an empty list while GET /admin/imports was still out. With a scanned library and an applied import the count could arrive first: the offer showed under the connect form, then moved into the past imports' card when the list came. It now waits for the list. Part of #366.
This was referenced Nov 14, 2026
KodeStar
added a commit
to KodeStar/audiosilo-docs
that referenced
this pull request
Nov 14, 2026
…ort inside setup (#310) Docs for KodeStar/audiosilo-server#366, the Audiobookshelf import. It covers part 2 (KodeStar/audiosilo-server#393, merged) and part 1 (KodeStar/audiosilo-server#395). **Merge with or after #395**: the certificate error, the import inside setup, the match offer and `setup/abs.png` exist only there. ## User Guide - **admin/import.md**: a new "Match your books after an import" section. An import's ASINs and ISBNs are match hints. They never become the book's ASIN and never show in the apps, and the book stays unmatched until a match is applied (hence the offer). Hints come only from libraries the token can see. It also covers: - undo, and which import owns the hints; - an identifier-only import refused when it would replace an applied one; - the certificate error, with the advice to use Audiobookshelf's plain http:// address (never trust the certificate); - waiting for the scan. - **getting-started/first-run.md**: step 6 now runs the import inside the step, says to wait for the scan, and shows the Match automatically offer. - **getting-started/coming-from-audiobookshelf.md**: matches the above. ABS's "Store metadata with item" is off by default (`server/objects/settings/ServerSettings.js`, `storeMetadataWithItem = false`, v2.37.2), so that line is unchanged. - **admin/health.md**: a new "Audiobookshelf's ASINs and ISBNs" section. A `metadata.json`'s ids are the book's own; an import's are hints. A wrong hint is settled by matching the book by hand. - **admin/books.md** ("What matching sends") and **features.md**. ## Developer Docs - **api/reference.md**: - `abs_certificate`, both as a 502 and as an `error_code`; - the summary's `identifiers {books, asin, isbn, by_title, already_matched}` and a new "Identifiers (match hints)" section; - the apply's 409 `import_not_ready` refusal; - undo, the match dialog's hint order and `identifier_disagrees` from a hint. - **data-model.md**: `book_hints` (0074) and "Match hints from an import". It gives the QueryFor order: own ids win, an Audiobookshelf hint goes ahead of tag hints, a tag ASIN goes only when the import gave no identifier, and a tag ISBN may go beside an ABS ASIN. It also covers ownership and the LibriVox drop: a book placed from LibriVox drops the hints at its path, and an adopted folder keeps them. - **web-ui.md** (the abs step and `UnmatchedPrompt` sites), **scanner.md** (hints don't count as matched), **bridge/librivox.md**, **cross-repo-contract.md**, and a listening-imports row in the documentation mapping table. ## Screenshots `setup/abs.png` is recaptured against #395's server. It shows the inline Connect form and the Match automatically offer. ## Checks `npm run build` is green. The docs review (`/simplify` and `/code-review high`) applied 15 fixes, each checked against the code (`internal/matchrun/plan.go` QueryFor, `hints_test.go`, the PR1 console).
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.
Part 1 of #366 (Audiobookshelf import). Part 2, the identifiers kept as match hints, merged as #393.
What
abs_certificate: when Audiobookshelf's https certificate isn't trusted (self-signed or a private CA), Connect, Status and a background fetch now fail withabs_certificate(still 502) instead ofabs_unreachable/not_abs. The console shows it under the address field and points at ABS's plain http:// address. Nothing is ever trusted or skipped. Detection is oneerrors.Ason*tls.CertificateVerificationError: Go's client handshake wraps every verify failure (unknown authority, hostname, invalid) in that type. https to an http-only port staysabs_unreachable(http.ErrSchemeMismatch).ImportFlow(connect, map, review, history) is extracted from Settings > Import and rendered inline in the setup flow's Audiobookshelf step (embedded), replacing the new-tab link. Continue and Skip stay. While a books library is scanning, the step says "Wait for the scan to finish" and Connect is off (from the libraries the flow already polls, so no wire field).UnmatchedPrompt(Match automatically) appears once an import is applied, in the Past imports card, and in the setup step once the scan is done. It links to Health (a new tab from setup) and never starts a run by itself.Error-code wire change is additive; no player change.
Tests
Go: a TLS fake gives
abs_certificatefrom Status and Connect. A hostname mismatch with a trusted pool gives it too, and 127.0.0.1 connects as the control. https to an http port staysabs_unreachable, and plain http is unchanged. API: 502 on connect, anderror_codeon a failed background fetch. Console: the certificate row, ImportFlow inline in the abs step with the scan gate, the offer after an apply and held until the imports are read, and imports-model. Gate: build-admin.sh (1628 tests), go build/vet/test -race, golangci-lint 0.Verified live
Real Audiobookshelf 2.37.2 in Docker:
abs_certificate. Switching to http:// connects. The same results came from the Linux binary inside the:edgeimage (Alpine, Go's own verifier).Not verified: the image's native-SQLite (CGO) build. The certificate check runs before any database work.
Notes
errors.absCertificate,imports.failure.abs_certificate,setup.abs.importandsetup.abs.waitScanis machine-translated and wants a native read.Pairs with KodeStar/audiosilo-docs (docs for #366, PR to follow).