Replace disk-modifying chown/chmod with non-destructive accessibility check

Instead of modifying actual filesystem permissions on the mounted disk
(which would be destructive), we now only check whether the mount point
is likely inaccessible by the configured PUID and warn the user with
instructions to fix it themselves on the host.

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/fc207e95-fe21-468e-ab90-0819676fbf87

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-22 15:12:34 +00:00
committed by GitHub
parent 00f7b604fe
commit e95820921d
2 changed files with 9 additions and 8 deletions

View File

@@ -103,15 +103,16 @@ if bashio::config.has_value 'localdisks'; then
bashio::addon.stop
)
# Set ownership and permissions on the mount point AFTER mounting
# so that apps running as PUID/PGID can access the content
# Check if the mount is accessible by the configured PUID/PGID
# We do NOT chown/chmod the mount point as that would modify actual disk permissions
if bashio::config.has_value 'PUID' && bashio::config.has_value 'PGID'; then
PUID="$(bashio::config 'PUID')"
PGID="$(bashio::config 'PGID')"
chown "$PUID:$PGID" "$dirpath"/"$disk" 2>/dev/null \
|| bashio::log.warning "Could not chown $dirpath/$disk to $PUID:$PGID - content may not be accessible"
chmod 755 "$dirpath"/"$disk" 2>/dev/null \
|| bashio::log.warning "Could not chmod $dirpath/$disk - content may not be accessible"
mount_owner=$(stat -c '%u' "$dirpath/$disk" 2>/dev/null)
mount_perms=$(stat -c '%a' "$dirpath/$disk" 2>/dev/null)
if [ "$mount_owner" != "$PUID" ] && [ "${mount_perms:2:1}" = "0" ]; then
bashio::log.warning "$dirpath/$disk is owned by UID $mount_owner with permissions $mount_perms - may not be accessible by PUID $PUID."
bashio::log.warning "If the drive appears empty, fix permissions on the drive root: chmod 755 <mountpoint> (on the host)."
fi
fi
done

View File

@@ -1,7 +1,7 @@
## 10.11.9 (2026-05-22)
- Update to latest version from linuxserver/docker-jellyfin (changelog : https://github.com/linuxserver/docker-jellyfin/releases)
- Fix local drive mounts (btrfs/ext4) showing empty when app runs as PUID/PGID
- Add warning when local drive mount permissions may prevent access by PUID/PGID
## 10.11.8 (2026-04-06)
- Update to latest version from linuxserver/docker-jellyfin (changelog : https://github.com/linuxserver/docker-jellyfin/releases)