Resource icon

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

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Where can I locate the config/config.php?
I'll start with this one, since it's the easiest--it's in /usr/local/www/nextcloud/. But you shouldn't have to edit it; the trusted_domains setting should have been made properly by the script itself. Do you use mydomain.com to access the installation from the outside, or a different FQDN?

I'm checking on the path-related errors--I haven't seen that behavior before. Unfortunately, I'm going to be off the grid for a little while after tomorrow, so it may be a while before I can get to the bottom of it.
 

mapcevn

Dabbler
Joined
Jul 10, 2019
Messages
40
I found the culprit! It was the way I created the file nextcloud-config
I did not follow exactly what you guided. I used Notepad++ created a text file containing the required contents, removed the extension txt, then uploaded it into the freenas-iocage-nextcloud folder. Then it caused all that sort of hell. Still not sure why it did not work this way.

Finally, I used that ugly nano command to create that file and it works!!!!! I can login the nextcloud account now though there still be an issue with the certificate, but I hope I can sort it out in some ways.

Thank you so much for bringing that awesome script to the world, danb35. Glad to know that you are a lawyer!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
there still be an issue with the certificate, but I hope I can sort it out in some ways.
That's because the script by default uses the Let's Encrypt test server so you don't hit the rate limits. The README on Github describes how to address this once everything is up and running.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
@danb35 I finally got DNS working as I can go to my nginx install of nextcloud from mydomain.sl as ports 80 and 443 are forwarded to that jail. Can I experiment with your script on my system by installing your script into a different jail changing the alias in pfsense from my old nexcloud to the new one? That would change the jail that 80 and 443 forward to.

Also I forked you script a while ago and would like to sync your current master branch to a branch on my GitHub called caddy. Any idea on how I can have your updated script on my GitHub without losing my current master? I've looked at a lot of tutorials but still can't get it working. Sorry it this is off topic
 
Joined
May 22, 2019
Messages
5
I managed to solve the problem. I changed my SSL setting from flexible to full in cloudflare and now the redirects have stopped and nextcloud is up and running. Thank you danb35 for your help. I'm sorry for bothering you with something that ended up not really being relevant to your script.

Thank you for replying back with your solution. I had the same issue and you helped me resolve it!
 

plague

Dabbler
Joined
Jul 20, 2017
Messages
18
Hey Dan, are there instructions on how to safely update NextCloud to a new version? Do I simply have to stop the process, upgrade the package, and restart the service?
 

Yakje

Explorer
Joined
Feb 8, 2017
Messages
82
Double-NAT is going to be problematic, and I'm not sure that I have much in the way of advice. You're going to need to forward ports 80 and 443 from your first router to your intermediate router, and from there to ports 80 and 443 on the jail. You don't necessarily need to use 80 and 443 on the intermediate router--you could, for example, forward 80/443 in the first to 8080/8443 on the second, and from there to 80/443 on the jail.

Thanks for ur help Dan! I reconfigured the port forwards and ran ur awesome script again, removed the line in the caddy config and it worked! Love ur script!!
 

mapcevn

Dabbler
Joined
Jul 10, 2019
Messages
40
That's because the script by default uses the Let's Encrypt test server so you don't hit the rate limits. The README on Github describes how to address this once everything is up and running.
Excellent! It works flawlessly for me!
Thank you, Dan.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
are there instructions on how to safely update NextCloud to a new version?
You should just be able to use the built-in updater.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
\
Hey Dan, are there instructions on how to safely update NextCloud to a new version? Do I simply have to stop the process, upgrade the package, and restart the service?
The built in updater has never worked for me. So I run in the jail
Code:
pkg install sudo php72-phar
sudo -u www php /usr/local/www/nextcloud/updater/updater.phar
 

mapcevn

Dabbler
Joined
Jul 10, 2019
Messages
40
Hi Dan,
I want to change my domain from mydomain.com to my subdomain at nextcloud.mydomain.com. How would I do this?
 

MZRR

Cadet
Joined
Jul 7, 2019
Messages
7
I'm also seeing an error about a missing DNS plugin
Can you pleas explain of how to add a DNS provider as an plugin for Caddy for a running nextcloud jail?

I somehow messed up the scripted installation and don't see a DNS plugin when running caddy -plugins. The DNS provider credentials and API is added in the CaddyFile.


Thanks!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
From inside the jail, you'd run curl https://getcaddy.com | bash -s personal tls.dns.cloudflare (substituting or adding whichever plugin(s) you wanted).
 

sheenegarmi

Dabbler
Joined
Jul 26, 2019
Messages
18
tell me what to do on my teamtell me what to do on my team gives that does not know such a command what should I do
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
tell me what to do on my team
No idea. Please try again, with a clear explanation of what you're trying to accomplish, how you're doing it, and what the result is.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You should not be creating a Nextcloud jail; the script does that for you. You download the script from the FreeNAS shell and run it from there.
 

sheenegarmi

Dabbler
Joined
Jul 26, 2019
Messages
18
good evening. I installed the script, it was installed. I filled out the nextcloud-config config with the instructions, as shown in the example. BUT filling in their data. JAIL_IP, POOL_PATH, TIME_ZONE, HOST_NAM, CERT_EMAIL. And run the script nextcloud-jail.sh. JAIL was installed but go over IP or HOST NAM. I can not do it.

I did not understand the current that I need to choose here STANDALONE_CERT = 1

what i did wrong.
 
Last edited:

matttheew

Dabbler
Joined
Apr 30, 2017
Messages
14
Hello, I am running into trouble getting this script to work. (I'm the same person from the issues post on github)

I ran through the script, everything returned as a success.

CloudFlare shows my site as offline, and browsing out to the local IP shows the site refused to connect. Running a port scan on the local IP doesn't show a webserver listening for ports. I deleted the jail after it failed, and removed the last 3 lines from the below config and instead changed the POOL_PATH to /mnt/NAS-pool/nextCloud" to see if it was complicating things, but I get the same result each time I've run this.

My redacted install config:

JAIL_IP="192.168.0.3"
DEFAULT_GW_IP="192.168.0.1"
POOL_PATH="/mnt/NAS-pool"
TIME_ZONE="America/New_York"
HOST_NAME="XXXXX"
DNS_CERT=1
CERT_EMAIL="XXXXXX@gmail.com"
DNS_PLUGIN="cloudflare"
DNS_ENV="CLOUDFLARE_EMAIL=XXXXX@gmail.comCLOUDFLARE_API_KEY=XXXXXXXXXXX"
DB_PATH="$POOL_PATH/nextCloud/db"
FILES_PATH="$POOL_PATH/nextCloud/files"
PORTS_PATH="$POOL_PATH/nextCloud/portsnap"


Running FreeNAS 11.2-U4.1


Once I switch my router port forwarding back to my old warden nextcloud jail, things are working. This at least confirms my CloudFlare DNS is configured to point to my server properly.

Any suggestions?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'd guess that caddy isn't running in the jail, which probably means it had trouble obtaining a cert. There's a missing space in the DNS_ENV line that you posted; if that's in the original (rather than an artifact of your redacting it for posting), that would explain the problem.

Try iocage console nextcloud, followed by service caddy status. If it isn't running, see if /var/log/caddy.log has any useful information in it.
 
Top