OwnCloud: You are accessing the server through an untrusted domain?

I am currently facing an issue with configuring trusted domains for my OwnCloud instance running in a Docker container. Despite editing the config.php file to include the necessary domains, I continue to receive an error indicating that I am accessing the server through an untrusted domain.

Steps Taken:

  • I have updated the config.php file to include the trusted domains as follows:

‘trusted_domains’ => [
0 => ‘localhost’,
1 => ‘192.168.1.171’,
2 => ‘public ip address (not showing here for privacy)’
],

After saving the changes, I restarted the Docker container. However, the issue persists.

I receive an error like this:

You are accessing the server through an untrusted domain.

Please contact your administrator. If you are an administrator of this instance, configure the “trusted_domains” setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation.

I would appreciate your guidance on how to resolve this matter. Thank you for your assistance.

Did you check the confi file in the container to see if the content was updated? Did you add the domain (IP) that you used in the browser to access the site?

The documentation shows an alternative way for Docker. You can try this too:
https://doc.owncloud.com/server/next/admin_manual/configuration/server/config_sample_php_parameters.html#define-list-of-trusted-domains-that-users-can-log-into

Yes and yes. It still does the same thing no matter what I check or how many different things I change.

The word domain is used, why do you only add IP addresses? Try to add the domain name.

The link in the first post points to the documentation showing that IP addresses can be added as well.

I don’t own any domains to add. I created a dns through duckdns and tried adding that to the list but it still didn’t work. I’m only trying to set up a home server using the one ip address I have which is my public one. I don’t mind if it ever changes cos I can always set up another one. I’m just trying this out, but so far no matter what kind of ip or domain I put in there doesn’t work.

Create a single PHP file in the container with this content:

<?php
phpinfo();

try to access it in a web browser and check what REMOTE_ADDR the PHP script can see. Check other variables as well, since I don’t use PHP regurarly so maybe I don’t remember an important variable. If you can’t open this file because OwnCloud redirects the request to another file, this to the index.php of OwnCloud in the first line after the opening PHP tag but before everything else

phpinfo();
exit();

Let’s restart. How do you run Owncloud?

Share your command or docker-compose.yml.

What is the path to that?

How do you run Owncloud in Docker???