Nextcloud Docker app having broken config

nextcloud

#1

Short description of the issue:

  1. Nextcloud 12.0.3-0 has been installed via UCS Apps
  2. Custom proxying made with external domain
  3. On first login Nextcloud blame that we need to add external domain as trusted
  4. It is working

Today we have updated Nextcloud to 12.0.5-0 and immediately found that:

  1. Altered config.php in directory /var/lib/univention-appcenter/apps/nextcloud/conf/config/ has been overwritten
  2. The Nextcloud still blaming that external domain not trusted

After review we have found that there is an issue - Nextcloud (docker based) itself located in /var/www/html so its actual config is in /var/www/html/config/config.php

The UCS default binds do config and data mappings from/to /var/lib/univention-appcenter/apps/nextcloud/conf and /var/lib/univention-appcenter/apps/nextcloud/data while first should be /var/lib/univention-appcenter/apps/nextcloud/conf/config to /var/www/html/config

Looks to be like a bug?


#2

The trusted domains are reset on update (to reflect possible changes on the host) and custom entries are lost: https://github.com/nextcloud/univention-app/blob/master/setup#L149-L155

Custom entries should be kept, obviously, so this is a bug. I guess we should just do this once on install, and let any further changes be business of the admin. Too error prone. I opened a bug: https://github.com/nextcloud/univention-app/issues/46


#3

I have the same problem after I updated to

  • Nextcloud Version: 13.0.4-0
  • UCS Version: 4.3-1 errata 151

But I cannot find /var/www/html/config/config.php to correct the trusted domains.
Entries in /var/lib/univention-appcenter/apps/nextcloud/conf/config/config.php do not work I still get the “not trusted domain” error when I try to access nextcloud from external.
The internal access https://local_IP/nextcloud/ works fine.
But every external access fails.

Where is the config.php to correct the trusted domais?


#4

Actual config.php is in /var/www/html/config

Of course, to change it you need to enter inside docker container:

  1. find out the ID of the nextcloud container via “docker ps”, the ID is the first, the image name something like docker.software-univention.de/nextcloud:13.0.4-0
  2. enter inside: “docker exec -it ID bash”
  3. copy file to external host mount: “cp -p /var/www/html/config/config.php /var/lib/univention-appcenter/apps/nextcloud/conf/actual.conf”
  4. now you may exit container and visit “/var/lib/univention-appcenter/apps/nextcloud/conf” on the host to compare/edit configs, then move it back (while being in container).

There are many ways how to do it, it is just one of them.


#5

Dear Aliaksandr Kuzko,

thanks a lot. That worked fine with 2 installations. The access from Works again.

Thanks


#6

these two steps can be simplified. Univention offers the possibility to directly jump into the container by calling univention-app shell appname, so e.g. univention-app shell nextcloud.

If an editor is installed in the app then you could probably edit the file directly in place (but I had to run apt update && apt install vim the last time I had a deeper look at the nextcloud image.