Resource icon

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

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
I think the following means no.
1574010337456.png

I don't recall any email field. Where would that go?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I don't recall any email field. Where would that go?
It should have gone in the nextcloud-config file, though apparently I haven't yet updated the script to require it to be set. You need to give Caddy an email address, which Let's Encrypt will use to contact you in the event your cert is about to expire (which shouldn't happen), or if they otherwise need to reach you (which would be very unusual). In the jail, run sysrc caddy_cert_email="you@yourdomain.com" followed by service caddy start.
 

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
It should have gone in the nextcloud-config file, though apparently I haven't yet updated the script to require it to be set. You need to give Caddy an email address, which Let's Encrypt will use to contact you in the event your cert is about to expire (which shouldn't happen), or if they otherwise need to reach you (which would be very unusual). In the jail, run sysrc caddy_cert_email="you@yourdomain.com" followed by service caddy start.

Breakthrough! Thanks. I can bring up the site. It will not authenticate with a local IP with a 404 message to that effect (as expected). It will give access through the domain name but it considers it unsafe with NET::ERR_CERT_AUTHORITY_INVALID. (partially expected)
Should I do the following to clear that up?
acme.sh --upgrade acme.sh --cron
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
NET::ERR_CERT_AUTHORITY_INVALID. (partially expected)
Should have been completely expected, as the script tells you about this when it finishes--it obtains certs from the Let's Encrypt staging server by default, to avoid you exceeding their rate limits while you're testing things out. There's a script in the jail that should change the Caddyfile to obtain the cert from the production server instead; run /root/remove-staging.sh in the jail to do that.

Don't try anything with acme.sh; that hasn't been part of the jail since I started using Caddy (when NC16 was released).

Edit: See also https://github.com/danb35/freenas-iocage-nextcloud/issues/74#issuecomment-554800584 --if you're having trouble getting Caddy to restart after running the remove-staging script, you may need to make some further edits to the Caddyfile as noted there.
 
Last edited:

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
Should have been completely expected, as the script tells you about this when it finishes--it obtains certs from the Let's Encrypt staging server by default, to avoid you exceeding their rate limits while you're testing things out. There's a script in the jail that should change the Caddyfile to obtain the cert from the production server instead; run /root/remove-staging.sh in the jail to do that.

Don't try anything with acme.sh; that hasn't been part of the jail since I started using Caddy (when NC16 was released).

Edit: See also https://github.com/danb35/freenas-iocage-nextcloud/issues/74#issuecomment-554800584 --if you're having trouble getting Caddy to restart after running the remove-staging script, you may need to make some further edits to the Caddyfile as noted there.

Thanks. I needed to remove the TLS section too. I got it to work (access via domain name) and started setting things up within the Nextcloud admin screens. Then I needed an smbclient. Per last instructions I saw on the thread, I ran
Code:
pkg install php72-pecl-smbclient
. I chose yes on every question (perhaps a bit foolhardy). Restarted the jail and now I am back to blank page. Caddy status shows it is running and the Caddy log says that it is having a TLS handshake errors while attempting certificate maintenance. What should I have done to correctly install the smbclient package?
 

tobiasbp

Patron
Joined
Dec 2, 2015
Messages
238
Code:
Starting php_fpm.
/usr/local/sbin/php-fpm: Undefined symbol “setproctitle_fast@FBSD_1.5”

Were you able to resolve the php-fpm issue above? I have the same error in an iocage jail as seen below:
Code:
root@mediawiki-plugin:/usr/local/etc # service php-fpm start
Performing sanity check on php-fpm configuration:
[18-Nov-2019 09:16:54] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
/usr/local/sbin/php-fpm: Undefined symbol "setproctitle_fast@FBSD_1.5"
[18-Nov-2019 09:16:54] ERROR: no data have been read from pipe
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm


Further testing shows that these packages leaves me with at working php-fpm:
mediawiki133-php71
mediawiki133-php72

And, these will not be able to launch php-fpm after install (Undefined symbol "setproctitle_fast@FBSD_1.5"):
mediawiki133-php73
mediawiki133-php74

Should this be reported somewhere?
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Were you able to resolve the php-fpm issue above?
That issue is resolved in the latest version of the script by building php 7.3 from ports.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
What should I have done to correctly install the smbclient package?
My first guess would be to install the appropriate version to match the PHP version that's installed, so you'd do pkg install php73-pecl-smbclient.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
That issue is resolved in the latest version of the script by building php 7.3 from ports.
My Nextcloud isn't built using the script, but I've pkg upgraded and hit the same php-fpm issue, in that it won't run with the following error:

Code:
Starting php_fpm.
/usr/local/sbin/php-fpm: Undefined symbol "setproctitle_fast@FBSD_1.5"
[18-Nov-2019 11:23:20] ERROR: no data have been read from pipe
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm


I'm running things in an 11.2 jail with PHP7.3 so wondering how you got things working in the script?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
cd /usr/ports/lang/php73; make clean reinstall BATCH=yes
Thanks! I've rolled back for now but will give this another go when I have a spare hour.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Should this be reported somewhere?
No, it's completely expected behavior, and has been discussed quite a bit in the last page or two of posts on this thread. iX can't get a new release of FreeNAS out before its current version is EOL. This results in ports not building and packages being broken. Sometimes there are workarounds that can be used, which I've done in the script; sometimes you just need to wait until you can build a jail with the current FreeBSD release.
 

tobiasbp

Patron
Joined
Dec 2, 2015
Messages
238
No, it's completely expected behavior, and has been discussed quite a bit in the last page or two of posts on this thread. iX can't get a new release of FreeNAS out before its current version is EOL.

OK. Thanks for clarifying.
 

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
My first guess would be to install the appropriate version to match the PHP version that's installed, so you'd do pkg install php73-pecl-smbclient.
That worked to take me to the next step. The ability to add a SMB/CIFS external storage is available now. However, the configuration I try entering and relevant experimental variations seems to all end up with a red circle with a exclamation mark that does not tell me a thing. I am looking for any clue what may be missing. The only thing that seems to be a clue is I try to run smbclient -L {hostname} in the jail and get an error regarding the inability to load an nonexistant smb4.conf file. I am a Samba newbe and so don't know where to go from here. I don't know the service name for samba either. The FreeNAS shell shows sambs_server in services. This round of install has been among the hardest which leads me to think I must have messed up somewhere. Any help would be greatly appreciated.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Thanks! I've rolled back for now but will give this another go when I have a spare hour.

Yep, that seems to work fine (I needed to include ALLOW_UNSUPPORTED_SYSTEM=yes) although I might just leave this alone now on 17.0.1 until FreeNAS catches up to FreeBSD
 
Last edited:

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
So I have been experimenting trying to get the SMB sharing to work for External Storage shares in Nextcloud. It keeps giving me red circle exclamation marks with no error explanation on the tooltip nor in the messages. The experimenting is producing strange results. I am looking at this point to do any external storage connections. Here are the results:
FTP with credentials: Works
WebDAV with credentials: Fails with stat() error message.
Local: Works with some folders but not others and on some that it does not work it fails with stat() error message. Not sure of the security here.
SMB/CIFS: Does not work with any type of share which share that works on Windows. It also has no error message in log.

Given that Nextcloud is intended to share local network shares in the cloud, how are you able to successfully create external storage shares? Do you end up setting up Mount points on the jail and then share those locally?
Version info:
FreeNAS v11.2-U6
Nextcloud 17 with @danb35 script
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Given that Nextcloud is intended to share local network shares in the cloud
I don't think this is a correct statement of what Nextcloud is intended to do. It's intended to share files in the cloud. At its core, it's intended to be the only mechanism by which those files are shared--that's why you need things like the smbclient app or the external_files app to (somewhat) deal with files that are also shared in other ways.
 

notspam

Dabbler
Joined
Nov 10, 2019
Messages
26
Well, after a long journey that felt like three weeks but has only been two that involved many false starts, and redos, and reinstalls, and lots of queries on forums and threads, and lots of google searches, and helpful recommendations from several folks, and even an exchange with a less-than-helpful individual, I have managed to get Nextcloud working with the script here and SMB shares. I could share the entire journey but I would lose your attention (if I have not already). For the few of you who, like me, are trying to get SMB external shares to work on Nextcloud, here is the solution to make the final steps work for at least the following versions:
FreeNAS: 11.2-U7 (maybe U6 too)
NextCloud: 17.0.1
  1. Install the jail using @danb35 script featured in this forum following his directions given.
  2. Install the appropriate php smbclient version from within a shell in the jail. At this time it is pkg install php73-pecl-smbclient
  3. This one may or may not be needed, but due to the discontinuing of SMB1 the instructions here on Nextcloud site were helpful for some. It did not completely solve my issue, but I think it put another piece together. In our case the smb.conf file to add/edit is at /usr/local/etc/smb[B]4[/B].conf within the nextcloud jail.
  4. This is the main one. There is a bug in one of the php files on Nextcloud that broke the SMB configuration. Until they fix it and produce an update, the instructions to fix it are here again on the Nextcloud site. In our install, the file is located at /usr/local/www/nextcloud/apps/files_external/lib/Lib/Backend/SMB.php within the nextcloud jail.
This is notspam signing off.
 
Last edited:

exodus454

Dabbler
Joined
Nov 24, 2019
Messages
14
I've been trying for the last few weeks to get nextcloud up and running. I've tried wiping and reinstalling several times. Right now it's accessible via OCC and I can get it to do database maintenance through it but any attempts through a web browser give redirect errors. wget shows it's redirected to https and then just keeps looping 302.
 

leonbusch

Cadet
Joined
Oct 24, 2019
Messages
8
Hey!
Thanks at first for the beautiful script. Was trying to get it working for quite a while now.
But I did the installation and everything seems to work fine as long as I am not in my own network. I think is has to do something with the configuration of the DNS.
The error I am getting trying to connect via the local IP-Adress is:
Code:
404 Site 192.168.178.7 is not served on this interface

As what I know that is normal. But as I said, connecting with my domain does not work. I am always directed to my router, regardless of the port number.
I have a FritzBox with updates its IP to duckDNS. I was not able to figure out a way for duckDNS to point directly to Nextcloud... Does anyone have a keyword for what to search for?

EDIT: Everything is good now. Just had to edit the /etc/hosts file. If anyone else has got the same problem, just add your ip and website to the end of the file.
 
Last edited:
Top