Compare commits

..

1 Commits

Author SHA1 Message Date
MickLesk
552bc23472 navidrome: repair root-owned data folders left by 0.61.x
Navidrome 0.61.x created cache, artwork and plugins under the data
folder whenever any navidrome command ran, including the ones the deb
postinstall runs as root. 0.62 stopped creating them that way but never
corrected the owner, so a container that passed through 0.61.x carries a
root-owned artwork directory. 0.64.0 is the first release to write into
it and fails with

  writing image store: mkdir /var/lib/navidrome/artwork/hashed:
  permission denied

which breaks newly resolved album covers and every playlist cover, since
those are composites.

Repair the three directories the same way navidrome/navidrome#6143 does:
the entries themselves only, since they were created empty, real
directories owned by root only, and chown -h, because the navidrome user
owns the data folder and could otherwise plant a symlink.

The trailing || true is not in the upstream copy and is needed here.
Their postinstall runs without set -e, while update_script runs under
catch_errors, which sets -Ee with an ERR trap. find exits 1 as soon as
one starting point is missing, so on a container without a plugins
directory the update would abort.

Fixes the report in #17247, confirmed there by the reporter's stat and
dpkg log: artwork is root-owned and dated to their 0.60.3 -> 0.61.1
upgrade.
2026-09-15 09:56:56 +02:00
3 changed files with 6 additions and 36 deletions

View File

@@ -38,6 +38,9 @@ function update_script() {
fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary"
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 || true
msg_info "Starting Services"
systemctl start navidrome
msg_ok "Started Services"

View File

@@ -191,30 +191,11 @@ EOF
sed -i -e "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" \
-e "s|alias .*/cache/;|alias ${ROMM_BASE}/cache/;|" /etc/angie/http.d/romm.conf
fi
cat <<'SYNCEOF' >/usr/local/bin/romm-sync-angie-paths
#!/usr/bin/env bash
base="$(grep -m1 '^ROMM_BASE_PATH=' /opt/romm/.env 2>/dev/null | cut -d= -f2)"
base="${base:-/var/lib/romm}"
[[ -f /etc/angie/http.d/romm.conf ]] || exit 0
sed -i -e "s|alias .*/library/;|alias ${base}/library/;|" \
-e "s|alias .*/cache/;|alias ${base}/cache/;|" /etc/angie/http.d/romm.conf
SYNCEOF
chmod +x /usr/local/bin/romm-sync-angie-paths
mkdir -p /etc/systemd/system/angie.service.d
cat <<'DROPEOF' >/etc/systemd/system/angie.service.d/romm-paths.conf
[Service]
ExecStartPre=/usr/local/bin/romm-sync-angie-paths
DROPEOF
systemctl daemon-reload
systemctl reload angie
elif [[ -f /etc/nginx/sites-available/romm ]]; then
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
nginx_enable_site romm
fi
if [[ -f /etc/systemd/system/romm-watcher.service ]]; then
sed -i "s|\(watcher\.py' \).*|\1\${ROMM_BASE_PATH}/library|" /etc/systemd/system/romm-watcher.service
systemctl daemon-reload
fi
msg_ok "Updated ROMM"
msg_info "Starting Services"

View File

@@ -327,22 +327,8 @@ server {
}
EOF
cat <<'SYNCEOF' >/usr/local/bin/romm-sync-angie-paths
#!/usr/bin/env bash
base="$(grep -m1 '^ROMM_BASE_PATH=' /opt/romm/.env 2>/dev/null | cut -d= -f2)"
base="${base:-/var/lib/romm}"
[[ -f /etc/angie/http.d/romm.conf ]] || exit 0
sed -i -e "s|alias .*/library/;|alias ${base}/library/;|" \
-e "s|alias .*/cache/;|alias ${base}/cache/;|" /etc/angie/http.d/romm.conf
SYNCEOF
chmod +x /usr/local/bin/romm-sync-angie-paths
mkdir -p /etc/systemd/system/angie.service.d
cat <<'EOF' >/etc/systemd/system/angie.service.d/romm-paths.conf
[Service]
ExecStartPre=/usr/local/bin/romm-sync-angie-paths
EOF
systemctl daemon-reload
/usr/local/bin/romm-sync-angie-paths
sed -i -e "s|alias /var/lib/romm/library/;|alias ${ROMM_BASE}/library/;|" \
-e "s|alias /var/lib/romm/cache/;|alias ${ROMM_BASE}/cache/;|" /etc/angie/http.d/romm.conf
rm -f /etc/angie/http.d/default.conf
systemctl restart angie
systemctl enable -q --now angie
@@ -419,7 +405,7 @@ Type=simple
WorkingDirectory=/opt/romm/backend
EnvironmentFile=/opt/romm/.env
Environment="PYTHONPATH=/opt/romm/backend"
ExecStart=/opt/romm/.venv/bin/watchfiles --target-type command '/opt/romm/.venv/bin/python watcher.py' \${ROMM_BASE_PATH}/library
ExecStart=/opt/romm/.venv/bin/watchfiles --target-type command '/opt/romm/.venv/bin/python watcher.py' /var/lib/romm/library
Restart=on-failure
RestartSec=5