dynu

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 3 Imported by: 0

README

Dynu module for Caddy

This package contains a DNS provider module for Caddy. It can be used to manage DNS records with Dynu.

Caddy module name

dns.providers.dynu

Caddyfile definition

dynu [<api_token>] {
    api_token <api_token>
    own_domain <own_domain>
}
  • api_token may be specified as an argument to the dynu directive, or in the body.
  • own_domain should be set to the root domain returned from /dns/getroot/{hostname} of the Dynu API. For example, if you have a subdomain my.dynu.com, this should be set to my.dynu.com so that the correct hostname is used to update Dynu. This is needed as the zone used by Caddy DNS challenge is different from the subdomain provided by Dynu.

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": "dynu",
				"api_token": "YOUR_DYNU_API_TOKEN",
				"own_domain": "YOUR_OWN_DYNU_DOMAIN"
			}
		}
	}
}

or with the Caddyfile:

tls {
	dns dynu {env.DYNU_API_TOKEN} {
		own_domain {env.OWN_DYNU_DOMAIN}
	}
}

You can replace {env.DYNU_API_TOKEN} with the actual auth token if you prefer to put it directly in your config instead of an environment variable.

Authenticating

See the associated README in the libdns package for important information about credentials. Your API token can be found when logged in at https://www.dynu.com/ControlPanel/APICredentials.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{ *dynu.Provider }

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

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

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:

providername [<api_token>] {
    api_token <api_token>
    own_domain <own_domain>
}

Jump to

Keyboard shortcuts

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