feat(calibre-server): Calibre Content Server as a boot-persistent Quadlet

lscr.io/linuxserver/calibre:9.15.0 (desktop build) running calibre-server
as the s6 main service on internal 8090 -> host 8084, auth-gated with a
plaintext userdb (mode 600) bootstrapped once by the deploy handler.
The desktop GUI is kept on 8080/8182, basic-authed with the same
credential pair via the machine-local env file.
This commit is contained in:
Frank
2026-09-21 12:46:02 -07:00
parent 660db661b6
commit 94cfb90ead
5 changed files with 173 additions and 24 deletions
+26
View File
@@ -80,3 +80,29 @@ load helpers
grep -q '^Environment=PGID=0$' "$unit" || return 1
! grep -qE '^(UserNS|UsernsMode)=' "$unit" || return 1
}
@test "calibre-server unit exists and is boot-persistent" {
unit="$REPO_ROOT/dankserver/calibre-server/quadlet/calibre-server.container"
[ -f "$unit" ] || return 1
grep -q '^WantedBy=default.target$' "$unit" || return 1
grep -q '^Restart=always$' "$unit" || return 1
}
@test "calibre-server serves the content server auth-gated on the published port" {
# The security contract: the content server runs with --enable-auth and
# --auth-mode=basic (Digest is the non-SSL default and rejects Basic
# clients with 400), on the internal port the unit publishes as 8084.
unit="$REPO_ROOT/dankserver/calibre-server/quadlet/calibre-server.container"
grep -q '^Exec=calibre-server --port 8090 --enable-auth --auth-mode=basic --userdb /userdb.sqlite /books$' "$unit" || return 1
grep -q '^PublishPort=8084:8090$' "$unit" || return 1
}
@test "calibre-server consumes host-local credential stores, never in-repo secrets" {
unit="$REPO_ROOT/dankserver/calibre-server/quadlet/calibre-server.container"
grep -q '^EnvironmentFile=/home/dank/Containers/calibre-server/env$' "$unit" || return 1
grep -q '^Volume=/home/dank/Containers/calibre-server/userdb.sqlite:/userdb.sqlite$' "$unit" || return 1
# The userdb's pw column is plaintext: no literal password may appear in
# the tracked unit, and the desktop basic-auth credential comes from the
# env file, not an Environment= line.
! grep -qE '^Environment=CUSTOM_(USER|PASSWORD)=' "$unit" || return 1
}