linode

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 3 Imported by: 0

README

Linode module for Caddy

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

Caddy module name

dns.providers.linode

Building

To compile this Caddy module, follow the steps describe at the Caddy Build from Source instructions and import the github.com/caddy-dns/linode plugin

Authenticating

See the associated README in the libdns package for important information about credentials.

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": "linode",
				"api_token": "{env.LINODE_PERSONAL_ACCESS_TOKEN}",
				"api_url": "{env.LINODE_API_URL}",
				"api_version": "{env.LINODE_API_VERSION}"
			}
		}
	}
}

or with the Caddyfile:

# globally
{
	acme_dns linode {env.LINODE_PERSONAL_ACCESS_TOKEN}
}

# globally, with optional fields
{
	acme_dns linode {
	  api_token {env.LINODE_PERSONAL_ACCESS_TOKEN}
	  api_url {env.LINODE_API_URL}
	  api_version {env.LINODE_API_VERSION}
	}
}
# one site
tls {
	dns linode {$LINODE_PERSONAL_ACCESS_TOKEN}
}

# one site, with optional fields
tls {
	dns linode {
	  api_token {$LINODE_PERSONAL_ACCESS_TOKEN}
	  api_url {env.LINODE_API_URL}
	  api_version {env.LINODE_API_VERSION}
	}
}

You can replace {$*} or {env.*} with the actual values if you prefer to put it directly in your config instead of an environment variable.

The fields are:

  • api_token - The Linode Personal Access Token to use.

  • api_url - The Linode API hostname to use, i.e. api.linode.com.

  • api_version - The Linode API version to use, i.e. v4.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{ *linode.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:

linode <api_token>

or, when specifying optional fields:

linode [<api_token>] {
    api_token <string>
    api_url <string>
    api_version <string>
}

Jump to

Keyboard shortcuts

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