Access NextCloud

joster

Cadet
Joined
Dec 31, 2018
Messages
6
Hello!

First of all... I'm rather new to both FreeNas and FreeBSD/Linux so, please have some patience... :smile:
I have installed NextCloud on my Freenas, as a plugin, without any problems. Everything seems to work normally as long as I am in my local network (same as the NextCloud server). When I try to connect from an external network (via DynDNS) I can not connect via https:// (port 443) at all and when I connect with http:// (port 80) I get an message that I try to connect from an "untrusted domain". What I have found out (if I understand everything correct) is that I have to add/change something to config.php. Here comes the questions:

Have I understood correct about the config.php file?
If I have:
Where and how do I find config php?
With what tool do i edit the file. I can not get "nano" to work (unkonwn command)?
Can someone give me an example what the file would look like when it is correct?

/Johan
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
There are probably a couple of issues:
  1. Configuration of SSL
    1. Port Forwarding port 443
    2. Valid Certificate
    3. Valid vhost/site configuration to handle port 443 traffic
  2. Nextcloud config file
Your question relates to the second of these. Within the jail shell, execute the following command to find config.php:
find / -name config.php

This may yield a few results. You want to select the one that has nextcloud pre-pended to the path. To give you an example, in my installation the file is located at /usr/local/www/nextcloud/config/config.php. I haven't used the plugin before though, so YMMV.

And then, open the file using ee, i.e:
ee /usr/local/www/nextcloud/config/config.php
Replace this path with the path relevant to you. There is no requirement to use nano, however it is often easier (than vi/emacs). I don't think it ships with the Iocage-plugins repo, and changing to that is more effort than it's worth so just use ee. Now you want to add your domain to the 'trusted_domains' field:
Code:
23   'trusted_domains' =>
24   array (
25     0 => '192.168.0.10',
26     1 => 'mydomain.dyndns.com',
27   ),

To save and quit: Esc, a, a
This should resolve the question you asked about. As for the rest, as Apollo mentioned, it might be worth referring to the guide I wrote for some instruction. Having said this, the guide is not written for the plugin, so I'm not sure how well it will apply to your use case.
 

joster

Cadet
Joined
Dec 31, 2018
Messages
6
Thank you!
I will look into those answers and hopefully it will help.

/Johan
 

joster

Cadet
Joined
Dec 31, 2018
Messages
6
Ok....
Now I can connect, from the "outside" via http but I can still not figure out how to configure SSL. Can someone please help?

/Johan
 
Top