2016-11-18 13:12:13 +00:00
|
|
|
// Factory for DNS providers
|
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/xenolf/lego/acme"
|
|
|
|
"github.com/xenolf/lego/providers/dns/auroradns"
|
|
|
|
"github.com/xenolf/lego/providers/dns/azure"
|
|
|
|
"github.com/xenolf/lego/providers/dns/cloudflare"
|
2018-02-02 19:41:35 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/cloudxns"
|
2016-11-18 13:12:13 +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"
|
|
|
|
"github.com/xenolf/lego/providers/dns/dyn"
|
|
|
|
"github.com/xenolf/lego/providers/dns/exoscale"
|
|
|
|
"github.com/xenolf/lego/providers/dns/gandi"
|
2018-02-02 19:22:33 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/gandiv5"
|
2016-11-18 13:12:13 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/googlecloud"
|
2018-02-02 19:22:33 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/godaddy"
|
2016-11-18 13:12:13 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/linode"
|
|
|
|
"github.com/xenolf/lego/providers/dns/namecheap"
|
|
|
|
"github.com/xenolf/lego/providers/dns/ns1"
|
2017-07-19 22:54:35 +00:00
|
|
|
"github.com/xenolf/lego/providers/dns/otc"
|
2016-11-18 13:12:13 +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"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewDNSChallengeProviderByName(name string) (acme.ChallengeProvider, error) {
|
|
|
|
var err error
|
|
|
|
var provider acme.ChallengeProvider
|
|
|
|
switch name {
|
|
|
|
case "azure":
|
|
|
|
provider, err = azure.NewDNSProvider()
|
|
|
|
case "auroradns":
|
|
|
|
provider, err = auroradns.NewDNSProvider()
|
|
|
|
case "cloudflare":
|
|
|
|
provider, err = cloudflare.NewDNSProvider()
|
2018-02-02 19:41:35 +00:00
|
|
|
case "cloudxns":
|
|
|
|
provider, err = cloudxns.NewDNSProvider()
|
2016-11-18 13:12:13 +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()
|
|
|
|
case "dyn":
|
|
|
|
provider, err = dyn.NewDNSProvider()
|
|
|
|
case "exoscale":
|
2017-07-17 19:40:57 +00:00
|
|
|
provider, err = exoscale.NewDNSProvider()
|
2016-11-18 13:12:13 +00:00
|
|
|
case "gandi":
|
|
|
|
provider, err = gandi.NewDNSProvider()
|
2018-02-02 19:22:33 +00:00
|
|
|
case "gandiv5":
|
|
|
|
provider, err = gandiv5.NewDNSProvider()
|
2016-11-18 13:12:13 +00:00
|
|
|
case "gcloud":
|
|
|
|
provider, err = googlecloud.NewDNSProvider()
|
2017-10-25 19:55:29 +00:00
|
|
|
case "godaddy":
|
|
|
|
provider, err = godaddy.NewDNSProvider()
|
2016-11-18 13:12:13 +00:00
|
|
|
case "linode":
|
|
|
|
provider, err = linode.NewDNSProvider()
|
|
|
|
case "manual":
|
|
|
|
provider, err = acme.NewDNSProviderManual()
|
|
|
|
case "namecheap":
|
|
|
|
provider, err = namecheap.NewDNSProvider()
|
|
|
|
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-07-19 22:54:35 +00:00
|
|
|
case "otc":
|
|
|
|
provider, err = otc.NewDNSProvider()
|
2016-11-18 13:12:13 +00:00
|
|
|
default:
|
|
|
|
err = fmt.Errorf("Unrecognised DNS provider: %s", name)
|
|
|
|
}
|
|
|
|
return provider, err
|
|
|
|
}
|