Adding Selfhost DNS for acme.sh (#2746)

* Added Selfhost DNS
This commit is contained in:
Marvo2011
2022-01-07 16:44:41 +01:00
committed by GitHub
parent 9c6eaca8dc
commit 8815fa9227
3 changed files with 87 additions and 0 deletions
@@ -1018,6 +1018,33 @@
<label>API Key</label>
<type>text</type>
</field>
<field>
<label>Selfhost</label>
<type>header</type>
<style>table_dns table_dns_selfhost</style>
</field>
<field>
<id>validation.dns_selfhost_user</id>
<label>User</label>
<type>text</type>
</field>
<field>
<id>validation.dns_selfhost_password</id>
<label>Password</label>
<type>password</type>
</field>
<field>
<id>validation.dns_selfhost_rid</id>
<label>rid</label>
<type>text</type>
<help>Please create the TXT Record with Subdomain _acme-challenge first, than you can get the ID from the edit page.</help>
</field>
<field>
<id>validation.dns_selfhost_rid2</id>
<label>rid2</label>
<type>text</type>
<help>Please create a second TXT Record with Subdomain _acme-challenge (needed to support ACME v2).</help>
</field>
<field>
<label>Servercow</label>
<type>header</type>
@@ -0,0 +1,47 @@
<?php
/*
* Copyright (C) 2022 Marvo2011
* All rights reserved.
*
* 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;
/**
* Selfhost API
* @package OPNsense\AcmeClient
*/
class DnsSelfhost extends Base implements LeValidationInterface
{
public function prepare()
{
$this->acme_env['SELFHOSTDNS_USERNAME'] = (string)$this->config->dns_selfhost_user;
$this->acme_env['SELFHOSTDNS_PASSWORD'] = (string)$this->config->dns_selfhost_password;
$this->acme_env['SELFHOSTDNS_RID'] = (string)$this->config->dns_selfhost_rid;
$this->acme_env['SELFHOSTDNS_RID2'] = (string)$this->config->dns_selfhost_rid2;
}
}
@@ -486,6 +486,7 @@
<dns_porkbun>Porkbun API</dns_porkbun>
<dns_schlundtech>SchlundTech</dns_schlundtech>
<dns_selectel>selectel.com / selectel.ru domain API</dns_selectel>
<dns_selfhost>Selfhost API</dns_selfhost>
<dns_servercow>Servercow API v1</dns_servercow>
<dns_unoeuro>UnoEuro API</dns_unoeuro>
<dns_variomedia>Variomedia.de API</dns_variomedia>
@@ -923,6 +924,18 @@
<dns_sl_key type="TextField">
<Required>N</Required>
</dns_sl_key>
<dns_selfhost_user type="TextField">
<Required>N</Required>
</dns_selfhost_user>
<dns_selfhost_password type="TextField">
<Required>N</Required>
</dns_selfhost_password>
<dns_selfhost_rid type="TextField">
<Required>N</Required>
</dns_selfhost_rid>
<dns_selfhost_rid2 type="TextField">
<Required>N</Required>
</dns_selfhost_rid2>
<dns_servercow_username type="TextField">
<Required>N</Required>
</dns_servercow_username>