Owncloud and shares access from outside LAN

hi again, i managed to setup openvpn server on my rockstor machine and set it up with own domain name. now i am trying to access owncloud from mobile (4g). Installed openvpn app, loaded .ovpn certificate and able to connect. log to the domain:8091 and it connects to the owncloud main page.

problem is, instead of the login panel i have a message reading “you are accessing the server from untrusted domain” and suggest to configure the “trusted_domains” in the config/config.php file.

how would i access this file and also, where is this file located? i am finding very difficult to navigate through this headless distro, no ftp so don’t really know the structure of the whole system.

any help will be appreciated. thanks for your time.

i know it’s new to me and always liked challenges.

Hi @satello!

I’m unsure about the VPN-related particularities, but the “untrusted domain” message from Owncloud is usually easy to fix so I hope I’ll be able to help, or at least put you on the right track.

By default, Owncloud blocks access to the server from anything that isn’t localhost (from memory) so seeing this message is perfectly normal. To add your “access point” as a trusted domain, you can follow the official documentation:
https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/config_sample_php_parameters.html
The file you are looking for should be in the “config” share that you specified during the Owncloud Rock-on installation (let’s call it <oc-config> as an example). The easiest way to access it would be via SSH (you can use Rockstor’s Shellinabox service for that, for instance). From memory, the file should be at the following location:

/mnt2/<oc-config>/config.php

Within this file, the part you need to modify is the following:

'trusted_domains' =>
  array (
    'demo.example.org',
    'otherdomain.example.org',
  ),

There, you need to add yours to the array as follows (using the information you provided):

'trusted_domains' =>
  array (
    'demo.example.org',
    'otherdomain.example.org',
    'domain:8091',
  ),

Note that I used domain:8091, but you may even omit the port, I believe (I can’t seem to remember exactly whether you need to specify it or not). To be safe, I would add exactly what the “untrusted domain” error message mentions.

After saving your changes to the config.php file and restarting the Owncloud Rock-on, the “untrusted domain” message shouldn’t appear anymore.

Please note that everything I wrote was form memory so the reality may differ very slightly, but the gist of it should be correct.

Hope this helps,

1 Like

hello, thanks for your reply. the owncloud which actually worked and I was referring to was the OwnCloud-Official. The other owncloud did not even open the UI

Yes, I think the Rock-ons repository may need some additional clarity or documentation (perhaps even cleaning?) with regards to the different Owncloud Rock-ons there are.

Should I understand that you could fix the “untrusted domains” issue?

the problem for me has been find the directory structure of the various rockons/dockers/system. i then installed a ftp server for centos which at least has shown where the files and folder are and then from there i was able to edit file with ssh > nano.

Hello,
Thanks for the write up, however this is not working for me.

I added my domain to the config.php file (I tried it with both the port and without) and it still gives the generic error about trusted domains.

‘trusted_domains’ =>
array (
0 => ‘rockstorage’,
‘browncoats.us.to:8091’,
),
Any ideas?