Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

xames

Patron
Joined
Jun 1, 2020
Messages
235
1591431352171.png
 

xames

Patron
Joined
Jun 1, 2020
Messages
235
I have put manual host file 192.168.0.96 erroneous, now it works fantastic. Omg. Thanks
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I lost the admin password where i can find?
Where the script tells you--in your FreeNAS system, at /root/nextcloud_db_password.txt.
 

xames

Patron
Joined
Jun 1, 2020
Messages
235
Ok , i need to have various freenas with the same domain and same mail, is that possible? I only change general name.

nextcloud.mydomain.com
nextcloud2.mydomain.com

One of the two is working the other say certificate not valid. Same configuration with dns cloudflare and api.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
other say certificate not valid.
I can't see your screen shots, but if you're getting a certificate error, there are a few possibilities:
  • You're using the default staging certificate--as the script tells you when it finishes running.
  • The name you're browsing to isn't the (or "a") name on the cert.
  • Less likely with this script, the cert is expired.
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
Check the certificate of your current installation (you can see it in your browser). If it's issued by "Let's Encrypt Authority X3", you're good. If not, you're probably getting certificate errors anyway.
Hi Mr.danb35,

I've got this like below :
20200606_143720.jpg


i thinks. it's already ok, right ?

btw, i have any other question related to my nextcloud,
my freenas has only 500GB for now, and i wanna add 1 a new one HDD ex : 4TB especially for nextcloud storage ,
i build this freenas only for nextcloud , but when i build this a month ago, i just have 500GB HDD, in that moment i have to build and live the nextcloud fast, because covid-19 pandemic, everybody here need to work online file collaboration from their home.

and now i have a new 4TB hdd, i want to expand my nextcloud storage from 500GB to 4TB, the question is "how to do" ??

did i have to add a new hdd as a new volume in the freenas ? then what must to do ? did i have to remove existing volume and add new hdd as new volume , then re-install or rebuild the nextcloud from the beginning ? ( i hope there's another way to make it through without rebuild nextcloud from the beginning .

Please advice.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
i want to expand my nextcloud storage from 500GB to 4TB, the question is "how to do" ?
Since you only have one disk right now, you apparently don't care about redundancy. In that case, you should be able to replace the old disk through the GUI. Plug in the new one, go to Storage -> Pools, click on the gear, click Status, select the three vertical dots to the right of your current disk, select Replace, pick the new disk. Wait for the server to do its thing, then you can remove the old disk.

But consider adding a second 4 TB disk to create a mirror--which you'll unfortunately need to do at the CLI.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I created a VPN on my pfSense router on tcp port 443. In order to do that you have to disable the NAT rule that points to the nextcloud server on port 443 and add the line port-share x.x.x.x 443 to the VPN server. Where x.x.x.x is the IP of the nextcloud server. Everything works but will caddy have trouble renewing my Let's Encrypt certificate with the NAT rule on port 443 disabled?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
will caddy have trouble renewing my Let's Encrypt certificate with the NAT rule on port 443 disabled?
Unless you used DNS validation to get your cert, yes, it will.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Unless you used DNS validation to get your cert, yes, it will.
Ok I think I finally have DNS validation working. No errors in my caddy log after turning off 80 and 443 forwarding in my router and restarting. Is there a way to test the certificate renewal. Something like Certbot dry run option? Can you edit the Caddyfile to change to DNS Validation?
 

oxidizer

Cadet
Joined
Jun 14, 2020
Messages
6
Good morning. I gave this script at try last night and this morning and I am having a heck of a time getting it to work. I keep getting "failed to create jail" errors, yet when I go to the 'jails' section in the GUI, the jail is created and active. Here is the point I make it to:

Code:
root@batman[~/freenas-iocage-nextcloud]# ./nextcloud-jail.sh
JAIL_INTERFACES not set, defaulting to: vnet0:bridge0
nextcloud successfully created!

Testing Host DNS response to pkg.freebsd.org
Testing nextcloud's SRV response to pkg.freebsd.org
pkg.freebsd.org's SRV record could not be verified.

Testing nextcloud's DNSSEC response to pkg.freebsd.org
pkg.freebsd.org could not be reached via DNSSEC.

Testing nextcloud's DNS response to pkg.freebsd.org
pkg.freebsd.org could not be reached via DNS, check nextcloud's network configur
ation
Failed to creat jail
root@batman[~/freenas-iocage-nextcloud]#


Here is my config file

Code:
  GNU nano 4.4                    nextcloud-config
JAIL_IP="192.168.1.199/18"
DEFAULT_GW_IP="192.168.50.1"
POOL_PATH="/mnt/backup"
TIME_ZONE="America/New_York"
HOST_NAME="my website here"
DNS_CERT=1
DNS_PLUGIN="cloudflare"
CERT_EMAIL=xxxxxxx@gmail.com
DNS_ENV="CLOUDFLARE_EMAIL=xxxxxxx@gmail.com CLOUDFLARE_API_KEY=global API here


I'm very new to FreeNAS and shell commands, so I am sure I'm doing something wrong somewhere.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Your jail IP and Gateway are on different subnets.
 

oxidizer

Cadet
Joined
Jun 14, 2020
Messages
6
So, changing the jail IP allowed for a successful installation, but when I visit my site at www.xxxxxxxx.com, I'm only getting the generic landing page for easyDNS. I purchased a domain yesterday through them and used a free cloudflare account for the DNS hosting. I changed the nameservers on my easyDNS domain to the ones provided by cloudflare.

The first time I used to script, I used just "mywebsite.com" for the HOST_NAME, and had the same issue. After reading what a FQDN was, I reran the script to include "www." in the HOST_NAME, hoping that would solve my problem.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
It's a DNS problem, in at least two ways:
  • From inside your network, whatever you set as HOST_NAME needs to resolve to the IP address of your jail. If you have a router that doesn't suck, you can configure this on your router--I only have experience with pfSense in this regard, and it's entirely capable of doing this. If you aren't able to configure your router to do this, you have a few other options:
    • Upgrade your router's firmware to something like dd-wrt, if it's available for your router
    • Use something else for your LAN's DNS server, like maybe Pi-Hole
    • As a last resort, edit your hosts/hosts.txt file
  • From outside your network, whatever you set as HOST_NAME needs to resolve to your public IP address, if you want to be able to access your Nextcloud installation from outside. You'll also, in that case, need to forward ports 80 and 443 to your jail--again, this will be done on your router.
 

oxidizer

Cadet
Joined
Jun 14, 2020
Messages
6
It's a DNS problem, in at least two ways:
  • From insideyour network, whatever you set as HOST_NAME needs to resolve to the IP address of your jail. If you have a router that doesn't suck, you can configure this on your router--I only have experience with pfSense in this regard, and it's entirely capable of doing this. If you aren't able to configure your router to do this, you have a few other options:
    • Upgrade your router's firmware to something like dd-wrt, if it's available for your router
    • Use something else for your LAN's DNS server, like maybe Pi-Hole
    • As a last resort, edit your hosts/hosts.txt file
  • From outside your network, whatever you set as HOST_NAME needs to resolve to your public IP address, if you want to be able to access your Nextcloud installation from outside. You'll also, in that case, need to forward ports 80 and 443 to your jail--again, this will be done on your router.


Thanks for your quick reply. I thought my Asus router had this function, but I couldn't find it. It also isn't supported by dd-wrt, merlin, etc. as it doesn't have a Broadcomm chipset :rolleyes: I ended up editing the hosts file and had some success. I was able to get to the Nextcloud login page, log in, then was given an error. I went back and saw I needed to run iocage exec nextcloud /root/remove-staging.sh to get rid of the SSL errors.

I headed to the login page after that step and now I am greeted with "404 The requested URL was not found on this server." I'm ready to give up on this project.
 
Top