fix(audiobookshelf): mount the app at the base path its SPA was built for
ROUTER_BASE_PATH=/ served a healthy API and a web UI that could never boot. The index.html in the pinned image is built with routerBasePath:/audiobookshelf, so every script request fell through to the SPA fallback and came back as text/html, which Chrome refuses to execute. healthcheck, the API and the phone app all stayed fine, which is exactly how this hid behind an API-only deploy check. The deployer now reads the mounted base path out of the unit and hands it to the bootstrapper as ABS_URL, so the API door, the login route and the OIDC redirect subfolder cannot drift from the unit. healthcheck answers at the root under either base path, so the health gate is unchanged.
This commit is contained in:
1 parent
f3a6b4f715
commit
cfdd3435bc
3 files changed
+25
-5
No files matched your search
@@ -1315,7 +1315,8 @@ deploy_audiobookshelf() {
|
||||
mkdir -p /home/dank/Containers/audiobookshelf/config \
|
||||
/home/dank/Containers/audiobookshelf/metadata
|
||||
systemctl --user restart audiobookshelf.service
|
||||
# /healthcheck answers once the HTTP server is bound; the library scan that
|
||||
# /healthcheck answers once the HTTP server is bound, at the root whatever
|
||||
# ROUTER_BASE_PATH says (measured on both base paths); the library scan that
|
||||
# follows runs in the background and must not gate the deploy.
|
||||
wait_for_health audiobookshelf http://127.0.0.1:8000/healthcheck 90
|
||||
# A server with no root user and no library is "healthy" and useless, so the
|
||||
@@ -1323,7 +1324,12 @@ deploy_audiobookshelf() {
|
||||
# it creates the account (credential in the mode-600 host secret file), the
|
||||
# Audiobooks library over the /audiobooks bind, and fires the scan. Every
|
||||
# step is idempotent, so a re-deploy costs one incremental scan.
|
||||
scripts/audiobookshelf-init.sh
|
||||
# The bootstrapper has to speak the same base path the unit mounts (the API, the
|
||||
# login route and the OIDC redirect subfolder all hang off it), so the URL is read
|
||||
# out of the unit file here instead of being restated in the script's default.
|
||||
abs_base=$(awk -F= '/^Environment=ROUTER_BASE_PATH=/{print $3}' \
|
||||
dankserver/audiobookshelf/quadlet/audiobookshelf.container)
|
||||
ABS_URL="http://127.0.0.1:8000${abs_base}" scripts/audiobookshelf-init.sh
|
||||
}
|
||||
|
||||
# The content server's single admin account and the desktop's basic-auth
|
||||
|
||||
Reference in new issue
Block a user