I've installed NextCloud on my FreeNas server and I got an error that my domain is not trusted. After looking online, it looks like I need to add the hosts capable of connecting to my instance explicitly. This is actually nice, because I don't want everybody to be able to connect to it.

Prerequisistes

  1. FreeNas install (11.3 at the time of writing this)
  2. NextCloud plugin installed

Steps

First, log in (as root) to your FreeNas install, go to the Jails section and open the NextCloud details (hitting the   chevron on the right):

nextcloud

Open the the shell:

nextcloud

Nextcloud has a management CLI tool named occ.sh, which allows you to perform all kind of commands on your nextcloud. With it, you can check which domains are already available:

root@nextcloud:~# ./occ.sh config:system:get trusted_domains

localhost

This will return localhost.

You can now add a new domain (a name like johndoe.lan or an IP address). Start with the position 1 (0 is localhost):

root@nextcloud:~# ./occ.sh config:system:set trusted_domains 1 --value=192.168.1.150

System config value trusted_domains => 1 set to string 192.168.1.150

You can verify again the state:

root@nextcloud:~# ./occ.sh config:system:get trusted_domains
localhost
192.168.1.150

Note: Numbering of the trusted domains starts from 0. Don't skip a number, or you'll get an invalid configuration.

HTH,