From e9d6cb1ff8f43ef0acc872f073efc542b183f019 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Fri, 23 Oct 2026 20:51:07 -0300 Subject: [PATCH] revert: remove app-specific dotted UID workaround from generic Nextcloud Docker Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .../90-files-fulltextsearch-dotted-uid.sh | 44 ------------------- .../files-fulltextsearch-dotted-uid.patch | 5 --- docs/deployment.md | 6 --- 3 files changed, 55 deletions(-) delete mode 100755 app-hooks/before-starting/90-files-fulltextsearch-dotted-uid.sh delete mode 100644 app-hooks/before-starting/files-fulltextsearch-dotted-uid.patch diff --git a/app-hooks/before-starting/90-files-fulltextsearch-dotted-uid.sh b/app-hooks/before-starting/90-files-fulltextsearch-dotted-uid.sh deleted file mode 100755 index f33f31f..0000000 --- a/app-hooks/before-starting/90-files-fulltextsearch-dotted-uid.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# Temporary workaround for https://github.com/nextcloud/files_fulltextsearch/issues/389 -# Remove when the fix is released upstream for Nextcloud 35. -set -eu - -app_dir=/var/www/html/custom_apps/files_fulltextsearch -source_file="$app_dir/lib/Service/SearchService.php" -patch_file="$(dirname "$0")/files-fulltextsearch-dotted-uid.patch" - -# Apps installed through the App Store are not necessarily present during setup. -[ -f "$source_file" ] && [ -f "$app_dir/appinfo/info.xml" ] || exit 0 - -version=$(sed -n 's/.*\([^<]*\)<\/version>.*/\1/p' "$app_dir/appinfo/info.xml" | head -n 1) -case "$version" in - 35.*) ;; - *) exit 0 ;; -esac - -fixed='$userId = $searchResult->getRequest()->getAuthor();' -broken='$userId = $this->filesService->secureUsername($searchResult->getRequest()->getAuthor());' - -if grep -Fq "$fixed" "$source_file"; then - echo "files_fulltextsearch: dotted-UID fix already present" - exit 0 -fi - -if ! grep -Fq "$broken" "$source_file"; then - echo "WARNING: files_fulltextsearch $version changed; review dotted-UID fix" >&2 - exit 0 -fi - -if ! patch --batch --fuzz=0 --dry-run -p1 -d "$app_dir" < "$patch_file" >/dev/null; then - echo "WARNING: files_fulltextsearch dotted-UID patch does not apply; keeping Nextcloud available" >&2 - exit 0 -fi - -patch --batch --fuzz=0 -p1 -d "$app_dir" < "$patch_file" -if ! php -l "$source_file" >/dev/null; then - patch --batch --fuzz=0 -R -p1 -d "$app_dir" < "$patch_file" - echo "WARNING: files_fulltextsearch patch failed PHP syntax check; reverted" >&2 - exit 0 -fi - -echo "files_fulltextsearch $version: applied temporary dotted-UID fix" diff --git a/app-hooks/before-starting/files-fulltextsearch-dotted-uid.patch b/app-hooks/before-starting/files-fulltextsearch-dotted-uid.patch deleted file mode 100644 index 4c183e3..0000000 --- a/app-hooks/before-starting/files-fulltextsearch-dotted-uid.patch +++ /dev/null @@ -1,5 +0,0 @@ ---- a/lib/Service/SearchService.php -+++ b/lib/Service/SearchService.php -@@ -95 +95 @@ -- $userId = $this->filesService->secureUsername($searchResult->getRequest()->getAuthor()); -+ $userId = $searchResult->getRequest()->getAuthor(); diff --git a/docs/deployment.md b/docs/deployment.md index 17b4547..a752417 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -109,12 +109,6 @@ services: PHP-FPM pool settings can also be mounted into `/usr/local/etc/php-fpm.d/`. Keep changes compatible with the underlying Nextcloud PHP version and workload. -## Temporary Full Text Search fix for dotted UIDs (Nextcloud 35) - -The before-starting hook applies the upstream [files_fulltextsearch dotted-UID fix](https://github.com/nextcloud/files_fulltextsearch/issues/389) to affected 35.x app installations. It is safe to run again and skips the app if the fix is already present. - -An App Store update performed while Nextcloud is running does **not** invoke this hook. Restart the application container after such updates so that the fix is reapplied if still required. Remove this workaround when the official app includes the correction. - ## Logs and troubleshooting ```bash