Resource icon

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

j2r2jones

Cadet
Joined
Oct 26, 2023
Messages
2
Hello,
I set a wrong option in my config file. So I destroyed the jail, deleted all datasets and tried to reinstall it. But I get an error and can't find the problem:
Code:
JAIL_INTERFACES not set, defaulting to: vnet0:bridge0
Existing Nextcloud config detected... Checking Database compatibility for reinstall
ls: /mnt/Storage/nextcloud/db/mariadb: No such file or directory
ERROR: You can not reinstall without the previous database
Please try again after removing your config files or using the same database used previously

As written I deleted all my datasets, so no config is stored there. Does someone know what to remove / delete before trying it again?

Edit:
it's a problem with the hidden .zfs folder inside the sub datasets:
Code:
# Check for reinstall
if [ "$(ls -A "${CONFIG_PATH}")" ]; then
    echo "Existing Nextcloud config detected... Checking Database compatibility for reinstall"

-> This check looks after files, also hidden, in the sub datasets. a .zfs folder is always existing. But strange that I did not get that error while installing it the first time...
Did you figure this out? I am running into it to
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Solved it by changing the config file /mnt/mypool/nextcloud/config/config.php
Changing 'dbhost' option from 'localhost:/tmp/mysql.sock' to 'localhost:/var/run/mysql/mysql.sock' like you do in the other thread.

Restarted the jail and Nextcloud launching in maintenance mode...
In the config.php file there is a maintenance option
Changed 'maintenance' => true, to false, saved changes and refreshed the web page

Nextcloud is back :grin::grin::grin::grin:
THANK YOU @victort for your help :wink:
Excellent!
 

tassevem

Dabbler
Joined
Oct 14, 2023
Messages
13
It would be whatever you set in the config file when you created the jail. Alternatively, you can find it in the Caddyfile in the jail.

Honestly, if you want a reverse proxy to other apps, the simpler way to go would be to ditch NPM entirely, forward 80/443 to your Nextcloud jail, and set up its Caddyfile to handle the proxies to anything else. There's no GUI for it, but it's trivial in the Caddyfile:

Code:
host.domain.tld {
    reverse_proxy 192.168.1.60:8080
}

Could not get it to work.

The solution I found is using caddy in nextcloud as my proxy server, and ditching NPM.

Is not the ideal solution, but at least its working.
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
Hey it me again, i am not sure how, but when i installed the nextcloud plugin with nat enabled then deleted it then tried installing the nextcloud pluging with dchp it started installing and finished, and I have finished installing the sript but i try to access it from inside the network (192.168.0.190) it doesn't work and only when my device outside the network and am using the domain name it works, also my database files aren't in nextcloud? it only has the regualr nextcloud files that are downloaded when installing a fresh install of the nextcloud plugin
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
My DNS is pointing to my public IP
This is my config
JAIL_IP="192.168.0.190"
DEFAULT_GW_IP="192.168.0.1"
POOL_PATH="/mnt/tank/nextcloud"
TIME_ZONE="Asia/Riyadh"
HOST_NAME="truenas.XXXX.com"
STANDALONE_CERT=1
CERT_EMAIL="pm@xxxx.com
COUNTRY_CODE="SA"

I thought the whole point of this script is so that I am able to use access my server files in nextcloud as if it is Google drive, if not how do i do it then?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
My DNS is pointing to my public IP
This is my config
JAIL_IP="192.168.0.190"
DEFAULT_GW_IP="192.168.0.1"
POOL_PATH="/mnt/tank/nextcloud"
TIME_ZONE="Asia/Riyadh"
HOST_NAME="truenas.XXXX.com"
STANDALONE_CERT=1
CERT_EMAIL="pm@xxxx.com
COUNTRY_CODE="SA"

I thought the whole point of this script is so that I am able to use access my server files in nextcloud as if it is Google drive, if not how do i do it then?
Yes that is the point. But inside your network, the DNS should point to your local IP. That way it doesn't have to circle out to the public, then back in to your nextcloud.

So on your router you would add an entry pointing truenas.XXXX.com to 192.168.0.190
 

terrorbye

Dabbler
Joined
Dec 27, 2022
Messages
17
i saw on one of forums that i need to add a mount point to nextcloud to be able to use my files on nextcloud using external storage except I can't seem to find a good explanation on what i put as the source or destination,
tried to make a empty testdataset that is open to everyone but when I try to go to external storage in nextcloud it says even after i mount it to "/mnt/tank/iocage/jails/nextcloud/root/mnt/testdatas" i get "No external storage configured or you don't have the permission to configure them"

edit: I was able to make the testdataset visible by adding www permission on the testdataset and is working perfectly
 
Last edited:

victort

Guru
Joined
Dec 31, 2021
Messages
973
i saw on one of forums that i need to add a mount point to nextcloud to be able to use my files on nextcloud using external storage except I can't seem to find a good explanation on what i put as the source or destination,
tried to make a empty testdataset that is open to everyone but when I try to go to external storage in nextcloud it says even after i mount it to "/mnt/tank/iocage/jails/nextcloud/root/mnt/testdatas" i get "No external storage configured or you don't have the permission to configure them"

edit: I was able to make the testdataset visible by adding www permission on the testdataset and is working perfectly
Great. For future reference, source needs to be the dataset on your pool, and destination should be an empty directory in your jail. I like to choose /mnt/newfoldername And the dataset needs to have the www user and group have permission to read and write. Then you simply use the external storage app inside nextcloud to add the new folder you created.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
It's similar. I use more recent versions of MariaDB and PHP. I use Caddy rather than Apache, so all the SSL/TLS stuff is handled automatically. I do not enable HSTS by default, for reasons I discuss in the README. If you see other changes you think should be made, let me know (or submit a PR) and I'll see what I can do.
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
hi, mr. danb35
how are u ?
today my nextcloud can not connect to onlyoffice document server suddenly,
it's because my onlyoffice document server domain name was expired since yesterday morning , before that , it's running normaly.
today after my domain has been renewal , my nextcloud can not connect to onlyoffice document server,
the error likes below , when i click save on server setting onlyoffice app on nextcloud :

oo error.JPG


Error when trying to connect (cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html))

when i tried to wget from onlydocument server to my nextcloud server the result like below:

[administrator@localhost ~]$ wget https://mynextcloud.server
--2023-11-16 17:30:27-- https://mynextcloud.server/
Resolving mynextcloud.server (mynextcloud.server)... 105.20.189.22
Connecting to mynextcloud.server (mynextcloud.server)|105.20.189.22:443 ... connected.
ERROR: cannot verify mynextcloud.server's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
Issued certificate has expired.
To connect to mynextcloud.server insecurely, use `--no-check-certificate'.
[administrator@localhost ~]$


did i have to renew letsencrypt certificate on my nextcloud server ? how ? but the ssl still remain for 45days ahead.

can u help me how to solve the problem ? or anyone here has same experience and how to solve it ?

Thank You ,

Best Regards,
 
Last edited:

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
This has really nothing to do with nextcloud. What is hosting your OnlyOffice server? Maybe try restarting the nextcloud jail. The certificate could be cached.
I try to restarting nextcloud jail and truenas it self but still same error, my onlydocument server is selfhost on another machine in my place, diferrent ip in one subnet with nextcloud server. I try to restarting my onlydocument server too, but still same error.

Please advice

Thankyou
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Your Nextcloud installation is fine. It's complaining about the fact that the SSL certificate for your OnlyOffice installation has expired. You need to fix that problem at the OnlyOffice system.
 

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
Your Nextcloud installation is fine. It's complaining about the fact that the SSL certificate for your OnlyOffice installation has expired. You need to fix that problem at the OnlyOffice system.
Hi mr. Patrick,
Nice to meet u ..

Both of nextcloud and onlyoffice using letsencrypt, so i have to force renewal ssl on onlyoffice doc server ,is it right?

Fyi, We have another onlyoffice doc server, on my place already used by another system, i tried to connect my nextcloud server to that server, and still same error like below:
Error when trying to connect (cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html))

Do i have to force renewal letsencrypt ssl on mu nextcloud server side ? But i dunno how to force renewal on nextcloud server as i know its using caddy

Please advice,

Thankyou
 
Last edited:

InGenetic

Contributor
Joined
Dec 18, 2013
Messages
183
Maybe try reconnecting the onlyoffice app in nextcloud settings and toggling the option to ignore untrusted certificate on and off.
If i disable certificate, the error message like below:

error oo2.JPG


Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 5.5.1.76)✖

please advice,

Thankyou & regards.
 

iyamdeanser

Cadet
Joined
Nov 18, 2023
Messages
6
Hi all, looking for some help with the script. Complete newb to Truenas Core and everything here in general, but managed to previously set up Nextcloud on Scale. Basically, followed the script instructions word for word, everything ran nicely, and then I end up with:
1700298337230.png

When I try to access Nextcloud. What's the most common reason for this? My config file looks like this:

JAIL_IP="10.0.0.199"
DEFAULT_GW_IP="10.0.0.1"
POOL_PATH="/mnt/main-storage"
TIME_ZONE="America/Vancouver"
HOST_NAME="nextcloud.xxxxxxx.com"
DNS_CERT=1
DNS_PLUGIN="cloudflare"
DNS_TOKEN="xxxxXXXXXXXxXXXXXXxXXxx"
CERT_EMAIL="xxxxxxxxxx@gmail.com"
COUNTRY_CODE="CA"

The only discrepancies that I can think of is that I've run the script in the GUI shell, multiple times, including after deleting the datasets, re-creating them, and deleting the jail; the other issue is my router not having the ability to port forward specific IP addresses or point a domain name to an internal address. To combat the second issue, I've edited my hosts file on my client computer as advised by the github.

Any help is appreciated! I want to get this thing up and running.
 
Top