legodeprecated

package module
v0.0.0-...-4c2cea8 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 8 Imported by: 0

README

DNS Providers for Caddy (deprecated)

This one module gives Caddy the ability to solve the ACME DNS challenge with over 75 DNS providers.

⚠️ This module is deprecated

This module wraps DNS providers that are implemented by go-acme/lego which uses an old API that is no longer supported by Caddy. As such, this module is a temporary shim until a sufficient number of providers are ported to the new libdns interfaces.

You can use this module to get up and running quickly with your provider of choice, but instead of using this module long-term, please consider contributing to a libdns package for your provider instead.

The libdns implementations offer better performance, lighter dependencies, easier maintainability with growth, and more flexible configuration.

Instructions

First, make sure Caddy is built with this module installed. This is easiest with xcaddy:

$ xcaddy build --with github.com/caddy-dns/lego-deprecated

Then find the documentation for your DNS provider.

Next, configure the ACME issuer in your Caddy JSON like so:

{
	"module": "acme",
	"challenges": {
		"dns": {
			"provider": {
				"name": "lego_deprecated",
				"provider_name": "<provider_code>"
			}
		}
	}
}

and replace <provider_code> with the name of your provider, as given in the docs linked above.

Your provider's credentials and other settings are configured via environment variables, which are also described in the docs linked above.

You can also use this with the Caddyfile:

tls {
	dns lego_deprecated <provider_code>
}

and replace <provider_code> with the name of your provider.

Compatibility note

Unlike other modules in the caddy-dns repositories, this one can only be used in the ACME issuer module for solving the DNS challenge. Even though it shares the more general dns.providers namespace with other provider modules, using this module in any other place in your config will result in errors.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LegoDeprecated

type LegoDeprecated struct {
	ProviderName string `json:"provider_name,omitempty"`
	// contains filtered or unexported fields
}

LegoDeprecated is a shim module that allows any and all of the DNS providers in go-acme/lego to be used with Caddy. They must be configured via environment variables, they do not support cancellation in the case of frequent config changes.

Even though this module is in the dns.providers namespace, it is only a special case for solving ACME challenges, intended to replace the modules that used to be in the now-defunct tls.dns namespace. Using it in other places of the Caddy config will result in errors.

This module will eventually go away in favor of the modules that make use of the libdns APIs: https://github.com/libdns

func (LegoDeprecated) CaddyModule

func (LegoDeprecated) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (LegoDeprecated) CleanUp

func (ld LegoDeprecated) CleanUp(_ context.Context, challenge acme.Challenge) error

CleanUp wraps the go-acme/lego/v4/challenge.Provider interface with the acmez.Solver interface. Normally, DNS providers in the caddy-dns repositories would implement the libdns interfaces (https://github.com/libdns/libdns) instead, but this module is a special case to give time for more DNS providers to be ported over to the libdns interfaces from the deprecated lego interface.

func (LegoDeprecated) Present

func (ld LegoDeprecated) Present(_ context.Context, challenge acme.Challenge) error

Present wraps the go-acme/lego/v4/challenge.Provider interface with the certmagic.ACMEDNSProvider interface. Normally, DNS providers in the caddy-dns repositories would implement the libdns interfaces (https://github.com/libdns/libdns) instead, but this module is a special case to give time for more DNS providers to be ported over to the libdns interfaces from the deprecated lego interface.

func (*LegoDeprecated) Provision

func (ld *LegoDeprecated) Provision(ctx caddy.Context) error

Provision initializes the underlying DNS provider.

func (*LegoDeprecated) UnmarshalCaddyfile

func (ld *LegoDeprecated) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

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

lego_deprecated <provider>

func (LegoDeprecated) Wait

func (LegoDeprecated) Wait(ctx context.Context, challenge acme.Challenge) error

Wait waits just a few seconds before proceeding. We don't have a clean way of doing true propagation polling from this layer of abstraction, unfortunately. If there is a way to do that with lego v4, then I don't know what it is.

Jump to

Keyboard shortcuts

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