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

Permissions Issue #147

Closed arthertm closed 3 years ago

arthertm commented 3 years ago

Firstly thank for your work on this Dan, used this flawlessly in the past without issue.

Just updated to Truenas 12 and used script but fails with permission errors around the cron task to renew cert. It states failed so i assume that come Jan my certificate will expire.

Messages from install were: -

crontab: /mnt/includes/www-crontab: Permission denied Command: crontab /mnt/includes/www-crontab failed!

Same script has worked fine on Freenas 11.3 U5. I did a fresh install of TrueNAS however same outcome.

Output of iocage exec nextcloud crontab -u www -l

/5 * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

Appreciate any help.

thanks

arthertm commented 3 years ago

Dan, I appreciate your time is likely pulled in all directions and you invest allot of time on this work - I could really do with some guidance as my certificate with Let's Encrypt expires in Jan and with the errors I believe the cron task to renew failed. Not overly familiar on this but your script has worked a charm for a few years. Anything you need from me to help diagnose etc, please just say.

danb35 commented 3 years ago

with permission errors around the cron task to renew cert.

What are those errors? The stuff you listed has nothing to do with the cert, and if your installation is from any time in the last 18 months, cron has nothing to do with certificate renewal.

arthertm commented 3 years ago

Dan, thank you for the swift response, appreciated. I am confused and without doubt due to my limited knowledge. My install was in Nov so does use recent script. So have, perhaps incorrectly, misinterpreted the crontab failed message during install as meaning the cron task for the renewal of the Lets Encrypt failed, that the cert would not renew? My cert currently expires 23rd Jan and was under the impression, previously, renewals happened by now? If I have got all this wrong my sincere apologies and I'll amend all this accordingly - is there a way to test that the cert renewal is set up to work correctly?

danb35 commented 3 years ago

I'm not sure what the error message indicates, but it seems the cron job is created properly--but that's for Nextcloud's own maintenance tasks, running every five minutes. It doesn't have anything to do with cert issuance or renewal (with installations prior to May 2019, that would have been handled by a cron job, but it would be a job for acme.sh).

Caddy ordinarily attempts to renew a cert when it expires in less than 30 days, so you shouldn't expect to see a renewal until 24 Dec. But if you don't see a renewed cert by 25 Dec, post the output of tail /var/log/caddy.log and I'll see if I can figure out where the problem is.

arthertm commented 3 years ago

Thank you Dan and apologies for my ignorance. Will advise on the renewal. If ok, I'll then close this report. Really appreciate the time and effort you've put into this. A big thank you.