From 9ea1902e2b0b0d8cef34dfd56581ab6fc49d2cfd Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Tue, 23 Dec 2025 11:28:47 -0700 Subject: [PATCH] fix(docker): remove overwritehost to fix container-to-container DCR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the overwritehost and overwrite.cli.url settings that were forcing Nextcloud to generate URLs with localhost:8080 regardless of the incoming request's Host header. This was breaking Dynamic Client Registration (DCR) from the mcp-oauth container, which needs to reach Nextcloud at http://app:80 but was getting discovery documents with http://localhost:8080 URLs that are unreachable from inside the Docker network. Now Nextcloud respects the Host header: - Browser requests to localhost:8080 → returns localhost:8080 URLs - Container requests to app:80 → returns app:80 URLs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app-hooks/post-installation/00-setup-trusted-domains.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app-hooks/post-installation/00-setup-trusted-domains.sh b/app-hooks/post-installation/00-setup-trusted-domains.sh index 7a219ea..b31b499 100755 --- a/app-hooks/post-installation/00-setup-trusted-domains.sh +++ b/app-hooks/post-installation/00-setup-trusted-domains.sh @@ -4,8 +4,7 @@ set -euox pipefail php /var/www/html/occ config:system:set trusted_domains 2 --value=host.docker.internal -# Set overwrite settings for URL generation (needed for OIDC discovery to return correct URLs) -# These ensure that URLs generated by Nextcloud include the correct host:port -php /var/www/html/occ config:system:set overwritehost --value="localhost:8080" -php /var/www/html/occ config:system:set overwriteprotocol --value="http" -php /var/www/html/occ config:system:set overwrite.cli.url --value="http://localhost:8080" +# Do NOT set overwritehost/overwrite.cli.url - let Nextcloud use the request's Host header +# This allows: +# - Browser requests to localhost:8080 → returns localhost:8080 URLs +# - Container requests to app:80 → returns app:80 URLs (for DCR, token exchange, etc.)