Edit config php for trust domain. what is the command? what is the path?

hey I am a beginner in nextcloud

i installed univention appliance successfully after i downloaded the preinstalled appliance from nextcloud website

i got a domain from “ddns” company and forwarded ports to to my home computer

i also installed ssl from letsencrypt succesfully

the problem is that https://example.ddns.net says it is not a trusted domain

i did some google search and realized that i need to edit the config.php

like this

‘trusted_domains’ =>
array (

0 => ‘ucs-xxxx’,

1 => ‘my external ip at home not obligatory’,

2 => ‘example.ddns.net’,

),

the problem is that when i type

sudo nano /var/lib/univention-appcenter/apps/nextcloud/conf/config.php

it says that it is a new file and that it is not an existing file. i expected to see there a file withe values, but there is no such a file

although it is not an existing file i decided to give it a try, so I created the file as i described above but still when access nextcloud it says it is not a trusted domain

i believe that maybe sudo nano /var/lib/univention-appcenter/apps/nextcloud/conf/config

is not the correct path or not the correct command…please help me

What commands do I have to type in order to make it a trusted domain??

The main problem here is to make sure that the config which is used inside the Nextcloud docker container is updated. Changes in the config.php outside in the UCS (which is located in /var/lib/univention-appcenter/apps/nextcloud/conf/config) will not affect the running container.

We need to switch inside the conatiner and do the changes there. Fortunately the CLI-tool occ is able to to apply the changes without the need to know where the config.pho is located and without to use an editor.
Example:
First list the current set of trusted_domains:

# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:get trusted_domains 
www.xxx.xxx
192.168.1.11

Here we see that two values already exist. So lets try to add a third and check afterwards:

# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:set trusted_domains 3 --value xxx.xxx
System config value trusted_domains => 3 set to string xxx.xxx
# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:get trusted_domains
www.xxx.xxx
192.168.1.11
xxx.xxx

hth,
Dirk

5 Likes

First of all, thank you very much. It worked perfect. I am so grateful.
Secondly, and for learning purpose, where should the path for the file be? It seems to me very easy to edit the php file, the problem is the location. I have to say that it is a fresh new install of the appliance. I haven’t done any changes by myself nor did i upgraded by myself. I just downloaded the appliance from here and installed it

I tried several paths:
sudo nano /var/lib/univention-appcenter/apps/nextcloud/conf/config.php
sudo nano /var/www/nextcloud/config/config.php
sudo nano /var/www/html/nextcloud/config/config.php

None of the above commands opened the config.php file
I am a person that likes to learn new things especially because it is a fresh new install so i was wondering where can the file be located. Could the system upgraded itself automatically on a new install? if so can it be located in other places? in what paths? do you have ideas?

The copy of the config.php which AFAIK only gets updated during updates of the Nextcloud app itself is in the path I mentioned in my previous answer. You can change it but it will not have the effect you want.

In case you want to edit the current config you need to

  • switch into the container (univention-app shell nextcloud)
  • install the editor you need (like apt install nano)
  • edit the file (like nano /var/www/html/config/config.php)

You will have to install the editor again after an update of the Nextcloud app

Best Regards,
Dirk

4 Likes

Both methods works great. Thank you genius.

I thought the hard part will be the installation of the appliance. Now I see that i have one more problem - With the client application.
I download my client application and got a strange error. It happens even if i use just my internal IP and not the domain. it also happen when type the domain.

What happen is this:

I download the client application for windows.
In the server address i typed 10.0.0.5 or the domain and then I clicked next. ticked “trust certificate anyway”
And then i got a strange error “the requested url /owncloud/status.php was not found on this server”
“failed to connect to nextcloud at https://10.0.0.5/owncloud/status.php:
error transfering https://10.0.0.5/owncloud/status.php - server replied - not found.”

It is very strange. i can access 10.0.0.5 on website browser and without a problem upload or delete files. but I can’t install the client.

I uploaded pictures for demonstration

Screenshot_1
Screenshot_2

I am a beginer - the only thing i can do is to type commands :slight_smile:

For the clients you need to specify the full URL. In your case https://10.0.0.5/nextcloud or better the external hostname you added to the trusted domains (but also with /nextcloud).
Omitting the path to the nextcloud service is only possible on systems where Nextcloud is installed in / (not in UCS).

Works perfect. thanks a lot…

This is the time to see if it will work half a year without problems, with no need to fix anything, just enjoy ucs with nextcloud with lets encrypt, just upload and delete files from my home laptop/desktop computers.

If it will last even for a year without need to take care of the ucs-system or nextcloud, i would be able to recommend it to business companies, lawyers, family and friend.

stability is important…

I hope that nextcloud is enough secure from the begining of the installation - without the need to know computer programming.

I read many articles which claim that building a cloud at home is risky and without knowledge to secure home server it is not safe.

I hope that nextcloud with ucs is secure enough and there is no need for additional knowledge or configuration

Thank you for everything genius.

Mastodon