From 5aed7dab2c80eaf3018b7b99cbbc89590ca94e8d Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:26:09 +0100 Subject: [PATCH] Bump Immich to v2.6.2 and adjust chown handling Update Immich release references from v2.6.1 to v2.6.2 in ct/immich.sh and install/immich-install.sh. Replace broad recursive chown -R on the install dir with a safer approach that avoids recursing into the upload directory (which may be a mounted volume with restricted permissions): set ownership on the install dir itself, chown each top-level entry except 'upload', and attempt to chown the upload path while ignoring errors. Also adjust ordering for /var/log/immich chown to avoid permission issues when enabling services. --- ct/immich.sh | 12 +++++++++--- install/immich-install.sh | 14 +++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ct/immich.sh b/ct/immich.sh index c1954a6b9..6ec0ae169 100644 --- a/ct/immich.sh +++ b/ct/immich.sh @@ -109,7 +109,7 @@ EOF msg_ok "Image-processing libraries up to date" fi - RELEASE="v2.6.1" + RELEASE="v2.6.2" if check_for_gh_release "Immich" "immich-app/immich" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then if [[ $(cat ~/.immich) > "2.5.1" ]]; then msg_info "Enabling Maintenance Mode" @@ -214,7 +214,10 @@ EOF cd "$SRC_DIR"/machine-learning mkdir -p "$ML_DIR" - chown -R immich:immich "$INSTALL_DIR" + # chown excluding upload dir contents (may be a mount with restricted permissions) + chown immich:immich "$INSTALL_DIR" + find "$INSTALL_DIR" -maxdepth 1 -mindepth 1 ! -name upload -exec chown -R immich:immich {} + + chown immich:immich "${UPLOAD_DIR:-$INSTALL_DIR/upload}" 2>/dev/null || true chown immich:immich ./uv.lock export VIRTUAL_ENV="${ML_DIR}"/ml-venv export UV_HTTP_TIMEOUT=300 @@ -273,7 +276,10 @@ EOF systemctl daemon-reload fi - chown -R immich:immich "$INSTALL_DIR" + # chown excluding upload dir contents (may be a mount with restricted permissions) + chown immich:immich "$INSTALL_DIR" + find "$INSTALL_DIR" -maxdepth 1 -mindepth 1 ! -name upload -exec chown -R immich:immich {} + + chown immich:immich "${UPLOAD_DIR:-$INSTALL_DIR/upload}" 2>/dev/null || true if [[ "${MAINT_MODE:-0}" == 1 ]]; then msg_info "Disabling Maintenance Mode" cd /opt/immich/app/bin diff --git a/install/immich-install.sh b/install/immich-install.sh index 1031f4fdb..418f2c0f6 100644 --- a/install/immich-install.sh +++ b/install/immich-install.sh @@ -295,7 +295,7 @@ ML_DIR="${APP_DIR}/machine-learning" GEO_DIR="${INSTALL_DIR}/geodata" mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache} -fetch_and_deploy_gh_release "Immich" "immich-app/immich" "tarball" "v2.6.1" "$SRC_DIR" +fetch_and_deploy_gh_release "Immich" "immich-app/immich" "tarball" "v2.6.2" "$SRC_DIR" PNPM_VERSION="$(jq -r '.packageManager | split("@")[1] | split("+")[0]' ${SRC_DIR}/package.json)" NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs @@ -344,7 +344,11 @@ msg_ok "Installed Immich Server, Web and Plugin Components" cd "$SRC_DIR"/machine-learning $STD useradd -U -s /usr/sbin/nologin -r -M -d "$INSTALL_DIR" immich -mkdir -p "$ML_DIR" && chown -R immich:immich "$INSTALL_DIR" +mkdir -p "$ML_DIR" +# chown excluding upload dir contents (may be a mount with restricted permissions) +chown immich:immich "$INSTALL_DIR" +find "$INSTALL_DIR" -maxdepth 1 -mindepth 1 ! -name upload -exec chown -R immich:immich {} + +chown immich:immich "$UPLOAD_DIR" 2>/dev/null || true export VIRTUAL_ENV="${ML_DIR}/ml-venv" export UV_HTTP_TIMEOUT=300 if [[ -f ~/.openvino ]]; then @@ -499,7 +503,11 @@ StandardError=append:/var/log/immich/ml.log [Install] WantedBy=multi-user.target EOF -chown -R immich:immich "$INSTALL_DIR" /var/log/immich +chown -R immich:immich /var/log/immich +# chown excluding upload dir contents (may be a mount with restricted permissions) +chown immich:immich "$INSTALL_DIR" +find "$INSTALL_DIR" -maxdepth 1 -mindepth 1 ! -name upload -exec chown -R immich:immich {} + +chown immich:immich "$UPLOAD_DIR" 2>/dev/null || true systemctl enable -q --now immich-ml.service immich-web.service msg_ok "Modified user, created env file, scripts and services"