diff --git a/context.go b/context.go index 7b26531..f346304 100644 --- a/context.go +++ b/context.go @@ -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) diff --git a/letsencrypt/providers.go b/letsencrypt/providers.go index bd1bc89..2980a1c 100644 --- a/letsencrypt/providers.go +++ b/letsencrypt/providers.go @@ -47,8 +47,7 @@ type ProviderOpts struct { DoAccessToken string // DNSimple credentials - DNSimpleEmail string - DNSimpleKey string + DNSimpleAccountAccess string // Dyn credentials DynCustomerName string @@ -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 }