feat(audiobookshelf): Audiobookshelf with SFTP, its route and Authentik client #195

Merged
ivuorinen merged 4 commits from ivuorinen/feat/audiobookshelf into main 2026-10-26 16:27:35 +00:00 AGit
Owner

Audiobookshelf's folder watcher reads a new file once, after it stops growing for a few seconds and the watcher has been quiet for 10, or after 10 minutes; later writes are ignored. copyparty's SFTP writes straight into the final name, so a stalled or long transfer was recorded half-copied: locally, a file paused for 20 s mid-write kept half its size until a library scan. docs/17-library.md now has a scheduled nightly scan turned on, and a scan run after each SFTP session.

The auth settings page preselects /audiobookshelf for the redirect subfolder on a fresh install, which sends /audiobookshelf/auth/openid/callback; the provider listed only the root paths, so the first OIDC login would fail. It now lists both, as Audiobookshelf's OIDC guide does.

copyparty's tcpSocket probes on SFTP logged two lines each, one a WARN, and its readiness probe could take Audiobookshelf's web endpoint down over an SFTP fault. It now has only a liveness probe, nc to its loopback HTTP, which logs nothing.

Audiobookshelf's folder watcher reads a new file once, after it stops growing for a few seconds and the watcher has been quiet for 10, or after 10 minutes; later writes are ignored. copyparty's SFTP writes straight into the final name, so a stalled or long transfer was recorded half-copied: locally, a file paused for 20 s mid-write kept half its size until a library scan. docs/17-library.md now has a scheduled nightly scan turned on, and a scan run after each SFTP session. The auth settings page preselects /audiobookshelf for the redirect subfolder on a fresh install, which sends /audiobookshelf/auth/openid/callback; the provider listed only the root paths, so the first OIDC login would fail. It now lists both, as Audiobookshelf's OIDC guide does. copyparty's tcpSocket probes on SFTP logged two lines each, one a WARN, and its readiness probe could take Audiobookshelf's web endpoint down over an SFTP fault. It now has only a liveness probe, nc to its loopback HTTP, which logs nothing.
Audiobookshelf for audiobooks, as its own Application: one Deployment
running as the image's node user with a read-only root filesystem, a
config and a metadata volume in Longhorn's default backup group, and the
audiobook volume in trim-only.

Its upload page sends a whole book in one request, and Traefik ends any
request whose body takes longer than 60 s, its default readTimeout
(reproduced locally with Traefik 3.7.8). So the pod also runs copyparty
for SFTP only, as Kavita's pod does, on its own MetalLB address,
192.168.5.78. It signs in the same library account with the same host
keys, from a second ExternalSecret reading the copyparty-sftp item, so the
onepassword store now admits the audiobookshelf namespace. Its HTTP
listens on loopback, and it trusts no identity header.

Authentik gets an Audiobookshelf provider, with the verified email
mapping (Audiobookshelf refuses to match an account by an email marked
unverified), bound to authentik Admins. Gatus checks the app and the
SFTP port, Homepage has a tile, and AdGuard's seed resolves
audiobookshelf-sftp.t.9b11.xyz.

tests/library.bats runs its copyparty, probe and NetworkPolicy checks
over both pods.
Audiobookshelf migrates its database at start, and its patch releases do so as often as its minors: of the migrations 2.37.2 ships, those of 2.15.1, 2.15.2, 2.17.3-2.17.7, 2.19.1 and 2.19.4 came in patches. A failed migration restores its own backup, but a successful one is not undone by going back to the older image. So neither is automerged, as Authentik's minors are not.

A local Renovate dry run with the image held at 2.37.1 and 2.36.1 put both updates in one branch, automerge true before the rule and false after it.
docs/17-library.md covers Audiobookshelf: its volumes, the oidc-audiobookshelf item, claiming the root account at once, the one-time OIDC setup and the database edit that turns password login back on (tested on a local database), the phone app, SFTP with the shared copyparty-sftp item and its AdGuard rewrite, the upload page's 60 s limit and the partial uploads it leaves, rotation, the Renovate rule and the checks.

The README's Docs entry, the recurring jobs' header and the links from docs/03 and docs/10 follow.
fix(audiobookshelf): scan after SFTP, admit both callback paths, quieter probes
All checks were successful
validate / render (pull_request) Successful in 2m17s
validate / hooks (pull_request) Successful in 3m39s
379d88748b
Audiobookshelf's folder watcher reads a new file once, after it stops growing for a few seconds and the watcher has been quiet for 10, or after 10 minutes; later writes are ignored. copyparty's SFTP writes straight into the final name, so a stalled or long transfer was recorded half-copied: locally, a file paused for 20 s mid-write kept half its size until a library scan. docs/17-library.md now has a scheduled nightly scan turned on, and a scan run after each SFTP session.

The auth settings page preselects /audiobookshelf for the redirect subfolder on a fresh install, which sends /audiobookshelf/auth/openid/callback; the provider listed only the root paths, so the first OIDC login would fail. It now lists both, as Audiobookshelf's OIDC guide does.

copyparty's tcpSocket probes on SFTP logged two lines each, one a WARN, and its readiness probe could take Audiobookshelf's web endpoint down over an SFTP fault. It now has only a liveness probe, nc to its loopback HTTP, which logs nothing.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ivuorinen/turingpi-cluster!195
No description provided.