Owncloud: You are accessing the server through an untrusted domain

Hi all,

I was running owncloud successfully for quite a while now on my private UCS server. Today I updated UCS to 5.0-4 and after having done that I also updated the owncloud server from something 9 to the most recent 10.12.1.

After that I noticed that the server did not accept the additional URLs as trusted which I had added to /config/config.php at earlier versions.

I used univention-app shell owncloud to enter the container shell and found out that the domains were gone, indeed. So I made a backup copy of /config/config.php and added the URLs/domains as before. However, this did not change anything. So I changed the order of the domains in config.php to find out whether this makes any difference. Yes it did, this way the local domain did not work anymore either. So I put the original config.php in place again → no change. The local domain did not work. Finally I even uninstalled owncloud and reinstalled it. Again, no access by local domain anymore. Now I am stuck.

Does anybody have any idea about that ? Or should I rather install nextcloud instead ? Any ideas are welcome …

Martin

I havent configured ownCloud for a while but would expect that the steps described in How To Edit config.php in Nextcloud App would work the same way.

hth,
Dirk

That’s exactly what I tried. I installed NextCloud w/o problems and added some trusted domains. These worked immediately. I then copied the part over to the OwnCloud config.php - no chance.

),
  'trusted_domains' => 
  array (
    0 => 'lion.xxx.intranet',
    1 => '192.168.31.2',
    2 => 'xxx.dnsalias.net',
    3 => 'yyy.dnsalias.net',  
  ),
  'datadirectory' => '/var/lib/univention-appcenter/apps/owncloud/data/files',

It simply does not work.

I’d rather try to display/change the setting using occ as described in the second part of the mentioned document, at least until I know for sure which and how config.php is used.

EDIT: Using the occ Command :: ownCloud Documentation is mentioning the same syntax of occ (STRG-F trusted_domains)

Thanks, I did not know that one.

However:

root@12d2f3d2a44d:/var/www/owncloud# occ config:system:set trusted_domains 0 --value=lion.xxx.intranet
System config value trusted_domains => 0 set to string lion.xxx.intranet
root@12d2f3d2a44d:/var/www/owncloud# occ config:system:get trusted_domains
localhost

It looks as if occ tries its best but isn’t successful … :thinking:

Well, it actually changes the config.php (as I tried before manually) - however, these changes do not affect the system behavior …

whoa, I wasnt aware that 3rd-party apps are using app settings that heavily.
you can change the settings in UMC in the AppCenter (manage installations).

heres the CLI-Version

root@dn1:~# univention-app shell owncloud occ config:system:get trusted_domains
dn1.training.ucs
root@dn1:~# univention-app configure --list owncloud |grep OWNCLOUD_DOMAIN
OWNCLOUD_DOMAIN: 'dn1.training.ucs' (Setting for OWNCLOUD_DOMAIN env variable. Together with SUB_URL this defines the owncloud setting overwrite.cli.url.)

root@dn1:~# univention-app configure owncloud --set OWNCLOUD_DOMAIN=trainer01.univention.de
Configuring 4.4/owncloud=10.12.1
Setting OWNCLOUD_DOMAIN to 'trainer01.univention.de'
ucr cannot be found, falling back to changing the database file directly
No OIDC identity provider installed
warning: commands will be executed using /bin/sh
job 4 at Fri Jun 30 14:16:00 2023
Executing interface configure for owncloud
Copying App Center's configure to container's /tmp/owncloud-configure
configuration script running...
root@dn1:~# univention-app shell owncloud occ config:system:get trusted_domains
trainer01.univention.de

(I found it after wondering what /var/lib/univention-appcenter/apps/owncloud/conf/overwrite.config.php is actually doing)

Okay, that worked. Thanks for your help.

Ran into this same problem after updating to UCS 5.0.5 and owncloud 10.13.2. Like the original poster, tried editing config.php and docker-compose.yml. Nothing works. This instructions marked as the solution is also not working for me. The “get trusted domains” returns the UCS default rather than the values I have set and have been using successfully until now. Any ideas?

Got to modify my statement. It works that way that I was able to login the default values which even did not work before. My final solution was to move everything to nextcloud which I was using for the calendars anyway.

Thank you for the reply.
This sort of thing has happened to me too often and is getting tiresome.
This is the second time now this year that other people’s solution to a problem similar to mine was to move to nextcloud… It may be time to take the same step.

Mastodon