04e2d74406
This commit adds a new DNS provider for [acme-dns](https://github.com/joohoi/acme-dns) to allow Lego to set DNS-01 challenge response TXT with an ACME-DNS server automatically. ACME-DNS allows ceding minimal zone editing permissions to the ACME client and can be useful when the primary DNS provider for the zone does not allow scripting/API access but can set a CNAME to an ACME-DNS server. Lower level ACME-DNS API calls & account loading/storing is handled by the `github.com/cpu/goacmedns` library. The provider loads existing ACME-DNS accounts from the specified JSON file on disk. Any accounts the provider registers on behalf of the user will also be saved to this JSON file. When required, the provider handles registering accounts with the ACME-DNS server domains that do not already have an ACME-DNS account. This will halt issuance with an error prompting the user to set the one-time manual CNAME required to delegate the DNS-01 challenge record to the ACME-DNS server. Subsequent runs will use the account from disk and assume the CNAME is in-place.
122 lines
3.7 KiB
Go
122 lines
3.7 KiB
Go
package dns
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/xenolf/lego/acme"
|
|
"github.com/xenolf/lego/providers/dns/acmedns"
|
|
"github.com/xenolf/lego/providers/dns/auroradns"
|
|
"github.com/xenolf/lego/providers/dns/azure"
|
|
"github.com/xenolf/lego/providers/dns/bluecat"
|
|
"github.com/xenolf/lego/providers/dns/cloudflare"
|
|
"github.com/xenolf/lego/providers/dns/cloudxns"
|
|
"github.com/xenolf/lego/providers/dns/digitalocean"
|
|
"github.com/xenolf/lego/providers/dns/dnsimple"
|
|
"github.com/xenolf/lego/providers/dns/dnsmadeeasy"
|
|
"github.com/xenolf/lego/providers/dns/dnspod"
|
|
"github.com/xenolf/lego/providers/dns/duckdns"
|
|
"github.com/xenolf/lego/providers/dns/dyn"
|
|
"github.com/xenolf/lego/providers/dns/exec"
|
|
"github.com/xenolf/lego/providers/dns/exoscale"
|
|
"github.com/xenolf/lego/providers/dns/fastdns"
|
|
"github.com/xenolf/lego/providers/dns/gandi"
|
|
"github.com/xenolf/lego/providers/dns/gandiv5"
|
|
"github.com/xenolf/lego/providers/dns/gcloud"
|
|
"github.com/xenolf/lego/providers/dns/glesys"
|
|
"github.com/xenolf/lego/providers/dns/godaddy"
|
|
"github.com/xenolf/lego/providers/dns/lightsail"
|
|
"github.com/xenolf/lego/providers/dns/linode"
|
|
"github.com/xenolf/lego/providers/dns/namecheap"
|
|
"github.com/xenolf/lego/providers/dns/namedotcom"
|
|
"github.com/xenolf/lego/providers/dns/nifcloud"
|
|
"github.com/xenolf/lego/providers/dns/ns1"
|
|
"github.com/xenolf/lego/providers/dns/otc"
|
|
"github.com/xenolf/lego/providers/dns/ovh"
|
|
"github.com/xenolf/lego/providers/dns/pdns"
|
|
"github.com/xenolf/lego/providers/dns/rackspace"
|
|
"github.com/xenolf/lego/providers/dns/rfc2136"
|
|
"github.com/xenolf/lego/providers/dns/route53"
|
|
"github.com/xenolf/lego/providers/dns/sakuracloud"
|
|
"github.com/xenolf/lego/providers/dns/vegadns"
|
|
"github.com/xenolf/lego/providers/dns/vultr"
|
|
)
|
|
|
|
// NewDNSChallengeProviderByName Factory for DNS providers
|
|
func NewDNSChallengeProviderByName(name string) (acme.ChallengeProvider, error) {
|
|
switch name {
|
|
case "acme-dns":
|
|
return acmedns.NewDNSProvider()
|
|
case "azure":
|
|
return azure.NewDNSProvider()
|
|
case "auroradns":
|
|
return auroradns.NewDNSProvider()
|
|
case "bluecat":
|
|
return bluecat.NewDNSProvider()
|
|
case "cloudflare":
|
|
return cloudflare.NewDNSProvider()
|
|
case "cloudxns":
|
|
return cloudxns.NewDNSProvider()
|
|
case "digitalocean":
|
|
return digitalocean.NewDNSProvider()
|
|
case "dnsimple":
|
|
return dnsimple.NewDNSProvider()
|
|
case "dnsmadeeasy":
|
|
return dnsmadeeasy.NewDNSProvider()
|
|
case "dnspod":
|
|
return dnspod.NewDNSProvider()
|
|
case "duckdns":
|
|
return duckdns.NewDNSProvider()
|
|
case "dyn":
|
|
return dyn.NewDNSProvider()
|
|
case "fastdns":
|
|
return fastdns.NewDNSProvider()
|
|
case "exoscale":
|
|
return exoscale.NewDNSProvider()
|
|
case "gandi":
|
|
return gandi.NewDNSProvider()
|
|
case "gandiv5":
|
|
return gandiv5.NewDNSProvider()
|
|
case "glesys":
|
|
return glesys.NewDNSProvider()
|
|
case "gcloud":
|
|
return gcloud.NewDNSProvider()
|
|
case "godaddy":
|
|
return godaddy.NewDNSProvider()
|
|
case "lightsail":
|
|
return lightsail.NewDNSProvider()
|
|
case "linode":
|
|
return linode.NewDNSProvider()
|
|
case "manual":
|
|
return acme.NewDNSProviderManual()
|
|
case "namecheap":
|
|
return namecheap.NewDNSProvider()
|
|
case "namedotcom":
|
|
return namedotcom.NewDNSProvider()
|
|
case "nifcloud":
|
|
return nifcloud.NewDNSProvider()
|
|
case "rackspace":
|
|
return rackspace.NewDNSProvider()
|
|
case "route53":
|
|
return route53.NewDNSProvider()
|
|
case "rfc2136":
|
|
return rfc2136.NewDNSProvider()
|
|
case "sakuracloud":
|
|
return sakuracloud.NewDNSProvider()
|
|
case "vultr":
|
|
return vultr.NewDNSProvider()
|
|
case "ovh":
|
|
return ovh.NewDNSProvider()
|
|
case "pdns":
|
|
return pdns.NewDNSProvider()
|
|
case "ns1":
|
|
return ns1.NewDNSProvider()
|
|
case "otc":
|
|
return otc.NewDNSProvider()
|
|
case "exec":
|
|
return exec.NewDNSProvider()
|
|
case "vegadns":
|
|
return vegadns.NewDNSProvider()
|
|
default:
|
|
return nil, fmt.Errorf("unrecognised DNS provider: %s", name)
|
|
}
|
|
}
|