mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-15 01:04:56 +00:00
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:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user