Changes in config.php lost upon reboot

Hello,

I run NC on a raspi. I have changed the trusted domain in config.php, either directly in the config file or using

> sudo -u www-data php /var/www/nextcloud/occ config:system:set trusted_domains 11 --value=mynewserver

Both ways seem to work after the change. But after rebooting my raspi everything is back to standard. I can do that change permanently?

Thanks.

I observed the same behaviour today. After rebooting, the trusted domains in the config.php were reset to the LAN IP of my RPi and the WAN IP of my router. The local domain name I use for acess in my LAN was gone. However, other custom adjustments I made, like mail or logging settings, remained. I couldn’t find any information to this config change in the nextcloud log or elsewhere.

I found that on my system runs a nextcloud-domain.service at startup which runs the script /usr/local/bin/nextcloud-domain.sh. This script overwrites the trusted domain entries with the indices 1 and 11 in your config to auto-update LAN and WAN IPs for your cloud server.

As far as I unterstand, this script is not a Nextcloud component. It belongs to NextcloudPI. I you don’t want the trusted domains to be updated this way, you can disable this corresponding service. Or, if you want to keep the service active and want to add custom trusted domains to the config, try to avoid using the mentioned indices 1 and 11.