security/acme-client: add support for Cloudflare Zone ID, closes #2973

This commit is contained in:
Frank Wall
2022-07-27 15:55:20 +02:00
parent ecbf0bfafa
commit 6d5604e406
4 changed files with 14 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@ Plugin Changelog
Added:
* Add Simply.com DNS API (#2888)
* Add Active24 challenge type (#3049)
* Add support for Zone ID in Cloudflare challenge type (#2973)
Fixed:
* Re-order function parameters due to PHP8 deprecation notice (#3043)
@@ -263,6 +263,12 @@
<type>password</type>
<help>The token needs "Read" access to Zone.Zone and "Edit" access to Zone.DNS across all zones from an account.</help>
</field>
<field>
<id>validation.dns_cf_zone_id</id>
<label>CF Zone ID (Optional)</label>
<type>text</type>
<help>Note that specifying a Zone ID will limit this configuration to a single domain.</help>
</field>
<field>
<label>ClouDNS</label>
<type>header</type>
@@ -45,5 +45,9 @@ class DnsCf extends Base implements LeValidationInterface
// Restricted API token (recommended)
$this->acme_env['CF_Token'] = (string)$this->config->dns_cf_token;
$this->acme_env['CF_Account_ID'] = (string)$this->config->dns_cf_account_id;
// Optional Zone ID
if (!empty((string)$this->config->dns_cf_zone_id)) {
$this->acme_env['CF_Zone_ID'] = (string)$this->config->dns_cf_zone_id;
}
}
}
@@ -560,6 +560,9 @@
<dns_cf_account_id type="TextField">
<Required>N</Required>
</dns_cf_account_id>
<dns_cf_zone_id type="TextField">
<Required>N</Required>
</dns_cf_zone_id>
<dns_cloudns_auth_id type="TextField">
<Required>N</Required>
</dns_cloudns_auth_id>