1
0
mirror of https://github.com/nextcloud/docker.git synced 2026-05-05 04:06:45 +02:00

fix(entrypoint): compare enabled app names when reporting disabled apps (#2554)

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 <josh.t.richards@gmail.com>
This commit is contained in:
Josh 2026-03-26 19:15:12 -04:00 committed by GitHub
parent 5e8f8593c8
commit de24641350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,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..."
@ -188,7 +196,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"
@ -286,9 +294,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