fix: sets trusted_domains correctly #118

Open
stevensting wants to merge 2 commits from trusted-domains into main
Owner
No description provided.
stevensting added 2 commits 2026-08-25 13:07:41 +00:00
stevensting requested review from dannygroenewegen 2026-08-25 13:18:53 +00:00
stevensting requested review from ineiti 2026-08-25 13:19:00 +00:00
dannygroenewegen requested changes 2026-08-26 10:39:13 +00:00
@@ -6,6 +6,8 @@ ENABLE_BACKUPS=true
DOMAIN=nextcloud.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.nextcloud.example.com`'
# same list as above but space separated
Owner

Maybe make the comments a bit more elaborate on what they both do?

Update the EXTRA_DOMAINS comment to #Additional domains for Traefik to listen on. Comma-separated, backtick-quoted, e.g. ', `www.nextcloud.example.com`'

And the comment for EXTRA_DOMAINS_TRUSTED:

# Same domains as above, but for Nextcloud to trust, space separated: "www.nextcloud.example.com alt.example.com"
# Only applied on first install. For existing instances run: occ config:system:set trusted_domains <idx> --value=<domain>
Maybe make the comments a bit more elaborate on what they both do? Update the EXTRA_DOMAINS comment to ```#Additional domains for Traefik to listen on. Comma-separated, backtick-quoted, e.g. ', `www.nextcloud.example.com`'``` And the comment for EXTRA_DOMAINS_TRUSTED: ``` # Same domains as above, but for Nextcloud to trust, space separated: "www.nextcloud.example.com alt.example.com" # Only applied on first install. For existing instances run: occ config:system:set trusted_domains <idx> --value=<domain> ```
@@ -7,2 +7,4 @@
## Domain aliases
#EXTRA_DOMAINS=', `www.nextcloud.example.com`'
# same list as above but space separated
#EXTRA_DOMAINS_TRUSTED=cloud.coquest.coop
Owner

User the same alt example domain instead of coquest: www.nextcloud.example.com

User the same alt example domain instead of coquest: `www.nextcloud.example.com`
@@ -71,3 +71,3 @@
- NEXTCLOUD_ADMIN_USER=${ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/admin_password
- NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN}
- EXTRA_DOMAINS_TRUSTED
Owner

I don't think this line is needed. EXTRA_DOMAINS_TRUSTED is already interpolated into NEXTCLOUD_TRUSTED_DOMAINS from .env at deploy time.

I don't think this line is needed. `EXTRA_DOMAINS_TRUSTED` is already interpolated into `NEXTCLOUD_TRUSTED_DOMAINS` from .env at deploy time.
@@ -72,2 +72,3 @@
- NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/admin_password
- NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN}
- EXTRA_DOMAINS_TRUSTED
- NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN} ${EXTRA_DOMAINS_TRUSTED}
Owner

From the docker-entrypoint.sh of Nextcloud, it looks like NEXTCLOUD_TRUSTED_DOMAINS is only applied on the first install (installed_version = 0.0.0.0) and not during restarts or upgrades.

So on an existing instance, this env var alone won't update the list. Needs a manual occ config:system:set trusted_domains Maybe add that as a comment to the .env.sample?

From the [docker-entrypoint.sh](https://github.com/nextcloud/docker/blob/583fbe383cedb716c7e8483e03b4d476992c6a7e/docker-entrypoint.sh#L215-L280) of Nextcloud, it looks like `NEXTCLOUD_TRUSTED_DOMAINS` is only applied on the first install (`installed_version = 0.0.0.0`) and not during restarts or upgrades. So on an existing instance, this env var alone won't update the list. Needs a manual `occ config:system:set trusted_domains` Maybe add that as a comment to the .env.sample?
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin trusted-domains:trusted-domains
git checkout trusted-domains
Sign in to join this conversation.