From cf14fa39f70c553cc619130c0a42f088b46f4ed8 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:19:29 -0400 Subject: [PATCH 1/2] fix system python perms so uv can modify --- Dockerfile | 4 ++++ Dockerfile.aarch64 | 4 ++++ README.md | 1 + readme-vars.yml | 1 + root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run | 5 +++++ 5 files changed, 15 insertions(+) diff --git a/Dockerfile b/Dockerfile index f48b707..9f8b058 100644 --- a/Dockerfile +++ b/Dockerfile @@ -229,6 +229,10 @@ RUN \ for cleanfiles in *.pyc *.pyo; do \ find /usr/local/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + ; \ done && \ + chown -R root:7310 /usr/local && \ + chmod -R g+w /usr/local && \ + groupadd lsio && \ + groupmod -g 7310 lsio && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index aaaa5a8..12cf4af 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -229,6 +229,10 @@ RUN \ for cleanfiles in *.pyc *.pyo; do \ find /usr/local/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + ; \ done && \ + chown -R root:7310 /usr/local && \ + chmod -R g+w /usr/local && \ + groupadd lsio && \ + groupmod -g 7310 lsio && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apk del --purge \ diff --git a/README.md b/README.md index 4def686..768a224 100644 --- a/README.md +++ b/README.md @@ -316,6 +316,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **12.10.24:** - Allow uv to modify system python packages. * **07.10.24:** - Switch to `uv` instead of `pip`. * **03.07.24:** - Rebase to alpine 3.20. * **05.03.24:** - Add mime.types to help with detection of certain media files. diff --git a/readme-vars.yml b/readme-vars.yml index c90ecd9..bfc8f96 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -74,6 +74,7 @@ app_setup_block: | unraid_template_sync: false # changelog changelogs: + - {date: "12.10.24:", desc: "Allow uv to modify system python packages."} - {date: "07.10.24:", desc: "Switch to `uv` instead of `pip`."} - {date: "03.07.24:", desc: "Rebase to alpine 3.20."} - {date: "05.03.24:", desc: "Add mime.types to help with detection of certain media files."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run b/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run index 7a5f634..a9c8193 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run +++ b/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run @@ -4,6 +4,11 @@ # migration rm -rf /config/lsiopy +# Add abc user to python system install owner group, lsio (7310) +if ! id -G abc | grep -qw "7310"; then + usermod -a -G lsio abc +fi + # set permissions echo "Setting permissions" lsiown -R abc:abc \ From 024ec9a5dcfc0d5527f2af6522d5bf4ba3ca632b Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:24:33 -0400 Subject: [PATCH 2/2] nuke old python package folders --- root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run b/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run index a9c8193..f32ae8d 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run +++ b/root/etc/s6-overlay/s6-rc.d/init-config-homeassistant/run @@ -2,7 +2,9 @@ # shellcheck shell=bash # migration -rm -rf /config/lsiopy +rm -rf \ + /config/lsiopy \ + /config/.local/{bin,lib} # Add abc user to python system install owner group, lsio (7310) if ! id -G abc | grep -qw "7310"; then