From 259517289a0767c3923463c91ca2347716d4fbf3 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 15 Jul 2026 17:12:15 +0200 Subject: [PATCH] build --- claude_desktop/config.yaml | 2 +- .../cont-init.d/19-claude_bypass_runtime.sh | 48 ------------------- .../rootfs/etc/cont-init.d/20-folders.sh | 6 +-- 3 files changed, 4 insertions(+), 52 deletions(-) delete mode 100755 claude_desktop/rootfs/etc/cont-init.d/19-claude_bypass_runtime.sh diff --git a/claude_desktop/config.yaml b/claude_desktop/config.yaml index e2b62075d2..62da971837 100644 --- a/claude_desktop/config.yaml +++ b/claude_desktop/config.yaml @@ -105,5 +105,5 @@ slug: claude_desktop tmpfs: true udev: true url: https://github.com/alexbelgium/hassio-addons -version: "1.24" +version: "1.25" video: true diff --git a/claude_desktop/rootfs/etc/cont-init.d/19-claude_bypass_runtime.sh b/claude_desktop/rootfs/etc/cont-init.d/19-claude_bypass_runtime.sh deleted file mode 100755 index c55d307825..0000000000 --- a/claude_desktop/rootfs/etc/cont-init.d/19-claude_bypass_runtime.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash -set -e -set -o pipefail - -# Claude Code deliberately refuses bypass-permissions mode when its effective UID is 0. -# The add-on historically defaults PUID to 0, so switch the shared `abc` desktop user to -# an unused non-root UID before storage ownership and Selkies runtime directories are set up. -# Keep abc's configured primary group (commonly group 0) so existing group-based access to -# Home Assistant mounts is preserved. Strict and auto permission modes are unchanged. -if [ "$(bashio::config 'permission_mode')" != "bypass" ]; then - exit 0 -fi - -CURRENT_UID="$(id -u abc)" -if [ "$CURRENT_UID" -ne 0 ]; then - bashio::log.info "Claude bypass runtime already uses non-root UID ${CURRENT_UID}" - exit 0 -fi - -find_available_uid() { - local candidate owner - for candidate in 1000 911 $(seq 1001 1099); do - owner="$(getent passwd "$candidate" | cut -d: -f1 || true)" - if [ -z "$owner" ] || [ "$owner" = "abc" ]; then - printf '%s' "$candidate" - return 0 - fi - done - return 1 -} - -TARGET_UID="$(find_available_uid || true)" -if [ -z "$TARGET_UID" ]; then - bashio::exit.nok "Claude bypass mode requires a non-root runtime user, but no free fallback UID was found" -fi - -usermod --uid "$TARGET_UID" abc - -if [ "$(id -u abc)" -eq 0 ]; then - bashio::exit.nok "Unable to switch the Claude Desktop runtime away from root for bypass mode" -fi - -mkdir -p /run/s6/container_environment -printf '%s' "$TARGET_UID" > /run/s6/container_environment/CLAUDE_RUNTIME_UID -printf '%s' "$(id -g abc)" > /run/s6/container_environment/CLAUDE_RUNTIME_GID - -bashio::log.warning "Claude bypass mode cannot run as root; remapped abc from UID 0 to UID ${TARGET_UID} (GID $(id -g abc))" diff --git a/claude_desktop/rootfs/etc/cont-init.d/20-folders.sh b/claude_desktop/rootfs/etc/cont-init.d/20-folders.sh index 6f936d26e0..275db5e2f7 100755 --- a/claude_desktop/rootfs/etc/cont-init.d/20-folders.sh +++ b/claude_desktop/rootfs/etc/cont-init.d/20-folders.sh @@ -5,8 +5,8 @@ set -e # Use the effective shared desktop user identity. In bypass mode an earlier init script may # remap abc away from UID 0 because Claude Code rejects bypass permissions when run as root. -PUID="$(id -u abc)" -PGID="$(id -g abc)" +PUID=1000 +PGID=1000 # Check data location LOCATION="$(bashio::config 'data_location')" @@ -82,7 +82,7 @@ fi ln -sfn /tmp/cache "$LOCATION/.cache" bashio::log.info "Setting ownership to $PUID:$PGID" -chown -R "$PUID":"$PGID" "$LOCATION" /tmp/cache "$XDG_RUNTIME_DIR" +chown -R "$PUID":"$PGID" "$LOCATION" /tmp/cache "$XDG_RUNTIME_DIR" /data chmod -R 700 "$LOCATION" # The base init-selkies-config script overrides XDG_RUNTIME_DIR to $HOME/.XDG, which lands