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

Fix DNSimple API Call. #93 #94

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
49 changes: 24 additions & 25 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,31 +101,30 @@ func (c *Context) InitContext() {
}

providerOpts := letsencrypt.ProviderOpts{
Provider: letsencrypt.Provider(providerParam),
AzureClientId: getEnvOption("AZURE_CLIENT_ID", false),
AzureClientSecret: getEnvOption("AZURE_CLIENT_SECRET", false),
AzureSubscriptionId: getEnvOption("AZURE_SUBSCRIPTION_ID", false),
AzureTenantId: getEnvOption("AZURE_TENANT_ID", false),
AzureResourceGroup: getEnvOption("AZURE_RESOURCE_GROUP", false),
AuroraUserId: getEnvOption("AURORA_USER_ID", false),
AuroraKey: getEnvOption("AURORA_KEY", false),
AuroraEndpoint: getEnvOption("AURORA_ENDPOINT", false),
CloudflareEmail: getEnvOption("CLOUDFLARE_EMAIL", false),
CloudflareKey: getEnvOption("CLOUDFLARE_KEY", false),
DoAccessToken: getEnvOption("DO_ACCESS_TOKEN", false),
AwsAccessKey: getEnvOption("AWS_ACCESS_KEY", false),
AwsSecretKey: getEnvOption("AWS_SECRET_KEY", false),
DNSimpleEmail: getEnvOption("DNSIMPLE_EMAIL", false),
DNSimpleKey: getEnvOption("DNSIMPLE_KEY", false),
DynCustomerName: getEnvOption("DYN_CUSTOMER_NAME", false),
DynUserName: getEnvOption("DYN_USER_NAME", false),
DynPassword: getEnvOption("DYN_PASSWORD", false),
VultrApiKey: getEnvOption("VULTR_API_KEY", false),
OvhApplicationKey: getEnvOption("OVH_APPLICATION_KEY", false),
OvhApplicationSecret: getEnvOption("OVH_APPLICATION_SECRET", false),
OvhConsumerKey: getEnvOption("OVH_CONSUMER_KEY", false),
GandiApiKey: getEnvOption("GANDI_API_KEY", false),
NS1ApiKey: getEnvOption("NS1_API_KEY", false),
Provider: letsencrypt.Provider(providerParam),
AzureClientId: getEnvOption("AZURE_CLIENT_ID", false),
AzureClientSecret: getEnvOption("AZURE_CLIENT_SECRET", false),
AzureSubscriptionId: getEnvOption("AZURE_SUBSCRIPTION_ID", false),
AzureTenantId: getEnvOption("AZURE_TENANT_ID", false),
AzureResourceGroup: getEnvOption("AZURE_RESOURCE_GROUP", false),
AuroraUserId: getEnvOption("AURORA_USER_ID", false),
AuroraKey: getEnvOption("AURORA_KEY", false),
AuroraEndpoint: getEnvOption("AURORA_ENDPOINT", false),
CloudflareEmail: getEnvOption("CLOUDFLARE_EMAIL", false),
CloudflareKey: getEnvOption("CLOUDFLARE_KEY", false),
DoAccessToken: getEnvOption("DO_ACCESS_TOKEN", false),
AwsAccessKey: getEnvOption("AWS_ACCESS_KEY", false),
AwsSecretKey: getEnvOption("AWS_SECRET_KEY", false),
DNSimpleAccountAccess: getEnvOption("DNSIMPLE_ACCOUNT_ACCESS", false),
DynCustomerName: getEnvOption("DYN_CUSTOMER_NAME", false),
DynUserName: getEnvOption("DYN_USER_NAME", false),
DynPassword: getEnvOption("DYN_PASSWORD", false),
VultrApiKey: getEnvOption("VULTR_API_KEY", false),
OvhApplicationKey: getEnvOption("OVH_APPLICATION_KEY", false),
OvhApplicationSecret: getEnvOption("OVH_APPLICATION_SECRET", false),
OvhConsumerKey: getEnvOption("OVH_CONSUMER_KEY", false),
GandiApiKey: getEnvOption("GANDI_API_KEY", false),
NS1ApiKey: getEnvOption("NS1_API_KEY", false),
}

c.Acme, err = letsencrypt.NewClient(emailParam, keyType, apiVersion, dnsResolvers, providerOpts)
Expand Down
12 changes: 4 additions & 8 deletions letsencrypt/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ type ProviderOpts struct {
DoAccessToken string

// DNSimple credentials
DNSimpleEmail string
DNSimpleKey string
DNSimpleAccountAccess string

// Dyn credentials
DynCustomerName string
Expand Down Expand Up @@ -195,14 +194,11 @@ func makeRoute53Provider(opts ProviderOpts) (lego.ChallengeProvider, error) {

// returns a preconfigured DNSimple lego.ChallengeProvider
func makeDNSimpleProvider(opts ProviderOpts) (lego.ChallengeProvider, error) {
if len(opts.DNSimpleEmail) == 0 {
return nil, fmt.Errorf("DNSimple Email is not set")
}
if len(opts.DNSimpleKey) == 0 {
return nil, fmt.Errorf("DNSimple API key is not set")
if len(opts.DNSimpleAccountAccess) == 0 {
return nil, fmt.Errorf("DNSimple Domain API token is not set")
}

provider, err := dnsimple.NewDNSProviderCredentials(opts.DNSimpleEmail, opts.DNSimpleKey)
provider, err := dnsimple.NewDNSProviderCredentials(opts.DNSimpleAccountAccess, "https://api.dnsimple.com")
if err != nil {
return nil, err
}
Expand Down