Trusted_domain-configuration not working

Steps to reproduce

  1. Access Owncloud via cloud.example-group.de
  2. Get error “Domain is not trustworthy”, add domain to “owncloud/config/config.php”
  3. Access Owncloud via cloud.example-group.de again

Expected behaviour

Domain should now be trustworthy

Actual behaviour

Domain is still not trustworthy

Server configuration

Operating system: Ubuntu 18_04 LTS Desktop

Web server: Apache2

Database: MySQL

PHP version: PHP 7.2

ownCloud version: 10.0.9

Updated from an older ownCloud or fresh install: Fresh and clean ;D

Where did you install ownCloud from: Official repositories

Signing status (ownCloud 9.0 and above):

The content of config/config.php:
[…]
‘trusted_domains’ =>
array (
0 => ‘server.example-domain.de’,
1 => ‘cloud.example-group.de’,
2 => ‘localhost’,
3 => ‘$ip-address’,
4 => ‘cloud.example-domain.de’,
),
[…]

List of activated apps: LDAP

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: LDAP -> ActiveDirectory

Client configuration

Browser: Google Chrome

Operating system: Android 8.0.0, Windows 10

PROBLEM:

So our domain is: example-domain.de, while our website is example-group.de
The owncloud-server is server.example-domain.de and the cloud can be accessed nor problemo via “server.example-domain.de”, “cloud.example-domain.de”, “cloud.example-group.de”, and “$ip-address”, as long as I’m using a PC that is in the domain-network.

When trying my phone, (or a notebook using a hotspot my phone delivers) I can’t access the cloud via the “example-domain.de”-adresses of course, as it is not in the domain. But when I’m trying the "cloud.example-group.de"address, it gives me the error of the accessing domain not being trustworthy and I should add it into the trusted_domains.

(In our DNS “cloud.example-group.de” points to “$ip-address”)

So how can I make the “cloud.example-group.de” trusted? (Except by adding it to trusted_domains?)

Seems to me like a DNS issue if you have no issues accessing the site from your PC.

Also I am not sure if you can add a Variable in the array list.

I have no issues accessing it from inside the network, but it won’t work from outside the network.
It doesn’t matter which device I use…

Also I did not add a variable, it was just a placeholder. Could’ve used 123.456.78.90 or something instead.

Edit:
I also just did a dns-lookup on a PC outside the network, and when I try “nslookup cloud.example-group.de”, it gives me the correct IP.

Edit2:
Also I don’t get the little pop-up window when I click on the button to “add X to the trusted domains”.
http://server.example-domain.de/index.php/settings/admin?trustDomain=cloud.example-group.de” does norhing but sending me into the settings…

Solved. It was some wrong config in the firewall…

2 Likes

Same exact problem but turning off the firewall did not fix it:
OwnCloud server 10.3.1
Added domains to trusted domains in config.php and owncloud web interface STILL claiming I’m accessing from an untrusted domain.
I’m out of ideas on this one. Owncloud 10.2 did work. Also, I can access Owncloud sever in localhost.
I have no idea what’s going on here!
Thanks,
Phil

try: 'overwritehost' => '',

Here you enter your server address.

https://doc.owncloud.com/server/10.1/admin_manual/configuration/server/config_sample_php_parameters.html#proxy-configurations

2 Likes

Same problem.
Tried every posted suggestion and still not able to get past the “untrusted domain” message.
Here is the config page below. Installed by Softaculous. I am using a shared IP address. I have at one time or another added ‘localhost’ and the ip address but still the same “untrusted domain” message.

<?php
$CONFIG = array (
  'instanceid' => 'ocnax9hcltlm',
  'passwordsalt' => 'xxx',
 
 'secret' => 
'xxx',

  'trusted_domains' => 
  array (
    0 => 'burlingtonroute.org',
  ),

  'datadirectory' => '/home/burlin19/ownclouddata',

  'overwrite.cli.url' => 'http://burlingtonroute.org/BRHS_cloud',

  'dbtype' => 'mysql',

 
 'version' => '10.4.1.3',


  'dbname' => 'xxx',

 
 'dbhost' => 'localhost',

 
 'dbtableprefix' => 'oc_',

 
 'dbuser' => 'xxx',
 
 'dbpassword' => 'xxx',
 
 'logtimezone' => 'UTC',
 
 'apps_paths' => 
 
 array (
    0 => 
    array (
      'path' => '/home/burlin19/public_html/BRHS_cloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
  
  1 => 
    array (
      'path' => '/home/burlin19/public_html/BRHS_cloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
);

If anyone can offer a solution, please do.

Admin Edit: removed security relevant information; formatting

On shared hosting it makes no sense to add localhost or the IP address, as the Host-Header is used to route the request to your virtual host.

Perhaps test your ownCloud domain with a curl -I, perhaps there is a Location: header in the response which will forward you to a different domain. Alternatively open the dev-console in your browser, you should also be able to see redirects (and the final host header) there.

1 Like

same isssue tried every possible thing to get owncloud accesible in local network no luck , :frowning:

@Dinesh_Yadav your problem is completely different as @highland is using shared hosting, ergo publicly available, while you are talking about a local network. Perhaps open a new topic in the server category, where you can detail how you set up your ownCloud server in the post template.

1 Like

thanks! I will do that.