googledomains

package module
v0.0.0-...-6f79d6a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 9 Imported by: 0

README

Google Domains module for Caddy

This package contains a DNS provider module for Caddy. It can be used to manage ACME DNS challenge records with Google Domains.

Unlike most DNS provider modules for Caddy, this module works ONLY for ACME DNS challenges, due to limitations in the Google Domains API, which is designed only for manipulating TXT records for the DNS challenge.

Caddy module name

dns.providers.google_domains

Config examples

To use this module for the ACME DNS challenge, configure the ACME issuer in your Caddy JSON like so:

{
	"module": "acme",
	"challenges": {
		"dns": {
			"provider": {
				"name": "google_domains",
				"access_token": "YOUR_ACCESS_TOKEN"
			}
		}
	}
}

or with the Caddyfile:

# globally
{
	acme_dns google_domains <access_token>
}
# one site
tls {
	dns google_domains <access_token>
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	AccessToken        string `json:"access_token,omitempty"`
	KeepExpiredRecords bool   `json:"keep_expired_records,omitempty"`
}

Provider lets Caddy read and manipulate DNS records hosted by this DNS provider.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added.

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the records from the zone. It returns the records that were deleted.

func (*Provider) Provision

func (p *Provider) Provision(ctx caddy.Context) error

Provision sets up the module. Implements caddy.Provisioner.

func (*Provider) UnmarshalCaddyfile

func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

google_domains <access_token>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL