danb35 / freenas-iocage-nextcloud

Script to create an iocage jail on FreeNAS for the latest Nextcloud 28 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt
GNU General Public License v3.0
258 stars 70 forks source link

How to update config #136

Closed hidefandy closed 3 years ago

hidefandy commented 4 years ago

Hi,

This works well noting it should be me obviouse that you can't install nexcloud beforehand. It seems obviouse but I reached this solution after and I have been using Nextcloud for some time.

It would be nice to have thsi update an existconfig but i doubt that is workable.

In the meantime, is it possible to update settings post install?

I changed the ip via the jail and the config file but it breaks Nextcloud.

How to update:

  1. Nextcloud IP
  2. Public domain
  3. DDNS provider
  4. anything else from the intial "nextcloud-config" file

Also add internal nexcloud management port or path or add install via the plugin so this can be updated at will.

Ie freenas.local.freenas:port or freenas.local.freenas/nextcloud

danb35 commented 4 years ago

It would be nice to have thsi update an existconfig but i doubt that is workable.

It will install over an existing installation, though I'd recommend updating that installation to the most current version first. Then take all the data--the config, the database, any themes, and all the data files--and put them in appropriate directories in your pool, which you'll then specify in nextcloud-config. Then run the script. It should pick up the existing installation and install over it, retaining all your users, files, and other settings.

Also add internal nexcloud management port or path or add install via the plugin so this can be updated at will.

Unless you're going to code it and give a PR, not going to happen.

Nextcloud IP

Whether internal or external, if you're using TLS for your installation, you shouldn't need to do anything--nothing in my installation uses an IP address unless you're running without TLS. If that is the case, you'd need to update it in the Caddyfile and in Nextcloud's config.php (in the trusted domains section)

Public domain

Edit the Caddyfile and several places in config.php.

DDNS provider

This installation has nothing to do with a DDNS provider, and I can't see anything that would need to be updated in anything it does

anything else from the intial "nextcloud-config" file

It would need to be updated in the appropriate places.

hidefandy commented 4 years ago

Ok thanks

Just one Important thing. Where is the Caddyfile?

I figured that would need to be updated.

I ran a searches in root and nextcloud jail but failed to find it. I expected to see it in /user/local/www or bin?

Out of interest, have you tried using Traefik as I would like to expose freenas and maybe other services over https.

Can I add these with caddy? Obviously I have zero experience with it.

Sorry very new to this and have spent significant time and only making small progress testing various configurations.

danb35 commented 4 years ago

Just one Important thing. Where is the Caddyfile?

Assuming your current installation is using Caddy as the web server and it was installed using my script, it would be in /usr/local/www. If your current installation didn't use my script, it may not use Caddy, or the file may be somewhere else.

Out of interest, have you tried using Traefik as I would like to expose freenas and maybe other services over https.

I know of Traefik, but I haven't used it. I have used Caddy as a reverse proxy, and have a resource about that on the FreeNAS forums, but I'm still updating it for Caddy v2. You can follow it on https://github.com/danb35/freenas-iocage-caddy if you like. But I still wouldn't recommend exposing the FreeNAS GUI to the world.

hidefandy commented 4 years ago

Hi again,

Let me now if I can/should take this offline?

I could not run the script with a nextcloud plugin/jail installed (stopped). Message - Jail:nexcloud already exits!. Please adise how this can be done per above comment.

In lieu, I did a fresh install of freenas and ran the script.

nextcloud-config/ JAIL_IP="192.168.1.198" DEFAULT_GW_IP="192.168.1.1" POOL_PATH="/mnt/tank" TIME_ZONE="Australia/Melbourne" HOST_NAME="my.tld" STANDALONE_CERT=1 CERT_EMAIL="me@outlook.com"

The script failed at some point after successfully added mount to nextclod's fstab.

I will need to try agian as it worked orignally. Does anything look incorrect above?

Does caddy install when STANDALONE_CERT=1 is set for HTTP validation?

If caddy does not install for HTTP validation, where do I change: DEFAULT_GW_IP="192.168.1.1" or HOST_NAME="my.tld" if and when required.

Caddy is still not present here: /usr/local/www = re below.

Last login: Tue Aug 4 02:17:11 on pts/12 FreeBSD 11.3-RELEASE-p11 (FreeNAS.amd64) #0 r325575+fb17f3e15b8(HEAD): Wed Jul 22 10:28:42 EDT 2020

    FreeNAS (c) 2009-2020, The FreeNAS Development Team
    All rights reserved.
    FreeNAS is released under the modified BSD license.

    For more information, documentation, help or support, go here:
    http://freenas.org

Welcome to FreeNAS

Warning: settings changed through the CLI are not written to the configuration database and will be reset on reboot.

root@freenasdell[~]# cd /usr/local/www root@freenasdell[/usr/local/www]# ls apache24 freenasUI nginx-dist webui dojo nginx swagger-ui root@freenasdell[/usr/local/www]#

danb35 commented 4 years ago

Let me now if I can/should take this offline?

I don't think offline necessarily, but the forum thread would probably be a better place to continue the discussion: https://www.ixsystems.com/community/threads/scripted-installation-of-nextcloud-19-in-iocage-jail.62485/

But the script has installed Caddy for over a year now. The current version, as of a couple of days ago, has started using Caddy v2--that's true regardless of how (or whether) you obtain the cert.