Resource icon

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

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If it's just not supported by the script yet
It should be now. If you've already downloaded the script, change to the directory where you downloaded it and run git pull to download the update.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've just updated the script to address a few issues (notably its failure to install memcache due to the change in the package name, resulting in the installation not working), and also upgrade to Nextcloud 18. This also addresses some configuration warnings that were present in previous versions.

As far as I can tell, this should let you use the new community document server, but I haven't yet been able to get it working in the little bit I've tried--maybe someone else can get farther. Here are the instructions I have so far:

From inside the jail, run these commands:
Code:
cd /usr/local/www/nextcloud/apps
fetch https://github.com/nextcloud/documentserver_community/releases/download/v0.1.5/documentserver_community.tar.gz
tar zxfv documentserver_community.tar.gz
rm -f documentserver_community.tar.gz
chown -R www:www documentserver_community

Then, inside the Nextcloud GUI, as an administrator, download and install the OpenOffice Connector app, and enable the Community Document Server app.

From there, AFAIK, it should Just Work (tm), but it doesn't seem to. I'll probably work on this a bit in the coming weeks, unless someone else figures it out sooner.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
You did chown, what about chmod?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
From there, AFAIK, it should Just Work (tm), but it doesn't seem to.
So the problem is that /usr/local/www/nextcloud/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/x2t is a Linux binary. Looks like I need to look into the Linux compatibility layer some...

Edit: Well, it seemed straightforward enough:

But it still isn't working properly. Discussion of that problem over here:
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've just pushed an update to the script that forces creation of the jail using the 11.3-RELEASE template. FreeBSD 11.2 is EOL, and the hacks needed to allow packages to install and ports to build are less likely to work as time goes on. This means that the script will no longer work with FreeNAS versions earlier than 11.2-U7. However, 11.2-U7 and anything in the 11.3 series should work just fine.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
How does built-in ONLYOFFICE work on FreeNAS? I've never managed to get it working in a jail and have a Linux VM running just for ONLYOFFICE Document Server. I'm hoping I might be able to spin that down with Nextcloud 18?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
How does built-in ONLYOFFICE work on FreeNAS?
As yet, no change from two posts up--it doesn't work. There's a Linux binary involved, but it runs using FreeBSD's Linux compatibility layer. Still trying to track it down.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Sorry, I should have read a few more posts! I was feeling brave, so snapped my jail and database, switched to the beta channel and updated from 17.0.3 to 18.0.0. All worked fine through the WUI, although I needed to update some database tables afterwards, and I have a couple of incompatible apps, although nothing important.

I tried installing the Community Document Server app, but no joy which I'd have known if I'd scrolled a little further! Still works fine with my external Document Server though, and file syncing all seems to be working fine. I'll have a play with some of the new bits tomorrow, but so far everything looks good. I'm about to give access to a small group of users, so thought it better to upgrade before doing that.
 

ByteNick

Explorer
Joined
Jan 24, 2015
Messages
98
For some reason, I get this error:

Code:
/tmp/getcaddy.com                             100% of 7380  B   41 MBps 00m00s
Downloading Caddy for freebsd/amd64 (personal license)...
curl: (3) URL using bad/illegal format or missing URL
Aborted, error 3 in command: curl -fsSL "$caddy_url" -u "$CADDY_ACCOUNT_ID:$CADDY_API_KEY" -o "$dl"


I triple checked the config file I don't see any error (unless there is one):

Code:
DNS_PLUGIN="cloudflare"
DNS_ENV="CLOUDFLARE_EMAIL=my@mydomain.com CLOUDFLARE_API_KEY=123averylongkey"


Any idea?

Also, when you say:

DNS hosting for the domain name needs to be with a provider that Caddy supports, to automatically update the DNS records needed to prove your control over the domain. See the Caddy documentation under the heading of "DNS Providers" for the supported providers, and what information you'll need in order to proceed.

That particular page does not contain anything called DNS Providers.
 

jchamie

Cadet
Joined
Mar 28, 2015
Messages
9
Everything working fine but the nextcloud clients misbehave. The nextcloud client log out (especially after computer has gone to sleep, but sometimes just randomly). This happens on various computers and the user has to manually log in again and go through the login flow v2 process. Once they manually log in again its fine..... for a while anyway, then it logs itself out again after an hour or so.

The nextcloud logs have lots of these kind of entries: Login failed: 'username' (Remote IP: '120.199.24.220')

Is there something wrong with the Caddyfile or a timeout issue... or maybe the modem itself...? Not sure where to start.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Everything working fine but the nextcloud clients misbehave. The nextcloud client log out (especially after computer has gone to sleep, but sometimes just randomly). This happens on various computers and the user has to manually log in again and go through the login flow v2 process. Once they manually log in again its fine..... for a while anyway, then it logs itself out again after an hour or so.

The nextcloud logs have lots of these kind of entries: Login failed: 'username' (Remote IP: '120.199.24.220')

Is there something wrong with the Caddyfile or a timeout issue... or maybe the modem itself...? Not sure where to start.
Seems like you are leaving you Freenas box exposed to the internet without proper firewall nor proxy.
I think someone, either one of your user or simply a complete stranger is trying to gain access to your Nextcloud instance and following the Brute force protection scheme, Nextcloud is causing other users to be disconnected as a result.

It is possible an older client is using an old password or authentication and is causing this behavior.
Just a guess.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Seems like you are leaving you Freenas box exposed to the internet without proper firewall nor proxy.
Exposing the Nextcloud jail (particularly if only ports 80 and 443) wouldn't necessarily be a problem; its configuration should be pretty secure. But nonetheless, a bunch of failed logins could cause problems.
 

ByteNick

Explorer
Joined
Jan 24, 2015
Messages
98
For some reason, I get this error:

Code:
/tmp/getcaddy.com                             100% of 7380  B   41 MBps 00m00s
Downloading Caddy for freebsd/amd64 (personal license)...
curl: (3) URL using bad/illegal format or missing URL
Aborted, error 3 in command: curl -fsSL "$caddy_url" -u "$CADDY_ACCOUNT_ID:$CADDY_API_KEY" -o "$dl"


I triple checked the config file I don't see any error (unless there is one):

Code:
DNS_PLUGIN="cloudflare"
DNS_ENV="CLOUDFLARE_EMAIL=my@mydomain.com CLOUDFLARE_API_KEY=123averylongkey"


Any idea?

Also, when you say:



That particular page does not contain anything called DNS Providers.

getcaddy.com command with the plugins gives an error.
 

jchamie

Cadet
Joined
Mar 28, 2015
Messages
9
Seems like you are leaving you Freenas box exposed to the internet without proper firewall nor proxy.
I think someone, either one of your user or simply a complete stranger is trying to gain access to your Nextcloud instance and following the Brute force protection scheme, Nextcloud is causing other users to be disconnected as a result.

It is possible an older client is using an old password or authentication and is causing this behavior.
Just a guess.
thanks for the tip about the brute force disconnecting other users. Will investigate down that route... the strange thing is that I don't see any multiple failed attempts triggering brute force, what I am seeing is *already logged in users* being bumped out with the message 'Login failed: 'username' (Remote IP: '10.0.1.1') etc etc
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
getcaddy.com command with the plugins gives an error.
I'm not able to duplicate this. Can you try it at the shell in a jail?
Code:
root@slrn:~ # curl https://getcaddy.com | bash -s personal tls.dns.cloudflare
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7380  100  7380    0     0  19319      0 --:--:-- --:--:-- --:--:-- 19319
Downloading Caddy for freebsd/amd64 (personal license)...
Notice: download verification not possible because gpg is not installed
Extracting...
Putting caddy in /usr/local/bin (may require password)
Caddy v1.0.4 (h1:wwuGSkUHo6RZ3oMpeTt7J09WBB87X5o+IZN4dKehcQE=)
Successfully installed
 

ByteNick

Explorer
Joined
Jan 24, 2015
Messages
98
I'm not able to duplicate this. Can you try it at the shell in a jail?
Code:
root@slrn:~ # curl https://getcaddy.com | bash -s personal tls.dns.cloudflare
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7380  100  7380    0     0  19319      0 --:--:-- --:--:-- --:--:-- 19319
Downloading Caddy for freebsd/amd64 (personal license)...
Notice: download verification not possible because gpg is not installed
Extracting...
Putting caddy in /usr/local/bin (may require password)
Caddy v1.0.4 (h1:wwuGSkUHo6RZ3oMpeTt7J09WBB87X5o+IZN4dKehcQE=)
Successfully installed

Manually it works well. Within the script, no (for me, at least).
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Within the script, no (for me, at least).
Just re-ran the script on my test FreeNAS 11.3 machine:
Code:
Building new INDEX files... done.
/tmp/getcaddy.com                                     7380  B 7650 kBps    00s
Downloading Caddy for freebsd/amd64 (personal license)...
Download verification OK
Extracting...
Putting caddy in /usr/local/bin (may require password)
Caddy v1.0.4 (h1:wwuGSkUHo6RZ3oMpeTt7J09WBB87X5o+IZN4dKehcQE=)
Successfully installed

This is using the Cloudflare plugin as well (and yes, I do need to update the link to the docs--they're pushing hard to use the beta version instead). Curious.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
getcaddy.com command with the plugins gives an error.
Not sure if it is the case, but I think it could be related to using an illegal character in the domain name such as underscore (I don't remember if underscore is allowed).
I seem to have had a similar issue in the past.
 

remyb

Cadet
Joined
Feb 12, 2020
Messages
1
Thank you for this script! I just ran it on my 11.3 machine and it worked flawlessly. The only thing I needed to do was make sure my router directed the hostname to the nextcloud IP. Also, your Plex script worked great too!
 
Top