fix(deploy): make the view's upper base before installing the view
`ensure_media_view` ran `install` on a host where the documented base directory
did not exist, and `install` refuses by design ("put it on the SSD first") — so
tonight's cutover would have died at the restart step with nobody beside the
box. `media-view.sh ensure-base` now makes the documented directory, and the
deployer calls it first; two seams cover it (the subcommand's behaviour, and the
ordering invariant inside `ensure_media_view`).
Docs flip with the deploy: the view is live on Dankserver (both media servers
verified resolving real media through it), so every "never been deployed" claim
in the view, Plex, Jellyfin and AGENTS pages is corrected, and three laws join
them — a container restart discards the in-flight library scan and nothing
resumes it; Jellyfin 12.4 authenticates only the `MediaBrowser Token` form, so a
401 says nothing about the key until the `ApiKeys` table is read; and Plex
answers 32400 over TLS only, which makes a plaintext health probe read as dead.
This commit is contained in:
1 parent
0336f42e2a
commit
6d79709cc0
6 files changed
+77
-26
No files matched your search
@@ -10,7 +10,8 @@
|
||||
# 4. both media units bind the VIEW and refuse to start without it;
|
||||
# 5. only those two units touch the view — the LLM and library tenants keep the
|
||||
# raw volume, so the blast radius is two containers;
|
||||
# 6. the deployer brings the view up BEFORE it restarts either server;
|
||||
# 6. the deployer creates the upper base and brings the view up BEFORE it
|
||||
# restarts either server;
|
||||
# 7. the planner routes a change to these files to both media services.
|
||||
|
||||
load helpers
|
||||
@@ -110,6 +111,30 @@ UNIT="$REPO_ROOT/dankserver/host/systemd/media-meta-view.mount"
|
||||
done
|
||||
}
|
||||
|
||||
@test "ensure-base creates a base directory that install refuses to invent" {
|
||||
base="$BATS_TEST_TMPDIR/fresh-base"
|
||||
run bash "$VIEW" ensure-base --upper-base "$base"
|
||||
[ "$status" -eq 0 ]
|
||||
[ -d "$base" ]
|
||||
# The deployer runs this on every media deploy, so a second call must be a
|
||||
# no-op and must say so rather than recreate anything.
|
||||
run bash "$VIEW" ensure-base --upper-base "$base"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" == *"exists"* ]]
|
||||
}
|
||||
|
||||
@test "the media deployer creates the upper base before it installs the view" {
|
||||
body="$(sed -n '/^ensure_media_view()/,/^\}/p' "$REPO_ROOT/scripts/deploy-remote.sh")"
|
||||
[ -n "$body" ]
|
||||
base="$(printf '%s\n' "$body" | grep -n 'media-view.sh ensure-base' | head -1 | cut -d: -f1)"
|
||||
inst="$(printf '%s\n' "$body" | grep -n 'media-view.sh install' | head -1 | cut -d: -f1)"
|
||||
# Order is the whole test: install refuses a missing base, so an installer
|
||||
# that runs first dies on a rebuilt host (measured 2026-10-31).
|
||||
[ -n "$base" ]
|
||||
[ -n "$inst" ]
|
||||
[ "$base" -lt "$inst" ]
|
||||
}
|
||||
|
||||
@test "the planner routes the view files to both media services" {
|
||||
run python3 "$REPO_ROOT/scripts/deploy-plan.py" --target dankserver --paths \
|
||||
scripts/media-view.sh dankserver/host/systemd/media-meta-view.mount
|
||||
|
||||
Reference in new issue
Block a user