Which config.php is the right one and how to add trusted domains correctly

So I’ve installed Nextcloud using the snap that comes with the Ubuntu server install ISO and I want to be able to access it over a Netbird network however it gives this error:

Nextcloud
Access through untrusted domain
Please contact your administrator. If you are an administrator, edit the “trusted_domains” setting in config/config.php like the example in config.sample.php.

Further information how to configure this can be found in the documentation.

So I dug into the documentation found the right section and used locate to find config.php. There was two different files with that name.

/snap/nextcloud/49338/htdocs/config/config.php
/var/snap/nexcloud/49338/nextcloud/config/config.php

So I used nano to try and modify both. The one under /snap couldn’t be modified, but while the one under /var had the right section it didn’t look like what the documentation’s example.

This is what it looks like:

‘trusted_domains’ =>
array (
0 => ‘10.0.0.50’,
),

I’ve tried pretty much everything I can think of. Can anyone help with this?

Hello @Eegxeta,

welcome to the Nextcloud community! :handshake: and thanks for supporting the snap

which documentation was that? see GitHub - nextcloud-snap/nextcloud-snap: ☁️📦 Nextcloud packaged as a snap and Nextcloud snap wiki and Nextcloud latest admin manual for official documentation and you’ll find some how-to’s here in the forum:

and especially:

that looks like an IP-address and not a domain name, try FQDN instead, see setting trusted domains and Hosts & FQDN configuration

also look at 101: Network, domain and DNS and especially reference to 101: VPN service restrictions.

please contact the Netbird folks for support if you’re facing connectivity issues.

Well now I’m more confused about what the issue is.

Ok let me clearly state the problem for starters.

When connecting to the my Nextcloud server over my Netbird VPN I get this:

Nextcloud
Access through untrusted domain
Please contact your administrator. If you are an administrator, edit the “trusted_domains” setting in config/config.php like the example in config.sample.php.

Further information how to configure this can be found in the documentation.

I don’t have a domain. What is the above security measure called and as my server is not publicly accessible how do I turn it off?

I didn’t know there was more than the official admin manual, but this what the snap installed for the config.php for the trusted_domain.

‘trusted_domains’ =>
array (
0 => ‘10.0.0.50’,
),

I have not changed this from the base snap install. Although I’m not sure now this is even relevant to my issue anymore.

… that’s what is recommended! so you need DNS including some human readable “domain” name connected to your public IPv4 and the server should be publicly available. Nextcloud is a sharing and collaboration service. any publicly available service should have a valid SSL certificate and encrypted on https://cloud.yourdomain.tld

the links posted above are in sequence so that you can read them like a manual. and no, if you’ve read the documentation you’ll see that the snap is a community project with own documentation… which is why it was linked above. see Installation on Linux — Nextcloud latest Administration Manual latest documentation

Installing via Snap packages

Nextcloud snap is a community driven installation method and is designed to be easy to install and simple to maintain. The ideal Nextcloud snap is an “install and forget” Nextcloud instance that works on most architectures and updates itself without needing administrative skills. Combining Nextcloud with snapd makes it a perfect fit for IoT or scalable environments. Snapd is a secure and robust technology which the Nextcloud snap team has embraced.

Most importantly snaps are designed to be secure, sandboxed, containerized applications isolated from the underlying system and from other applications.

maybe this will shed some light:

Thanks for the help, but Nextcloud is just too much for what I’m trying to do at the moment. I do want to implement it as some point, but for simply accessing a share on a NAS server it is complete overkill.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.