How to edit trusted domains in Nextcloud on NS8?

NethServer Version: NS8
Module: Nextcloud

post migration NS7 to NS8
all the windows desktop sync clients, browser bookmarks, iOS calendar and contacts, etc.
point to sub1 dot domain dot tld /nextcloud

NS8 post migration is sub2 dot sub1 dot domain dot tld
this is reflected in nextcloud1 config.env
Nextcloud is accessed with that fqdn.
If I change the nextcloud1 hostname in the NS8 cluster web gui settings to sub1 dot domain dot tld the trusted domains in config.env changes to the new hostname but Nextcloud’s webpage gui gives the untrusted domain page even after reboots and such.
When I change the hostname back to sub2 dot sub1 dot domain dot tld Nextcloud’s login page is delivered and access is restored.

Because I have so many clients pointing to sub1 dot domain dot tld/nextcloud I really need to figure out how to set Nextcloud on NS8 to respond to that.

I can confirm that the trusted domains are not updated when reconfiguring Nextcloud.
But I can still access the site, no matter which subdomains I add or change. Did you setup DNS entries for your subdomains pointing to the NS8?

It’s possible to edit Nextcloud config.php to change the trusted domains:

Enter user environment:

runagent -m nextcloud1

Edit config.php using nano:

podman unshare nano $(podman volume inspect nextcloud-app-data --format={{.Mountpoint}})/config/config.php

It’s also possible to use occ, see also Double reverse proxy Nextcloud instance on NS 8 - #2 by mrmarkuz

To get the trusted domains:

occ config:system:get trusted_domains

In my case localhost and a domain are set.

To setup a third entry (the first one is entry 0, so we’re using 2):

occ config:system:set trusted_domains 2 --value=sub.domain.tld

As regards the path /nextcloud I was successful using a HTTP route, see also NethServer 7 migration — NS8 documentation

This way the URL should be rewritten from sub.domain.tld/nextcloud to sub.domain.tld so clients can access both ways.

2 Likes

Well, that doesn’t seem right.

Entries to the ns7 reverse proxy and entries as appropriate on the dns server.

Had to use occ. For some reason I can’t root from shell. I got an error trying to use nano by shell from root, so I had to work from the proxmox console window, no copy paste, etc., etc.

Once I added the needed FQDN to the trusted domains with occ I was able to create the routes. It works for the iOS clients cal and card but the windows desktop clients saw the path as a new connection so I ended up editing the client configs with the fdqn without the /nextcloud.

1 Like

???

This comes with full copy and paste features for years now!

My 2 cents
Andy

@Andy_Wismer No shell, only console.