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"}, }, }