Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linode support #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A [Rancher](http://rancher.com/rancher/) service that obtains free SSL/TLS certi
* `DNSimple`
* `Dyn`
* `Gandi`
* `Linode`
* `NS1`
* `Ovh`
* `Vultr`
Expand Down Expand Up @@ -110,6 +111,8 @@ Then make sure that HTTP requests to `domain.com/.well-known/acme-challenge` are

`make build && make image`

This project uses [trash](https://github.com/rancher/trash) to manage dependencies.

### Contributions

PR's welcome!
1 change: 1 addition & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func (c *Context) InitContext() {
OvhConsumerKey: getEnvOption("OVH_CONSUMER_KEY", false),
GandiApiKey: getEnvOption("GANDI_API_KEY", false),
NS1ApiKey: getEnvOption("NS1_API_KEY", false),
LinodeApiKey: getEnvOption("LINODE_API_KEY", false),
}

c.Acme, err = letsencrypt.NewClient(emailParam, keyType, apiVersion, dnsResolvers, providerOpts)
Expand Down
19 changes: 19 additions & 0 deletions letsencrypt/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/xenolf/lego/providers/dns/dnsimple"
"github.com/xenolf/lego/providers/dns/dyn"
"github.com/xenolf/lego/providers/dns/gandi"
"github.com/xenolf/lego/providers/dns/linode"
"github.com/xenolf/lego/providers/dns/ns1"
"github.com/xenolf/lego/providers/dns/ovh"
"github.com/xenolf/lego/providers/dns/route53"
Expand Down Expand Up @@ -58,6 +59,9 @@ type ProviderOpts struct {
// Gandi credentials
GandiApiKey string

// Linode credentials
LinodeApiKey string

// NS1 credentials
NS1ApiKey string

Expand All @@ -80,6 +84,7 @@ const (
DNSIMPLE = Provider("DNSimple")
DYN = Provider("Dyn")
GANDI = Provider("Gandi")
LINODE = Provider("Linode")
NS1 = Provider("NS1")
OVH = Provider("Ovh")
ROUTE53 = Provider("Route53")
Expand All @@ -100,6 +105,7 @@ var providerFactory = map[Provider]ProviderFactory{
DNSIMPLE: ProviderFactory{makeDNSimpleProvider, lego.DNS01},
DYN: ProviderFactory{makeDynProvider, lego.DNS01},
GANDI: ProviderFactory{makeGandiProvider, lego.DNS01},
LINODE: ProviderFactory{makeLinodeProvider, lego.DNS01},
NS1: ProviderFactory{makeNS1Provider, lego.DNS01},
OVH: ProviderFactory{makeOvhProvider, lego.DNS01},
ROUTE53: ProviderFactory{makeRoute53Provider, lego.DNS01},
Expand Down Expand Up @@ -275,6 +281,19 @@ func makeGandiProvider(opts ProviderOpts) (lego.ChallengeProvider, error) {
return provider, nil
}

// returns a preconfigured Linode lego.ChallengeProvider
func makeLinodeProvider(opts ProviderOpts) (lego.ChallengeProvider, error) {
if len(opts.LinodeApiKey) == 0 {
return nil, fmt.Errorf("Linode API key is not set")
}

provider, err := linode.NewDNSProviderCredentials(opts.LinodeApiKey)
if err != nil {
return nil, err
}
return provider, nil
}

// returns a preconfigured HTTP lego.ChallengeProvider
func makeHTTPProvider(opts ProviderOpts) (lego.ChallengeProvider, error) {
provider := lego.NewHTTPProviderServer("", "")
Expand Down
1 change: 1 addition & 0 deletions vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ github.com/ovh/go-ovh d220717
github.com/pkg/errors c605e28
github.com/rancher/go-rancher/v2 939fd85
github.com/Sirupsen/logrus v0.11.5
github.com/timewasted/linode/dns 37e8452
github.com/xenolf/lego aaa8e70
golang.org/x/crypto ab89591
golang.org/x/net 84f0e6f
Expand Down
69 changes: 69 additions & 0 deletions vendor/github.com/timewasted/linode/dns/dns.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions vendor/github.com/timewasted/linode/dns/domain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading