Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security/acme-client: Add domains.google support #3429

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions security/acme-client/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ WWW: https://github.com/acmesh-official/acme.sh

Plugin Changelog
================
3.18

Added:
* add Google Domains DNS API

3.17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,21 @@
<label>Secret</label>
<type>text</type>
</field>
<field>
<label>Google Domains</label>
<type>header</type>
<style>table_dns table_dns_googledomains</style>
</field>
<field>
<id>validation.dns_googledomains_access_token</id>
<label>Access Token</label>
<type>text</type>
</field>
<field>
<id>validation.dns_googledomains_zone</id>
<label>Zone</label>
<type>text</type>
</field>
<field>
<label>hosting.de</label>
<type>header</type>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As already pointed out by others, this file needs to be renamed to DnsGoogledomains.php.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fraenki who would do that? I'm happy to help in whatever way I can :) Thanks!


/*
loosecannon93 marked this conversation as resolved.
Show resolved Hide resolved
* Copyright (C) 2023 Cannon Matthews <cannonmatthews@google.com>
*
* 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;

/**
* Google Domains DNS API
* @package OPNsense\AcmeClient
*/
class DnsGoogleDomains extends Base implements LeValidationInterface
{
public function prepare()
{
// It is possible to override $GOOGLEDOMAINS_API env variable to
// control the endpoint acme.sh talks to. However there is only one
// option (https://acmedns.googleapis.com/v1/acmeChallengeSets) that is
// currently the default, so exposing this only adds to confusion and
// noise in the UI.
$this->acme_env['GOOGLEDOMAINS_ACCESS_TOKEN'] = (string)$this->config->dns_googledomains_access_token;
$this->acme_env['GOOGLEDOMAINS_ZONE'] = (string)$this->config->dns_googledomains_zone;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
<dns_gandi_livedns>Gandi LiveDNS</dns_gandi_livedns>
<dns_gd>GoDaddy.com</dns_gd>
<dns_gcloud>Google Cloud DNS</dns_gcloud>
<dns_googledomains>Google Domains</dns_googledomains>
<dns_gdnsdk>GratisDNS.dk</dns_gdnsdk>
<dns_hetzner>Hetzner</dns_hetzner>
<dns_hexonet>hexonet.com</dns_hexonet>
Expand Down Expand Up @@ -668,6 +669,12 @@
<dns_gcloud_key type="TextField">
<Required>N</Required>
</dns_gcloud_key>
<dns_googledomains_access_token type="TextField">
<Required>N</Required>
</dns_googledomains_access_token>
<dns_googledomains_zone type="TextField">
<Required>N</Required>
</dns_googledomains_zone>
<dns_gd_key type="TextField">
<Required>N</Required>
</dns_gd_key>
Expand Down