mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-27 07:13:32 +02:00
Version 1.25 chowned the data location to a hardcoded 1000:1000 but never mapped the shared abc desktop user to that UID: during cont-init abc was still the image default (911), so TokenSave, RTK, nginx, PulseAudio, the Mesa shader cache, and Claude Desktop itself failed with Permission denied. The base image's init-adduser then remapped abc to root mid-startup because it reads PUID/PGID from add-on options (fallback 0) where they were never defined, which additionally made Claude Code reject bypass mode. - Add PUID/PGID add-on options (default 1000:1000) and remap abc to that identity at the top of 20-folders.sh, before any ownership pass and before any service resolves the user; pin init-adduser to the same effective identity so it cannot diverge mid-startup. - In permission_mode bypass, fall back from a configured PUID 0 to UID 1000, since Claude Code refuses bypass permissions as root. - Replace the nonexistent bashio::config.array (only present in the repo's standalone bashio) with bashio::config in the TokenSave repository setup, tools configuration, and claude-tools-doctor.sh. - Chown managed Claude configuration files to the effective abc identity instead of the raw configured PUID/PGID, which fell back to root. - Pre-create /tmp/.X11-unix (sticky 1777) so Xorg running as non-root abc on the tmpfs /tmp can create its socket. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KN8i26JrKSaBdvTrpVEyQ6
18 lines
775 B
Bash
Executable File
18 lines
775 B
Bash
Executable File
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
set -e
|
|
|
|
# Earlier configuration scripts intentionally run as root. 20-folders.sh remapped abc to the
|
|
# effective runtime identity (never root in bypass mode, where Claude Code refuses to run as
|
|
# root). Reconcile ownership with that identity after all Claude configuration writes are
|
|
# complete, as a safety net in case any intermediate step re-owned a managed path.
|
|
RUNTIME_UID="$(id -u abc)"
|
|
RUNTIME_GID="$(id -g abc)"
|
|
|
|
for managed_path in "$HOME/.claude" "$HOME/.claude.json" "$HOME/.config/Claude"; do
|
|
if [ -e "$managed_path" ]; then
|
|
chown -R -- "${RUNTIME_UID}:${RUNTIME_GID}" "$managed_path" \
|
|
|| bashio::log.warning "Unable to set effective runtime ownership on $managed_path"
|
|
fi
|
|
done
|