Resource icon

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

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
One is securing via HSTS by making changes to a file
This is covered in the README. I deliberately disable it by default because it can lock you out of your site if certificate renewal isn't working properly.
Please post the output of pkg info | grep nextcloud inside your jail.
Since I don't use the packages to install Nextcloud, I wouldn't expect this to return anything.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Since I don't use the packages to install Nextcloud, I wouldn't expect this to return anything.
You don't? OK ... your call then, I guess. :smile:
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Generally when I run the script again, I stop my old jail, rename it to nextcloud1 or similar, then run the script again. This way, if something goes wrong, my old jail is still there to use. Once i confirm everything works on the new jail, i delete the old one.

We can take care of the errors and warnings once you have updated all the way to 27.

I would run the script with NEXTCLOUD_VERSION=26 at this point and update from the GUI when it is finished.
 
Last edited:

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
Generally when I run the script again, I stop my old jail, rename it to nextcloud1 or similar, then run the script again. This way, if something goes wrong, my old jail is still there to use. Once i confirm everything works on the new jail, i delete the old one.

We can take care of the errors and warnings once you have updated all the way to 27.

I would run the script with NEXTCLOUD_VERSION=26 at this point and update from the GUI when it is finished.
When you do this your settings and everything stay?
 

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
You would need to use a new jail name, then move your data, I guess.

Please post the output of pkg info | grep nextcloud inside your jail.
Nothing showed when doing that.
 

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
This is covered in the README. I deliberately disable it by default because it can lock you out of your site if certificate renewal isn't working properly.

Since I don't use the packages to install Nextcloud, I wouldn't expect this to return anything.
Thank you, for the direction. I found this in the readme and got it corrected.
 

ThatGuyAZ

Dabbler
Joined
Apr 28, 2021
Messages
32
Thank you for all your help, got it working perfectly.
Well except that I had some folders mounted which I had to recreate on the new jail. Unfortunately, I made changes to my config trying to chase down the issue, so now I have to redownload 150Gb of data to "resync." So if you do this, make sure you recreate your mount points for external storage.
 
Last edited:

guermantes

Patron
Joined
Sep 27, 2017
Messages
213
EDIT: turns out I had misconfigured DNS lookup for the Wireguard interface.

My self-installed NC broke down during upgrade, so I decided to try this script. I am very impressed. Thanks @danb35 and everyone having helped in develop it.

I just experience one problem, and I can't really put my finger on where the error might lie.

My LAN is sealed off from the outside internet. I tunnel in using Wireguard/pfsense. I can thus access truenas, webservers etc all within my LAN. When away from home, I could also access my old NC instance via the phone browser or the NC Android app using this Wireguard setup.

But since I reinstalled using the script and a self-signed certificate Nextcloud is not reachable anymore. The tunnel works because I can access other services on my LAN, but for NC the app says "Server not available", the browser says "Cannot find page".

  • the new NC is mapped to the same IP as the old
  • all caches have been cleared
  • in internal DNS lookup in pfsense associates the NC instance to the correct IP
  • I can even tunnel into my network using my phone, log into pfsense, and then do a successful DNS lookup for nextcloud while in the VPN tunnel

What might be going on here?
 
Last edited:

tassevem

Dabbler
Joined
Oct 14, 2023
Messages
13
Please help... I've read a lot of pages looking for someone with my problem, but its just too many.

I've installed 2 times, without any errors, but when I try to connecto to the local ip in my browser I get connection refused: ERR_CONNECTION_REFUSED

Can someone help me understand what I'm doing wrong?
 

tassevem

Dabbler
Joined
Oct 14, 2023
Messages
13
Please help... I've read a lot of pages looking for someone with my problem, but its just too many.

I've installed 2 times, without any errors, but when I try to connecto to the local ip in my browser I get connection refused: ERR_CONNECTION_REFUSED

Can someone help me understand what I'm doing wrong?
I forgot to post the config...

]
JAIL_IP="192.168.1.113"
DEFAULT_GW_IP="192.168.1.1"
POOL_PATH="/mnt/Main/"
TIME_ZONE="Europe/Lisbon"
HOST_NAME="nas.axxxxeira.pt"
DNS_CERT=1
DNS_PLUGIN="cloudflare"
DNS_TOKEN="xxxxxxxxxx"
CERT_EMAIL="nas@alvxxxxveira.pt"
COUNTRY_CODE="PT"
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
My self-installed NC broke down during upgrade, so I decided to try this script. I am very impressed. Thanks @danb35 and everyone having helped in develop it.

I just experience one problem, and I can't really put my finger on where the error might lie.

My LAN is sealed off from the outside internet. I tunnel in using Wireguard/pfsense. I can thus access truenas, webservers etc all within my LAN. When away from home, I could also access my old NC instance via the phone browser or the NC Android app using this Wireguard setup.

But since I reinstalled using the script and a self-signed certificate Nextcloud is not reachable anymore. The tunnel works because I can access other services on my LAN, but for NC the app says "Server not available", the browser says "Cannot find page".

  • the new NC is mapped to the same IP as the old
  • all caches have been cleared
  • in internal DNS lookup in pfsense associates the NC instance to the correct IP
  • I can even tunnel into my network using my phone, log into pfsense, and then do a successful DNS lookup for nextcloud while in the VPN tunnel

What might be going on here?
There is really nothing in the Nextcloud install that should prevent you from accessing it.

Are you trying to access it through your domain name, or by IP address?

Is your wireguard tunnel set to route all traffic through your pfsense, or how is that configured?
 

tassevem

Dabbler
Joined
Oct 14, 2023
Messages
13
I have my house ip in my dns, and in my regular vodafone router, have port forwarded.

I changed the configuration. Deleted the 4 folders and created 4 datasets. It is diferent, but still not working.

Now it is giving a certificate error.

1697381326893.png

I dont know if it is because my main install has a valid certificate, should I execute the "iocage exec nextcloud /root/remove-staging.sh" comand?
 

tassevem

Dabbler
Joined
Oct 14, 2023
Messages
13
I have my house ip in my dns, and in my regular vodafone router, have port forwarded.

I changed the configuration. Deleted the 4 folders and created 4 datasets. It is diferent, but still not working.

Now it is giving a certificate error.

View attachment 71226
I dont know if it is because my main install has a valid certificate, should I execute the "iocage exec nextcloud /root/remove-staging.sh" comand?
It was the Anti-virus blocking because it did not trusted the certificate.

But now I cannot install the certificate.........................................

1697386118944.png


Can anyone provide a solution?

victort Thank you for being so helpful.
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
Hello i have a truenas 13 and want to use nextcloud to access my files from anywhere like google drive, what i have currently:
a database names nextcloud with the 4 sub databases
a dns thats points to my nextcloud(currenlty have nextcloud jail installed and might delete and do a fresh install) with an ip of 192.168.0.190
and the dns that opens my nextcloud jail :truenas.xxxxxx.com
i made a nextcloud config that looks like this

JAIL_IP="192.168.0.190"
DEFAULT_GW_IP="192.168.0.1"
INTERFACE="em0"
POOL_PATH="/mnt/tank"
TIME_ZONE="Asia/Riyadh"
HOST_NAME="truenas.xxx.com"
STANDALONE_CERT=1
CERT_EMAIL="pm@xxxxxx.com"


I am a total noob at this stuff and got lost at the first few words in the installation, do you have a step-by-step guide somewhere becuase i don't know how to even do this "Download the repository to a convenient directory on your FreeNAS system by changing to that directory and running".
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
cd is a command to change directories (folders)

Open the shell on your TrueNAS then type

cd /usr/local then
git clone https://github.com/danb35/freenas-iocage-nextcloud then
cd freenas-iocage-nextcloud then place your nextcloud-config file here. Then
script nextcloud.log ./nextcloud-jail.sh

Make sure your ports are forwarded if you use a standalone cert.
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
cd is a command to change directories (folders)

Open the shell on your TrueNAS then type

cd /usr/local then
git clone https://github.com/danb35/freenas-iocage-nextcloud then
cd freenas-iocage-nextcloud then place your nextcloud-config file here. Then
script nextcloud.log ./nextcloud-jail.sh

Make sure your ports are forwarded if you use a standalone cert.
does nextclous need to be installed before hand or does the script auto install nextcloud?
 
Top