How to add trusted domains to config.php

Keywords: OwnCloud - OS X - How to - Other
Description:

I have successfully installed Owncloud on OS X.
I have successfully implemented port forwarding in the Owncloud app to reach it in the web browser via localport:8888 on the mac mini server where it is located AND from a mac laptop via a fixed ip from my network provider with http and https.

But when I do that, i get the owncloud website with the (german) warning that I reached it via a untrused domain, and I should change the untrusted domain entries in config/config.php. I read the help how to change that file:

https://docs.bitnami.com/general/apps/owncloud/administration/modify-domains/

But I do not know how to do that.

Are the trusted domains the same as adding a server IP in the owncloud settings under Settings/security/CORS Whitelist?
There I added:

https://my_external_ip
https://my_external_ip:my_https_port
http://my_external_ip
http://my_external_ip:my_http_port (8888)

still if I access my Webbrowser from one of these adresses I get the same warning.

The helpfile explains what to change the config.php file

How do I open it and save it? If I mount the Bitnami volume opt/bitnami I can navigate to its location:

Approach A (Bitnami installations using system packages): /opt/bitnami/owncloud/config/config.php

But I find only an alias, which I cannot open or find the original. I want to edit this list:

'trusted_domains' =>
array (
    0 => "FIRST_DOMAIN",
    1 => "SECOND_DOMAIN",
    2 => "THIRD_DOMAIN",
), 

Do I have to open it in the Terminal?
How do I do that?

Hi @a.roessner

Thanks for using Bitnami OwnCloud!

Are the trusted domains the same as adding a server IP in the owncloud settings under Settings/security/CORS Whitelist?

No, they are different settings. The one referring to CORS Whitelist is a list of allowed domains your Owncloud instance is allowed to request resources from, while the trusted_domains entry in config/config.php contains the list of domains from which the users plan to access your instance.

References:
https://doc.owncloud.com/server/user_manual/personal_settings/security.html
https://docs.bitnami.com/general/apps/owncloud/administration/modify-domains/

still if I access my Webbrowser from one of these adresses I get the same warning.

Hence, it makes sense that you still receive the same warnings :slightly_smiling_face:

How do I open it and save it?.. Do I have to open it in the Terminal? How do I do that?

You can open a new terminal window from your Application Dashboard. Once the application has started up (notice the green dot), click on the Open Terminal button.

A new shell interpreter will appear and you can modify the desired file with an editor, such as nano:

root@debian:~# sudo apt-get update && sudo apt-get install nano
root@debian:~# sudo nano /opt/bitnami/owncloud/config/config.php

Could you please try that and report back?

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Thanks for the quick reply, Jose,
That is exactly what I was looking for!

I have tried this:

I get an error message when trying to install nano.

Any ideas?

Hmm that is in fact strange. Could you try executing the following commands?

root@debian:~# sudo apt-get clean
root@debian:~# sudo apt-get update
root@debian:~# sudo apt-get install nano

If the above commands do not work either, you can also use vim, another editor that comes preinstalled in the instance (but is a little bit more complex to use, but more powerful).

root@debian:~# sudo vim /opt/bitnami/owncloud/config/config.php

If you decide to use the latter, here you have a handy introductory guide that will help you out :slightly_smiling_face:
https://www.linux.com/training-tutorials/vim-101-beginners-guide-vim/

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

I tried the three steps, but without success:

root@debian:~# sudo apt-get clean >> worked ok - no response
root@debian:~# sudo apt-get update >> Errors
root@debian:~# sudo apt-get install nano >> Errors see screenshot

I was able to change the trusted domains with Vim!
Thanks, the problem is solved! :thumbsup:

Glad to see you were able to solve your issue! We are marking the previous answer as “Solution” and this topic as “Closed”.

If you have any other questions, please do not hesitate to let us know. Feel free to create a new topic referencing this one if necessary.

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart: