New Plugins for FreeNAS 9 (November 2016) - Nextcloud / Madsonic / Resilio / NZBHydra

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I think this should work to update the nextcloud plugin
Code:
fetch "https://download.nextcloud.com/server/releases/nextcloud-10.0.2.tar.bz2"
mv /usr/pbi/nextcloud-amd64/www/nextcloud ./nextcloud-bak
tar jxf nextcloud-*.tar.bz2 -C /usr/pbi/nextcloud-amd64/www
cp ./nextcloud-bak/config/config.php /usr/pbi/nextcloud-amd64/www/nextcloud/config
chown -R www:www /usr/pbi/nextcloud-amd64/www/nextcloud
su -m www -c '/usr/pbi/nextcloud-amd64/bin/php /usr/pbi/nextcloud-amd64/www/nextcloud/occ upgrade'
rm -r nextcloud-*.tar.bz2 nextcloud-bak
 

jag131990

Explorer
Joined
Dec 2, 2016
Messages
68
The link I referred to IS the official upgrade how-to except thigns are a bit different inside a plugin apparently, hence I have asked here, where the plugin originated and not in the NextCloud forums where they know nothing about FreeNAS plugins :)
So you have. My apologies. Interested to know how you get on, we will all be looking to try to update. I recall the next cloud developers stating that they were going to make updating incredibly simple and automatic after they forked from owncloud. It's probably not viable when there are so many unique ways to install the instance
 

jag131990

Explorer
Joined
Dec 2, 2016
Messages
68
I just tried the updater via the next cloud admin interface. I can confirm it all worked perfectly via the web interface and I am now on the latest.
 

jag131990

Explorer
Joined
Dec 2, 2016
Messages
68
I just tried the updater via the next cloud admin interface. I can confirm it all worked perfectly via the web interface and I am now on the latest.
Also note when you do the updater it will ask you if want to disable maintenance mode, you will want to pick the option that says 'im using the web ui'
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Thanks Joshua, that looks like a conversion of the manual update instructions into freenas-plugin-speak :smile: Thanks for that.

@jag131990: thanks for mentioning the web updater, I must say this is not very intuitive: I log into NExtCLoud, get a notification about an update, click the notification and end up on the manual update instructions page. After you mentioned the web updater I went to look for it, found it, worked perfectly.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Its been a long time since I worked with apache and switched to nginx. It took me some time but I figured it out. I couldn'T find any virtualhosts directive, nor was I sure which config file dealt only with nextcloud and port 80 so I placed my redirect into my .htaccess file.

from INSIDE the nextcloud jail, edit: /usr/pbi/nextcloud-amd64/www/nextcloud/.htaccess and find this section:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

and modify to look like this:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on

RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e.  http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context

  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

advice found here: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
This will redirect all request from HTTP to HTTPS.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Its been a long time since I worked with apache and switched to nginx. It took me some time but I figured it out. I couldn'T find any virtualhosts directive, nor was I sure which config file dealt only with nextcloud and port 80 so I placed my redirect into my .htaccess file.

from INSIDE the nextcloud jail, edit: /usr/pbi/nextcloud-amd64/www/nextcloud/.htaccess and find this section:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

and modify to look like this:
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on

RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e.  http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context

  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

advice found here: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
This will redirect all request from HTTP to HTTPS.
I dont recommend you edit that file, doesnt nextcloud check it in its file verification and complain?
I believe you could do the same in /usr/pbi/nextcloud-amd64/etc/apache24/Includes/nextcloud.conf

also sothing to consider if there is even a need to have http exposed to the internet? just only open a port for 443
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
I dont recommend you edit that file, doesnt nextcloud check it in its file verification and complain?
it didn't complain.
also something to consider if there is even a need to have http exposed to the internet? just only open a port for 443
- I had a very blonde moment :-( I actually only redirect to port 443 from externally and even use a different external port.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
it didn't complain.
- I had a very blonde moment :-( I actually only redirect to port 443 from externally and even use a different external port.
ahh, maybe it does run the verification automatically. maybe if you ran it, it would start complaining lol.
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
@Joshua Parker Ruehlig are you planning on keeping this plugin updated long-term? I just noticed this notification which indicates there is a version 11 out now.

You are running PHP 5.5. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
@Joshua Parker Ruehlig are you planning on keeping this plugin updated long-term? I just noticed this notification which indicates there is a version 11 out now.
im can't guarantee that I can build v11+ of the nextcloud plugin. the build environment I'm using is from 2014 because that is the latest ports tree that supports PBI building. I'll try to add php56 to it but it might be difficult/time consuming.

i'll try at some point but, if you want the latest nextcloud now I suggest you install nextcloud manually or with the package
 

dredhorse

Dabbler
Joined
Jan 6, 2017
Messages
13
just installed madsonic and I think I ran into an issue... the jail is using 192.168.180.1 as IP... unfortunatly that is my DGW :-(

Any idea on how to fix this? I'm new to FreeBSD and FreeNAS, I know my way around Linux and Debian... and some other stuff.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
just installed madsonic and I think I ran into an issue... the jail is using 192.168.180.1 as IP... unfortunatly that is my DGW :-(

Any idea on how to fix this? I'm new to FreeBSD and FreeNAS, I know my way around Linux and Debian... and some other stuff.
This issue is not specific to these plugins and has to do with your jails configuration.

You can configure existing jail's IPs on the Jails tab, and the IP for automatically configured jails on the Jails > Configuration tab.
 

dredhorse

Dabbler
Joined
Jan 6, 2017
Messages
13
This issue is not specific to these plugins and has to do with your jails configuration.

You can configure existing jail's IPs on the Jails tab, and the IP for automatically configured jails on the Jails > Configuration tab.
thanks for the pointer, I didn't see that in the documentation in that way. I also would expect that the values entered in the default config would at least do some sanity check. Will make an enhancement report for that.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Does anyone managed to manually update the nextcloud plugin to v12?
i don't think anyone even got v11 working since it is not possible to update the PHP version the plugin uses.

if you want version 12, you should install nextcloud from source, or package/ports
 
Status
Not open for further replies.
Top