navidrome: restore data folder ownership on install and update

Upstream's deb postinstall runs chown navidrome:navidrome on
/var/lib/navidrome/cache without -R, and only behind an .installed
flag, so it never runs again on an upgrade. Every navidrome command
the packaging invokes as root creates cache content owned by root,
which the service then cannot write as the navidrome user - artwork
that was already cached keeps working while newly resolved album and
playlist covers fail.

Reassert ownership of the data folder after deploying the release.
The music folder is left alone, it is commonly a bind mount.
This commit is contained in:
MickLesk
2026-09-14 16:03:47 +02:00
parent 787dbf2420
commit 0a8426d0c0
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -38,6 +38,15 @@ function update_script() {
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
# The upstream postinstall only chowns the cache directory itself, and only
# on the very first install, so root-owned subdirectories survive upgrades
# and the service can no longer write its artwork there.
if id -u navidrome >/dev/null 2>&1; then
msg_info "Fixing Data Folder Ownership"
chown -R navidrome:navidrome /var/lib/navidrome
msg_ok "Fixed Data Folder Ownership"
fi
msg_info "Starting Services"
systemctl start navidrome
msg_ok "Started Services"
+4
View File
@@ -19,6 +19,10 @@ msg_ok "Installed Dependencies"
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
if id -u navidrome >/dev/null 2>&1; then
chown -R navidrome:navidrome /var/lib/navidrome
fi
msg_info "Starting Navidrome"
systemctl enable -q --now navidrome
msg_ok "Started Navidrome"