security/acme-client: add support for ConoHa DNS API

This commit is contained in:
Frank Wall
2024-01-11 00:27:39 +01:00
parent 2ce4b5ca38
commit 2b8c1f6679
4 changed files with 86 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ full backup and include /var/etc/acme-client.
Added:
* add Aurora DNS API
* add ConoHa DNS API
Changed:
* use a dedicated acme.sh runtime directory for every cert (#3127)
@@ -1717,4 +1717,29 @@
<label>Secret</label>
<type>password</type>
</field>
<field>
<label>ConoHa</label>
<type>header</type>
<style>table_dns table_dns_conoha</style>
</field>
<field>
<id>validation.dns_conoha_user</id>
<label>User</label>
<type>text</type>
</field>
<field>
<id>validation.dns_conoha_password</id>
<label>Password</label>
<type>password</type>
</field>
<field>
<id>validation.dns_conoha_tenantid</id>
<label>Tenant ID</label>
<type>text</type>
</field>
<field>
<id>validation.dns_conoha_idapi</id>
<label>Identity Service API</label>
<type>text</type>
</field>
</form>
@@ -0,0 +1,46 @@
<?php
/*
* Copyright (C) 2024 Frank Wall
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\AcmeClient\LeValidation;
use OPNsense\AcmeClient\LeValidationInterface;
use OPNsense\Core\Config;
/**
* ConoHa API
* @package OPNsense\AcmeClient
*/
class DnsConoha extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['CONOHA_Username'] = (string)$this->config->dns_conoha_user;
$this->acme_env['CONOHA_Password'] = (string)$this->config->dns_conoha_password;
$this->acme_env['CONOHA_TenantId'] = (string)$this->config->dns_conoha_tenantid;
$this->acme_env['CONOHA_IdentityServiceApi'] = (string)$this->config->dns_conoha_idapi;
}
}
@@ -435,6 +435,7 @@
<dns_cf>CloudFlare.com</dns_cf>
<dns_cx>CloudXNS.com</dns_cx>
<dns_cn>Core-Networks</dns_cn>
<dns_conoha>ConoHa</dns_conoha>
<dns_cpanel>cPanel</dns_cpanel>
<dns_cyon>cyon.ch</dns_cyon>
<dns_ddnss>DDNSS</dns_ddnss>
@@ -1202,6 +1203,19 @@
<dns_aurora_secret type="TextField">
<Required>N</Required>
</dns_aurora_secret>
<dns_conoha_user type="TextField">
<Required>N</Required>
</dns_conoha_user>
<dns_conoha_password type="TextField">
<Required>N</Required>
</dns_conoha_password>
<dns_conoha_tenantid type="TextField">
<Required>N</Required>
</dns_conoha_tenantid>
<dns_conoha_idapi type="TextField">
<Required>N</Required>
<default>https://identity.xxxx.conoha.io/v2.0</default>
</dns_conoha_idapi>
</validation>
</validations>
<actions>