docker
docker copied to clipboard
NEXTCLOUD_TRUSTED_DOMAINS only sets first domain in list
Multiple domains in NEXTCLOUD_TRUSTED_DOMAINS separated with spaces are ignored.
Example:
docker-compose:
NEXTCLOUD_TRUSTED_DOMAINS: cloud-test.example.com cloud-test.internal.example.com
config.php
'trusted_domains' =>
array (
0 => 'cloud-test.example.com',
),
Also having the same issue on version: 24.0.1
Also having this issue ...
Months later trying to get the trusted domain option working using CloudFlare without luck.
It's a great tool, but why it's so difficult to get this working externally?
I even edited the config.php
Nextcloud version 24.0.5
For me it doesn't set even the first domain. I set only one. Then went on installation phase and page says "Access through untrusted domain".
same here. pretty annoying with all that nextcloud docker issues.
All i wanted is an easier upgrade method, through containers and traefik etc... and its actually working all great, but this nextcloud docker container is just annoying. i think its actually better to switch to a normal nginx instance.
Cheers
And seeing issues from even last year thought this was resolved until now.
For me it doesn't set even the first domain. I set only one. Then went on installation phase and page says "Access through untrusted domain".
I have the same experience: we regularly install/run the nextcloud docker image as part of a CI run. We set NEXTCLOUD_TRUSTED_DOMAINS to a single domain. Sometimes this does not end up in the actual configuration (according to php occ config:system:get trusted_domains): which will be only localhost then. Sometimes it does work and trusted_domains will contain both localhost and the specified domain. I have not found any pattern predicting when it will work.
@LinuxMeow Can confirm the most recent stable docker release 25.0.2 ignores the NEXTCLOUD_TRUSTED_DOMAINS environment variable too.
docker exec nextcloud_app_1 printenv NEXTCLOUD_TRUSTED_DOMAINS successfully prints out the defined trusted domain(s), so that's not the issue.
@BornToBeRoot mentioned only the first domain was set. Did you do the initial setup with that domain?
Currently, Nextcloud container seems to only set the domain/ip used for inital setup as trusted domain in config.php.
@nel0x yes. I think it was that domain.
also having this issue, I don't even see that dev has commented on this issue thread. Is this a won't fix or something?
Is there a way to set that value with the occ command?
well for anyone else, this is possible via occ but still doesn't resolve the error message in the administration console;
from their documentation: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#config-commands-label
To set one of multiple values, you need to specify the array index as the second name in the config:system:set command, separated by a space. For example, to replace sample.tld with example.com, trusted_domains => 2 needs to be set:
sudo -u www-data php occ config:system:set trusted_domains 2 --value=example.com System config value trusted_domains => 2 set to string example.com
sudo -u www-data php occ config:system:get trusted_domains localhost nextcloud.local example.com
EDIT TO ADD: Also had to add the reverse proxy ip to the trusted_proxies list via the same command format as for trusted_domains.
This made the original warning in the nextcloud dashboard go away, there is still one about the trusted proxies but it appears to be safe to ignore.
Anyone found another solution to this already? Also having the issue with only 1 domain set
I believe the issue is also visible when at installation, when the container starts for the first time:
app_1 | Setting trusted domains…
app_1 | sh: 1: Syntax error: Unterminated quoted string
This issue took me a couple of hours without any solution.
The environment variable NEXTCLOUD_TRUSTED_DOMAINS is useless, it is not populated into the config.php