Trusted Domain in Snap install of Next Cloud

Sorry to hear you’re facing problems :slight_frown:

If you’re urgently looking for support to keep your business running, consider checking out our paid support options.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the following as you can (you can cut and paste this into your topic):


Nextcloud version (eg, 10.0.2): 11-ish
Operating system and version (eg, Ubuntu 16.04):Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): Snap Install
PHP version (eg, 5.6):Snap Install
Is this the first time you’ve seen this error and can you replicate it?:
No

The issue you are facing:
Seen the Trusted Domains message on manual installs, not too hard to fix, but in Snap install you have multiple directories with ‘config’ folder, and a config.php file inside that.

My issue here is that I can’t edit any of the config.php files to add the trusted domains array, because each time it says read only file. I am using Sudo, and still no luck. Tried to change the file permissions with chmod, no go either.

I like how easy the snap install is, but it’s utterly useless if I can’t actually connect to the server once installed, which I can’t until I can add some trusted domains, or simply disable that feature.

The output of your Nextcloud log in Admin > Logging:

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

The output of your Apache/nginx/system log in /var/log/____:


Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

1 Like

I am have the same issue with the snap. Have you managed to figure it out?

So was there never any reply to this? It may be due to my -admittedly huge- ignorance as a newbie, but it seems to me that without being able to edit the list of trusted domains, the Snap install is utterly useless.

Hi @Rybena and @danvp .

Try this command:

sudo snap run nextcloud.occ config:system:set trusted_domains 1 --value=your.fancy.domain

After you do that, then restart nextcloud:

sudo snap restart nextcloud

Then everything should just work.

I hope this helps.

–

You can also check that value with:

sudo snap run nextcloud.occ config:system:get trusted_domains 1

For example, running:

sudo snap run nextcloud.occ config:system:get trusted_domains 0

probably returns “localhost”.

7 Likes

Hi
Thanks for the info, and sorry for the very delayed reply.
This worked perfectly for me!

Good, its worke here thanks dude.
i share whit ngrok to internet

Thanks, this helped me also

I just want to add that this solution worked for me, with a slight modification.

OS: Ubuntu Desktop 20.04.2 LTS
Installation Method: Snap

I found the config.php file, eventually. The path is not intuitive:

image

But I didn’t need to use this. All I did was modify the snippet provided above with the following:

image

This gave me the ability to access from any IP or domain. Since I’m only doing this as a test, this is fine, but I would definitely secure this further in a production environment.

I hope this helps others!

Hi,
I have an similar problem with Trusted_Domains.
I also have installed it by snap and i had/have also the Trusted_Domains Problem. They were set by “snap run nextcloud.occ config:system:set trusted_domains x --value=my.domain.com”
(x is Number of possible Domain in array, my.domain.com is i think clear)
it was also checked by snap run nextcloud.occ config:system:get trusted_domains x and it shows correctly. And yes i worked for simple working in this moment as root.

As Information i have an SophosUTM working infront of the system. But it was said it isn’t a problem.
Can you help me please?

Okay Problem Found and solved. UTM was set that hostheader will not passed and it will compress the traffic. Both disabled and now it works!