2017-02-07 21:33:23 +00:00
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2018-05-31 07:30:04 +00:00
|
|
|
"github.com/xenolf/lego/acme"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/auroradns"
|
|
|
|
"github.com/xenolf/lego/providers/dns/azure"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/bluecat"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/cloudflare"
|
2018-02-12 17:10:05 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/cloudxns"
|
2017-02-07 21:33:23 +00:00
|
|
|
"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"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/duckdns"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/dyn"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/exec"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/exoscale"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/fastdns"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/gandi"
|
2018-02-12 17:10:05 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/gandiv5"
|
2018-05-31 07:30:04 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/gcloud"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/glesys"
|
2018-02-12 17:10:05 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/godaddy"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/lightsail"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/linode"
|
|
|
|
"github.com/xenolf/lego/providers/dns/namecheap"
|
2018-04-06 15:04:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/namedotcom"
|
2017-02-07 21:33:23 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/ns1"
|
2017-10-31 09:42:03 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/otc"
|
2017-02-07 21:33:23 +00:00
|
|
|
"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/vultr"
|
|
|
|
)
|
|
|
|
|
2018-05-31 07:30:04 +00:00
|
|
|
// NewDNSChallengeProviderByName Factory for DNS providers
|
|
|
|
func NewDNSChallengeProviderByName(name string) (acme.ChallengeProvider, error) {
|
2017-02-07 21:33:23 +00:00
|
|
|
var err error
|
2018-05-31 07:30:04 +00:00
|
|
|
var provider acme.ChallengeProvider
|
2017-02-07 21:33:23 +00:00
|
|
|
switch name {
|
|
|
|
case "azure":
|
|
|
|
provider, err = azure.NewDNSProvider()
|
|
|
|
case "auroradns":
|
|
|
|
provider, err = auroradns.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "bluecat":
|
|
|
|
provider, err = bluecat.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "cloudflare":
|
|
|
|
provider, err = cloudflare.NewDNSProvider()
|
2018-02-12 17:10:05 +00:00
|
|
|
case "cloudxns":
|
|
|
|
provider, err = cloudxns.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "digitalocean":
|
|
|
|
provider, err = digitalocean.NewDNSProvider()
|
|
|
|
case "dnsimple":
|
|
|
|
provider, err = dnsimple.NewDNSProvider()
|
|
|
|
case "dnsmadeeasy":
|
|
|
|
provider, err = dnsmadeeasy.NewDNSProvider()
|
|
|
|
case "dnspod":
|
|
|
|
provider, err = dnspod.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "duckdns":
|
|
|
|
provider, err = duckdns.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "dyn":
|
|
|
|
provider, err = dyn.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "fastdns":
|
|
|
|
provider, err = fastdns.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "exoscale":
|
2017-10-31 09:42:03 +00:00
|
|
|
provider, err = exoscale.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "gandi":
|
|
|
|
provider, err = gandi.NewDNSProvider()
|
2018-02-12 17:10:05 +00:00
|
|
|
case "gandiv5":
|
|
|
|
provider, err = gandiv5.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "glesys":
|
|
|
|
provider, err = glesys.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "gcloud":
|
2018-05-31 07:30:04 +00:00
|
|
|
provider, err = gcloud.NewDNSProvider()
|
2017-11-30 09:44:03 +00:00
|
|
|
case "godaddy":
|
|
|
|
provider, err = godaddy.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "lightsail":
|
|
|
|
provider, err = lightsail.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "linode":
|
|
|
|
provider, err = linode.NewDNSProvider()
|
|
|
|
case "manual":
|
2018-05-31 07:30:04 +00:00
|
|
|
provider, err = acme.NewDNSProviderManual()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "namecheap":
|
|
|
|
provider, err = namecheap.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "namedotcom":
|
|
|
|
provider, err = namedotcom.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
case "rackspace":
|
|
|
|
provider, err = rackspace.NewDNSProvider()
|
|
|
|
case "route53":
|
|
|
|
provider, err = route53.NewDNSProvider()
|
|
|
|
case "rfc2136":
|
|
|
|
provider, err = rfc2136.NewDNSProvider()
|
|
|
|
case "vultr":
|
|
|
|
provider, err = vultr.NewDNSProvider()
|
|
|
|
case "ovh":
|
|
|
|
provider, err = ovh.NewDNSProvider()
|
|
|
|
case "pdns":
|
|
|
|
provider, err = pdns.NewDNSProvider()
|
|
|
|
case "ns1":
|
|
|
|
provider, err = ns1.NewDNSProvider()
|
2017-10-31 09:42:03 +00:00
|
|
|
case "otc":
|
|
|
|
provider, err = otc.NewDNSProvider()
|
2018-04-06 15:04:03 +00:00
|
|
|
case "exec":
|
|
|
|
provider, err = exec.NewDNSProvider()
|
2017-02-07 21:33:23 +00:00
|
|
|
default:
|
2018-05-31 07:30:04 +00:00
|
|
|
err = fmt.Errorf("unrecognised DNS provider: %s", name)
|
2017-02-07 21:33:23 +00:00
|
|
|
}
|
|
|
|
return provider, err
|
|
|
|
}
|