Skip to content

Commit 4714943

Browse files
committed
security/acme-client: Add domains.google support
Adds support for Google Domains DNS-01 ACME challenge API added to latest upstream acme.sh. This is separate from the Google Cloud API. https://domains.google/learn/gts-acme/ See acmesh-official/acme.sh#4542
1 parent 5c3d27c commit 4714943

File tree

4 files changed

+75
-0
lines changed

4 files changed

+75
-0
lines changed

security/acme-client/pkg-descr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ WWW: https://github.com/acmesh-official/acme.sh
77

88
Plugin Changelog
99
================
10+
3.19
11+
12+
Added:
13+
* add Google Domains DNS API
1014

1115
3.18
1216

security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,21 @@
556556
<label>Secret</label>
557557
<type>text</type>
558558
</field>
559+
<field>
560+
<label>Google Domains</label>
561+
<type>header</type>
562+
<style>table_dns table_dns_googledomains</style>
563+
</field>
564+
<field>
565+
<id>validation.dns_googledomains_access_token</id>
566+
<label>Access Token</label>
567+
<type>text</type>
568+
</field>
569+
<field>
570+
<id>validation.dns_googledomains_zone</id>
571+
<label>Zone</label>
572+
<type>text</type>
573+
</field>
559574
<field>
560575
<label>hosting.de</label>
561576
<type>header</type>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
/*
4+
* Copyright (C) 2023 Cannon Matthews <[email protected]>
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
17+
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18+
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19+
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
20+
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25+
* POSSIBILITY OF SUCH DAMAGE.
26+
*/
27+
28+
namespace OPNsense\AcmeClient\LeValidation;
29+
30+
use OPNsense\AcmeClient\LeValidationInterface;
31+
use OPNsense\Core\Config;
32+
33+
/**
34+
* Google Domains DNS API
35+
* @package OPNsense\AcmeClient
36+
*/
37+
class DnsGoogleDomains extends Base implements LeValidationInterface
38+
{
39+
public function prepare()
40+
{
41+
// It is possible to override $GOOGLEDOMAINS_API env variable to
42+
// control the endpoint acme.sh talks to. However there is only one
43+
// option (https://acmedns.googleapis.com/v1/acmeChallengeSets) that is
44+
// currently the default, so exposing this only adds to confusion and
45+
// noise in the UI.
46+
$this->acme_env['GOOGLEDOMAINS_ACCESS_TOKEN'] = (string)$this->config->dns_googledomains_access_token;
47+
$this->acme_env['GOOGLEDOMAINS_ZONE'] = (string)$this->config->dns_googledomains_zone;
48+
}
49+
}

security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@
456456
<dns_gandi_livedns>Gandi LiveDNS</dns_gandi_livedns>
457457
<dns_gd>GoDaddy.com</dns_gd>
458458
<dns_gcloud>Google Cloud DNS</dns_gcloud>
459+
<dns_googledomains>Google Domains</dns_googledomains>
459460
<dns_gdnsdk>GratisDNS.dk</dns_gdnsdk>
460461
<dns_hetzner>Hetzner</dns_hetzner>
461462
<dns_hexonet>hexonet.com</dns_hexonet>
@@ -668,6 +669,12 @@
668669
<dns_gcloud_key type="TextField">
669670
<Required>N</Required>
670671
</dns_gcloud_key>
672+
<dns_googledomains_access_token type="TextField">
673+
<Required>N</Required>
674+
</dns_googledomains_access_token>
675+
<dns_googledomains_zone type="TextField">
676+
<Required>N</Required>
677+
</dns_googledomains_zone>
671678
<dns_gd_key type="TextField">
672679
<Required>N</Required>
673680
</dns_gd_key>

0 commit comments

Comments
 (0)