From f3abe7bc214d81f557af6d9f1766c4c9bb4b9bd7 Mon Sep 17 00:00:00 2001 From: James Manuel Date: Mon, 8 Jun 2026 15:52:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(nextcloud):=20configure=20Eu?= =?UTF-8?q?roOffice=20internal=20URLs=20and=20preview=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three fixes applied when \$EUROOFFICE_HOST matches the default AIO container naming pattern (nextcloud-*-eurooffice): 1. DocumentServerInternalUrl → http://\$EUROOFFICE_HOST:80/ Bypasses the public domain for NC→EuroOffice converter calls. Trailing slash required; DocumentService.php concatenates the raw value with "converter" with no separator. 2. StorageUrl → http://\$APACHE_CONTAINER_HOST.nextcloud-aio:23973/ Bypasses the public domain for EuroOffice→NC file fetch calls. Port 23973 is the Collabora WOPI ingress; port 11000 rejects requests where Host doesn't match the nextcloud.test binding. Trailing slash required to avoid malformed replacement URLs. 3. enabledPreviewProviders index 50 → OCA\Eurooffice\Preview NC's allowlist is explicit; registerPreviewProvider() alone is insufficient. Fixed index 50 avoids collision with AIO's seeded range (1–7, 23). Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: James Manuel --- Containers/nextcloud/entrypoint.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index b90b4011..858b1f9a 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -903,11 +903,24 @@ if [ "$EUROOFFICE_ENABLED" = 'yes' ]; then # Adjust the EuroOffice host if using internal pattern if echo "$EUROOFFICE_HOST" | grep -q "nextcloud-.*-eurooffice"; then + # Set internal URLs for server-to-server calls via Docker network, + # bypassing the public domain which may not resolve inside containers. + # DocumentServerInternalUrl: NC -> EuroOffice (direct container port) + # StorageUrl: EuroOffice -> NC (via port 23973 which has a matching Caddy server-block) + APACHE_CONTAINER_HOST=$(echo "$EUROOFFICE_HOST" | sed 's/-eurooffice$/-apache/') + php /var/www/html/occ config:app:set eurooffice DocumentServerInternalUrl --value="http://$EUROOFFICE_HOST:80/" + php /var/www/html/occ config:app:set eurooffice StorageUrl --value="http://$APACHE_CONTAINER_HOST.nextcloud-aio:23973/" EUROOFFICE_HOST="$NC_DOMAIN/eurooffice" export EUROOFFICE_HOST fi php /var/www/html/occ config:app:set eurooffice DocumentServerUrl --value="https://$EUROOFFICE_HOST" + + # Register EuroOffice preview provider in the explicit allowlist. + # Use a high fixed index (50) to avoid colliding with AIO's seeded indices (1-7, 23). + if ! php /var/www/html/occ config:system:get enabledPreviewProviders | grep -q "Eurooffice"; then + php /var/www/html/occ config:system:set enabledPreviewProviders 50 --value="OCA\Eurooffice\Preview" + fi fi else # Remove EuroOffice app if disabled and removal is requested