🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix(release): repair root-owned artwork and plugins folders on upgrade (#6143)
Deluan Quintãoded4f47d93d6
diff --git a/release/linux/postinstall.sh b/release/linux/postinstall.shindex ed39fb127..007114ef5 100644--- a/release/linux/postinstall.sh+++ b/release/linux/postinstall.sh@@ -13,15 +13,16 @@ if [ ! -f /etc/navidrome/navidrome.toml ]; thenprintf "MusicFolder = \"/opt/navidrome/music\"\n" >> /etc/navidrome/navidrome.tomlfi+# Older versions created these folders as root when this script ran `navidrome`. They were created empty,+# so no -R. Real dirs only, never following links: navidrome owns /var/lib/navidrome and could plant symlinks.+find /var/lib/navidrome/cache /var/lib/navidrome/artwork /var/lib/navidrome/plugins -maxdepth 0 -type d -user root -exec chown -h navidrome:navidrome {} + 2>/dev/null+postinstall_flag="/var/lib/navidrome/.installed"if [ ! -f "$postinstall_flag" ]; then# The primary reason why this would fail is if the service was already installed AND# someone manually removed the .installed flag. In this case, ignore the errornavidrome service install --user navidrome --working-directory /var/lib/navidrome --configfile /etc/navidrome/navidrome.toml || :- # Any `navidrome` command will make a cache. Make sure that this is properly owned by the Navidrome user- # and not by root- chown navidrome:navidrome /var/lib/navidrome/cachetouch "$postinstall_flag"elsenavidrome service stop --configfile /etc/navidrome/navidrome.toml && navidrome service start --configfile /etc/navidrome/navidrome.toml