From 255294baa4f70c6d42b1171907da52347b7aa1dd Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 24 Mar 2026 12:53:36 -0400 Subject: [PATCH] fix(entrypoint): compare enabled app names when reporting disabled apps Extract the disabled-app reporting logic into a helper and compare normalized enabled app names instead of parsing diff output from full `occ app:list` snapshots. This fixes false positives where apps upgraded during `occ upgrade` were reported as disabled because their version line changed, and avoids reliance on diff output format differences on Alpine/BusyBox. Fixes #1911 Signed-off-by: Josh --- docker-entrypoint.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 303aa0052..542d72801 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -83,6 +83,14 @@ file_env() { unset "$fileVar" } +get_enabled_apps() { + run_as 'php /var/www/html/occ app:list' \ + | sed -n '/^Enabled:$/,/^Disabled:$/p' \ + | sed '1d;$d' \ + | sed -n 's/^ - \([^:]*\):.*/\1/p' \ + | sort +} + # Write PHP session config for Redis to /usr/local/etc/php/conf.d/redis-session.ini configure_redis_session() { echo "=> Configuring PHP session handler..." @@ -190,7 +198,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP exit 1 fi echo "Upgrading nextcloud from $installed_version ..." - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before + get_enabled_apps > /tmp/list_before fi if [ "$(id -u)" = 0 ]; then rsync_options="-rlDog --chown $user:$group" @@ -288,9 +296,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP run_as 'php /var/www/html/occ upgrade' - run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after - echo "The following apps have been disabled:" - diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1 + get_enabled_apps > /tmp/list_after + disabled_apps="$(comm -23 /tmp/list_before /tmp/list_after || true)" + if [ -n "$disabled_apps" ]; then + echo "The following apps have been disabled:" + printf '%s\n' "$disabled_apps" + fi rm -f /tmp/list_before /tmp/list_after run_path post-upgrade