diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index c64e3b48a..86b2e519e 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 2.2 +PLUGIN_VERSION= 2.3 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index b559755f7..ef9766b16 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,15 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +2.3 + +Added: +* add support for Infomaniak domain API (#2169) + +Fixed: +* fix "auto renewal" options not working in certificate and plugin settings (#2178) +* fix Aliyun DNS API (#2200) + 2.2 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml index 0fd183462..e387fc786 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml @@ -7,7 +7,7 @@ certificate.enabled checkbox - Enable this certificate + Enable this certificate. When disabled, no attemps to issue or renew the certificate will be made. certificate.name @@ -50,7 +50,7 @@ certificate.autoRenewal checkbox - Enable automatic renewal for this certificate to prevent expiration. + Enable automatic renewal for this certificate to prevent expiration. When disabled, the cron job will ignore this certificate. Note that it is still possible to renew the certificate from the GUI. certificate.renewInterval diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index e6999e3a9..2bc5df97d 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1237,4 +1237,14 @@ password + + + header + + + + validation.dns_infomaniak_token + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml index 28cee3b6c..ad0247d9e 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml @@ -9,7 +9,7 @@ acmeclient.settings.autoRenewal checkbox - + acmeclient.settings.environment diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index 20ca63447..8e0be409e 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -1,7 +1,7 @@ uuid = $uuid; $this->force = $force; + $this->cron = $cron; // Get config object $this->loadConfig(self::CONFIG_PATH, $this->uuid); @@ -318,13 +321,13 @@ class LeCertificate extends LeCommon // Issue or renew? if (!empty((string)$this->config->lastUpdate) and !($this->force)) { - $acme_action = "renew"; + $acme_action = 'renew'; $renew = true; } else { // Default: Issue a new certificate. // If "force" is specified, forcefully re-issue the cert, no matter if it's required. // NOTE: This is useful when switching from acme staging to production servers. - $acme_action = "issue"; + $acme_action = 'issue'; $renew = false; } @@ -334,6 +337,19 @@ class LeCertificate extends LeCommon LeUtils::log("issue/renewal not required for certificate: " . (string)$this->config->name); return false; } + + // Get auto renewal plugin setting. + $configObj = Config::getInstance()->object(); + $auto_renewal = $configObj->OPNsense->AcmeClient->settings->autoRenewal; + + // Check if called by auto renewal process. + if (($acme_action == 'renew') and ($this->cron == 1) and ($auto_renewal == 0)) { + LeUtils::log('auto renewal is globally disabled, skipping certificate: ' . (string)$this->config->name); + return false; + } elseif (($acme_action == 'renew') and ($this->cron == 1) and ((string)$this->config->autoRenewal == 0)) { + LeUtils::log('auto renewal is disabled for certificate: ' . (string)$this->config->name); + return false; + } LeUtils::log("${acme_action} certificate: " . (string)$this->config->name); // Ensure that account is registered. diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php index 3ae1da021..c3ae40817 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -1,7 +1,7 @@ acme_env['Ali_Key'] = (string)$this->config->dns_ali_key; - $this->acme_env['Ali_Secret'] = (string)$this->config->dns_ali_key; + $this->acme_env['Ali_Secret'] = (string)$this->config->dns_ali_secret; } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfomaniak.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfomaniak.php new file mode 100644 index 000000000..6fec5ea62 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfomaniak.php @@ -0,0 +1,44 @@ +acme_env['INFOMANIAK_API_TOKEN'] = (string)$this->config->dns_infomaniak_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 02722c751..edbcfdfcd 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -405,6 +405,7 @@ hosting.de API Hurricane Electric Infoblox API + Infomaniak API INWX XMLRPC API ISPConfig 3.1+ API Joker API @@ -949,6 +950,9 @@ N + + N + diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php index 3b3d61bda..3558d44dc 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php @@ -2,7 +2,7 @@ certificates->children() as $certCfg) { $cert_uuid = (string)$certCfg->attributes()['uuid']; - $cert = new LeCertificate($cert_uuid, $force); + $cert = new LeCertificate($cert_uuid, $force, $cron); // NOTE: Disabled certificates are automatically ignored by LeCertificate. $cert->issue(); } diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 1b9069640..81a14363b 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -78,7 +78,7 @@ type:script message:running automations for a certificate [cron-auto-renew] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --all +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --all --cron parameters: type:script message:cronjob running to sign or renew certificates