Resource icon

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

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
Would the script grant me better luck with setting the admin and first database information? As in, if the files aren't going where they're suppose to with point n click install, would the script do so?

Sent from my SM-N950W using Tapatalk
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Would the script grant me better luck with setting the admin and first database information? As in, if the files aren't going where they're suppose to with point n click install, would the script do so?

Sent from my SM-N950W using Tapatalk
Rereading your previous post, I realized you were trying to connect to the Nextcloud Web interface, am I correct?
Are you trying to make a new install of the Nextcloud iocage to use an existing Nextcloud database?
If so, I would suggest two things:

Create a dummy dataset for "db" and "files" so that you can install Nextcloud iocage and validate the process works in its entirety.
Then you will need to edit the "config.php" file to match some of the key parameters from your previous jail. They define MySQL database user and password. Such parameters are among the following:

'instanceid'
'passwordsalt'
'secret'
'dbname'
'dbuser'
'dbpassword'

If you are in the iocage jail, do:

service apache24 restart
or outside the iocage jail:
iocage restart name_of_your_iocage_jail
Wait a short moment and try to connect to Nextcloud Web interface using your own credentials.

I forgot, you need to edit the "fstab" file to point to your old Nextcloud "db" and "files" datasets. Then restart your iocage jail.
 

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
I was accessing Nextcloud through the web interface. I'm trying to start my first setup of it.

Sent from my SM-N950W using Tapatalk
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I was accessing Nextcloud through the web interface. I'm trying to start my first setup of it.

Sent from my SM-N950W using Tapatalk
Then I would either start a nw iocage install with a new "db" and "files" datasets, or destroy the failing iocage jail, delete content of "db" and "files" and perform the install again.
Make sure there are no errors during install and try to connect again.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I get this on 11.2 beta 2 using the web interface. O am i better off waiting for beta 3?
Do you get that after running my script, or after trying to install in a different way? If the latter, you'd probably be better off posting in a different thread.
 

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
I got that trying to install NextCloud through the plugins listing.. and then trying to create user info.

Sent from my SM-N950W using Tapatalk
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I got that trying to install NextCloud through the plugins listing.. and then trying to create user info.

Sent from my SM-N950W using Tapatalk
I think you should run Danb35 script instead. I believe it is by far the better solution for running Nextcloud.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I got that trying to install NextCloud through the plugins listing.
This thread has nothing to do with the plugin, so please don't post questions about it here. If you'd like to try my script instead, read the first post and go from there.
Would the script grant me better luck with setting the admin and first database information?
The script takes care of both of those for you.
 
Last edited:

luckyal

Dabbler
Joined
Aug 4, 2017
Messages
32
To fix the iocage issues, you can manually update the script files using git.
cd /tmp
git clone --recursive https://github.com/iocage/iocage
cp -R iocage/iocage/lib/ /usr/local/lib/python3.6/site-packages/iocage/lib

Everything should be working now.

Edit:
Somehow there's something wrong with the database...
I also tried it with mariadb102-server but that does not change anything.
Complete install log with a little snip of the nextcloud folder structure(which is huge!) https://pastebin.com/eJVjK3ay
Hope anyone can find the problem here... been looking for hours.

getting this error after running last command:

cp: iocage/iocage/lib/: Not a directory
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've just been playing with this script under 11.2-BETA3, where it works just fine on a perfectly clean system (no tunables or anything else) using vnet. I've also taken a stab at updating it for Nextcloud 14, and it's working for me with very brief testing--if you're feeling adventurous, check out the nextcloud-14 branch of my repo and see how you get on.

Edit: I've added a little bit of logic to the nextcloud-14 branch to determine whether it's running under 11.1 or 11.2 and create the jail using the appropriate template. It seems to install without issues, except one:
Code:
Error updating .htaccess file, not enough permissions or "overwrite.cli.url" set to an invalid URL?

It's not quite clear to me why this is happening, as the .htaccess file is owned by www:www. But it's late and I'm tired--I may check it more later. But in any event, NC14 is up and running.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Error updating .htaccess file, not enough permissions or "overwrite.cli.url" set to an invalid URL?
OK, I think I have this licked--I need to set overwrite.cli.url in the nextcloud configuration to the URL for the system. The nextcloud-14 branch seems to be working for me without issues on 11.2-BETA3; you can check it out with git clone -b nextcloud-14 https://github.com/danb35/freenas-iocage-nextcloud. I'll probably merge that branch into master in a few days unless I hear of issues.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I was checking out some of your updates to the script and had a few questions.
1) why did you update the php.ini memory to 512M as the ini file says in the comments that the maximum in 128M?
2) why did you add perl5.28?
3) what does the set overwrite.cli.url do? I read https://github.com/nextcloud/server/issues/6313
but that didn't clarify it for me.

Thanks
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
1) why did you update the php.ini memory to 512M as the ini file says in the comments that the maximum in 128M?
Because occ (now) complains if it's set to less than 512M.
2) why did you add perl5.28?
It's apparently needed to support gallery view of .raw images.
3) what does the set overwrite.cli.url do?
No idea. I just know that occ won't alter the .htaccess file if it's set (as it is by default) to http://localhost.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've updated the script with options to generate a self-signed certificate (SELFSIGNED_CERT=1) and to disable HTTPS entirely (NO_CERT=1). I'd recommend using the former option if you:
  • Can't get a Let's Encrypt cert for some reason,
  • Intend to use some other certificate (e.g., from another CA, or a Cloudflare Origin cert), and/or
  • Just want a self-signed cert
If you're going to use some other cert, the script will tell you where in the jail to put the cert/key files.

If you don't want to use HTTPS at all, I wouldn't recommend that, but you can by setting NO_CERT to 1 in nextcloud-config.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Having heard no objections or issues, I've merged the nextcloud-14 branch--the script will now install the latest Nextcloud 14 release.
 

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
Trying to create the 16KB db dataset landed me this..
063f95027e8b44abdd48796d0b06fe5f.jpg


Sent from my SM-N950W using Tapatalk
 

Scrat_

Explorer
Joined
May 3, 2018
Messages
95
Success.. files and db belong in databank01, just to verify?

Sent from my SM-N950W using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Ordinarily, files, db, and portsnap will all be datasets under your main pool. If you set things up that way, you just need to set POOL_PATH to the path for your pool (/mnt/databank01), and don't need to set FILES_PATH, DB_PATH, or PORTS_PATH.
 
Top