TrueNAS deploy Scipt for acme.sh

Lapheus

Cadet
Joined
Jan 29, 2021
Messages
6
Hello,

I have rewritten the script deploy_freenas.py from danb35 for direct use as deployhook scipt in acme.sh.

You can see my fork from acme.sh at F-Plass/acme.sh.
I have open a Pull request to integrate it into the official acme.sh
  • Authentification with API Key
  • default to "localhost", with option to "Truenas-IP" or "Truenas-DNS-Name"
  • If HTTP redirect is configured on TrueNAS, automatik switch to HTTPS
  • If WebDAV Certificate is the same as Web UI Certificate, Webdav Certificate will be updated
  • If FTP Certificate is the same as Web UI Certificate, FTP Certificate will be updated
Thanks to danb35 for his script, I could use it as a template.
 

Scoot_Mulner

Dabbler
Joined
Aug 20, 2013
Messages
12
Hi @Lapheus,

Thanks for getting this into the official acme.sh program!

I just tried to use it and got an error message. The script works (the certificates have all been updated) but it throws an error:

Code:
# export HOME=/root; export DEPLOY_TRUENAS_APIKEY=<***KEY***>; export DEPLOY_TRUENAS_SCHEME="https"; export DEPLOY_TRUENAS_HOSTNAME="nas01.example.com"; /root/.acme.sh/acme.sh --cron --deploy -d nas01.example.com --deploy-hook truenas --ecc

[Tue Jun 21 16:39:53 EDT 2022] Testing Connection TrueNAS
[Tue Jun 21 16:39:53 EDT 2022] TrueNAS System State: "READY".
[Tue Jun 21 16:39:53 EDT 2022] Getting active certificate from TrueNAS
[Tue Jun 21 16:39:53 EDT 2022] Upload new certifikate to TrueNAS
[Tue Jun 21 16:39:53 EDT 2022] Getting Certificate list to get new Cert ID
[Tue Jun 21 16:39:53 EDT 2022] Activate Certificate ID: 6
[Tue Jun 21 16:39:54 EDT 2022] Check if WebDAV certificate is the same as the WEB UI
[Tue Jun 21 16:39:54 EDT 2022] Update the WebDAV Certificate
/root/.acme.sh/deploy/truenas.sh: line 129: [: : integer expression expected
[Tue Jun 21 16:39:56 EDT 2022] Unable to set WebDAV certificate
[Tue Jun 21 16:39:56 EDT 2022] Error deploy for domain:nas01.example.com
[Tue Jun 21 16:39:56 EDT 2022] Deploy error.


I do have Webdav running with https using the same LetsEncrypt certificate as the WebUI.

Since the certificates are getting updated still, this might not be a big deal.
 
Top