From d7e5332a11a1115cf91ecb7623300ca98afded7b Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 25 Feb 2026 21:19:39 +0100 Subject: [PATCH] fix(integrations): fix Nextcloud-OnlyOffice callback URL and trusted_domains MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit StorageUrl was missing trailing slash — NC's OO connector does string replacement of server URL (ending with /) with StorageUrl, so without trailing slash "apps/" merges into hostname producing "nextcloudapps". Also add "nextcloud" to NC trusted_domains so OO Document Server's internal callbacks (Host: nextcloud) are not rejected. Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 6 ++++++ .../internal/integrations/onlyoffice_nextcloud.go | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2019f4..8427520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Changelog +### v0.31.5 — Fix Nextcloud-OnlyOffice callback URL + trusted_domains (2026-02-25) + +#### Fixed +- **StorageUrl trailing slash**: `http://nextcloud` → `http://nextcloud/` — without trailing slash, Nextcloud's OO connector concatenates the hostname with `/apps/...` path, producing `http://nextcloudapps/...` (unresolvable hostname) +- **trusted_domains**: OO Document Server callbacks arrive with `Host: nextcloud` header; added `nextcloud` to Nextcloud's trusted_domains so these internal callbacks are not rejected + ### v0.31.4 — Fix FB container not restarting + OO mixed content (2026-02-25) #### Fixed diff --git a/controller/internal/integrations/onlyoffice_nextcloud.go b/controller/internal/integrations/onlyoffice_nextcloud.go index 6e2a27c..6d9445b 100644 --- a/controller/internal/integrations/onlyoffice_nextcloud.go +++ b/controller/internal/integrations/onlyoffice_nextcloud.go @@ -50,8 +50,15 @@ func (h *OnlyOfficeNextcloudHandler) Apply(ac *ApplyContext) error { args: []string{"docker", "exec", "-u", "www-data", "nextcloud", "php", "occ", "config:app:set", "onlyoffice", "jwt_secret", "--value=" + jwtSecret}, }, { - // StorageUrl: tells OO Document Server where to reach Nextcloud internally for file callbacks - args: []string{"docker", "exec", "-u", "www-data", "nextcloud", "php", "occ", "config:app:set", "onlyoffice", "StorageUrl", "--value=http://nextcloud"}, + // StorageUrl: tells OO Document Server where to reach Nextcloud internally for file callbacks. + // Trailing slash is critical — NC's OO connector does string replacement of the server URL + // (which ends with /) with StorageUrl. Without trailing slash, "/apps/..." merges into hostname. + args: []string{"docker", "exec", "-u", "www-data", "nextcloud", "php", "occ", "config:app:set", "onlyoffice", "StorageUrl", "--value=http://nextcloud/"}, + }, + { + // Add internal hostname to trusted_domains so OO Document Server callbacks + // (arriving with Host: nextcloud) are not rejected by Nextcloud. + args: []string{"docker", "exec", "-u", "www-data", "nextcloud", "php", "occ", "config:system:set", "trusted_domains", "10", "--value=nextcloud"}, }, }