diff --git a/README.md b/README.md index e28c89ca..bb9a7dc9 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Detailed documentation is available [here](https://go-acme.github.io/lego/dns). | [Cloud.ru](https://go-acme.github.io/lego/dns/cloudru/) | [CloudDNS](https://go-acme.github.io/lego/dns/clouddns/) | [Cloudflare](https://go-acme.github.io/lego/dns/cloudflare/) | [ClouDNS](https://go-acme.github.io/lego/dns/cloudns/) | | [CloudXNS](https://go-acme.github.io/lego/dns/cloudxns/) | [ConoHa](https://go-acme.github.io/lego/dns/conoha/) | [Constellix](https://go-acme.github.io/lego/dns/constellix/) | [CPanel/WHM](https://go-acme.github.io/lego/dns/cpanel/) | | [Derak Cloud](https://go-acme.github.io/lego/dns/derak/) | [deSEC.io](https://go-acme.github.io/lego/dns/desec/) | [Designate DNSaaS for Openstack](https://go-acme.github.io/lego/dns/designate/) | [Digital Ocean](https://go-acme.github.io/lego/dns/digitalocean/) | -| [directadmin](https://go-acme.github.io/lego/dns/directadmin/) | [DNS Made Easy](https://go-acme.github.io/lego/dns/dnsmadeeasy/) | [dnsHome.de](https://go-acme.github.io/lego/dns/dnshomede/) | [DNSimple](https://go-acme.github.io/lego/dns/dnsimple/) | +| [DirectAdmin](https://go-acme.github.io/lego/dns/directadmin/) | [DNS Made Easy](https://go-acme.github.io/lego/dns/dnsmadeeasy/) | [dnsHome.de](https://go-acme.github.io/lego/dns/dnshomede/) | [DNSimple](https://go-acme.github.io/lego/dns/dnsimple/) | | [DNSPod (deprecated)](https://go-acme.github.io/lego/dns/dnspod/) | [Domain Offensive (do.de)](https://go-acme.github.io/lego/dns/dode/) | [Domeneshop](https://go-acme.github.io/lego/dns/domeneshop/) | [DreamHost](https://go-acme.github.io/lego/dns/dreamhost/) | | [Duck DNS](https://go-acme.github.io/lego/dns/duckdns/) | [Dyn](https://go-acme.github.io/lego/dns/dyn/) | [Dynu](https://go-acme.github.io/lego/dns/dynu/) | [EasyDNS](https://go-acme.github.io/lego/dns/easydns/) | | [Efficient IP](https://go-acme.github.io/lego/dns/efficientip/) | [Epik](https://go-acme.github.io/lego/dns/epik/) | [Exoscale](https://go-acme.github.io/lego/dns/exoscale/) | [External program](https://go-acme.github.io/lego/dns/exec/) | diff --git a/cmd/zz_gen_cmd_dnshelp.go b/cmd/zz_gen_cmd_dnshelp.go index 06134760..85961d59 100644 --- a/cmd/zz_gen_cmd_dnshelp.go +++ b/cmd/zz_gen_cmd_dnshelp.go @@ -736,9 +736,9 @@ func displayDNSHelp(w io.Writer, name string) error { case "directadmin": // generated from: providers/dns/directadmin/directadmin.toml - ew.writeln(`Configuration for directadmin.`) + ew.writeln(`Configuration for DirectAdmin.`) ew.writeln(`Code: 'directadmin'`) - ew.writeln(`Since: ''`) + ew.writeln(`Since: 'v4.18.0'`) ew.writeln() ew.writeln(`Credentials:`) @@ -752,7 +752,7 @@ func displayDNSHelp(w io.Writer, name string) error { ew.writeln(` - "DIRECTADMIN_POLLING_INTERVAL": Time between DNS propagation check`) ew.writeln(` - "DIRECTADMIN_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`) ew.writeln(` - "DIRECTADMIN_TTL": The TTL of the TXT record used for the DNS challenge`) - ew.writeln(` - "DIRECTADMIN_ZONE_NAME": API password`) + ew.writeln(` - "DIRECTADMIN_ZONE_NAME": Zone name used to add the TXT record`) ew.writeln() ew.writeln(`More information: https://go-acme.github.io/lego/dns/directadmin`) diff --git a/docs/content/dns/zz_gen_directadmin.md b/docs/content/dns/zz_gen_directadmin.md index bf8d0bf7..3e96c45a 100644 --- a/docs/content/dns/zz_gen_directadmin.md +++ b/docs/content/dns/zz_gen_directadmin.md @@ -1,34 +1,35 @@ --- -title: "directadmin" +title: "DirectAdmin" date: 2019-03-03T16:39:46+01:00 draft: false slug: directadmin dnsprovider: - since: "" + since: "v4.18.0" code: "directadmin" - url: "directadmin" + url: "https://www.directadmin.com" --- -directadmin api + +Configuration for [DirectAdmin](https://www.directadmin.com). - Code: `directadmin` -- Since: +- Since: v4.18.0 -Here is an example bash command using the directadmin provider: +Here is an example bash command using the DirectAdmin provider: ```bash DIRECTADMIN_API_URL="http://example.com:2222" \ DIRECTADMIN_USERNAME=xxxx \ DIRECTADMIN_PASSWORD=yyy \ -lego --email you@example.com --dns directadmin -d "my.example.org" -d "*.example.org" run +lego --email you@example.com --dns directadmin --domains my.example.org run ``` @@ -54,7 +55,7 @@ More information [here]({{< ref "dns#configuration-and-credentials" >}}). | `DIRECTADMIN_POLLING_INTERVAL` | Time between DNS propagation check | | `DIRECTADMIN_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation | | `DIRECTADMIN_TTL` | The TTL of the TXT record used for the DNS challenge | -| `DIRECTADMIN_ZONE_NAME` | API password | +| `DIRECTADMIN_ZONE_NAME` | Zone name used to add the TXT record | The environment variable names can be suffixed by `_FILE` to reference a file instead of a value. More information [here]({{< ref "dns#configuration-and-credentials" >}}). diff --git a/providers/dns/directadmin/directadmin.go b/providers/dns/directadmin/directadmin.go index 5ce07b12..b25aff81 100644 --- a/providers/dns/directadmin/directadmin.go +++ b/providers/dns/directadmin/directadmin.go @@ -92,6 +92,10 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) { return nil, fmt.Errorf("directadmin: %w", err) } + if config.HTTPClient != nil { + client.HTTPClient = config.HTTPClient + } + return &DNSProvider{client: client, config: config}, nil } diff --git a/providers/dns/directadmin/directadmin.toml b/providers/dns/directadmin/directadmin.toml index b676cf5b..0ad08f15 100644 --- a/providers/dns/directadmin/directadmin.toml +++ b/providers/dns/directadmin/directadmin.toml @@ -1,14 +1,14 @@ -Name = "directadmin" -Description = '''directadmin api''' -URL = "directadmin" +Name = "DirectAdmin" +Description = '''''' +URL = "https://www.directadmin.com" Code = "directadmin" - +Since = "v4.18.0" Example = ''' DIRECTADMIN_API_URL="http://example.com:2222" \ DIRECTADMIN_USERNAME=xxxx \ DIRECTADMIN_PASSWORD=yyy \ -lego --email you@example.com --dns directadmin -d "my.example.org" -d "*.example.org" run +lego --email you@example.com --dns directadmin --domains my.example.org run ''' [Configuration] @@ -17,7 +17,7 @@ lego --email you@example.com --dns directadmin -d "my.example.org" -d "*.example DIRECTADMIN_USERNAME = "API username" DIRECTADMIN_PASSWORD = "API password" [Configuration.Additional] - DIRECTADMIN_ZONE_NAME = "API password" + DIRECTADMIN_ZONE_NAME = "Zone name used to add the TXT record" DIRECTADMIN_POLLING_INTERVAL = "Time between DNS propagation check" DIRECTADMIN_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation" DIRECTADMIN_TTL = "The TTL of the TXT record used for the DNS challenge" diff --git a/providers/dns/directadmin/directadmin_test.go b/providers/dns/directadmin/directadmin_test.go index 5d91e8c3..10c079f7 100644 --- a/providers/dns/directadmin/directadmin_test.go +++ b/providers/dns/directadmin/directadmin_test.go @@ -20,7 +20,7 @@ func TestNewDNSProvider(t *testing.T) { { desc: "success", envVars: map[string]string{ - EnvAPIURL: "https://exmaple.com:2222", + EnvAPIURL: "https://example.com:2222", EnvUsername: "test", EnvPassword: "secret", }, @@ -41,7 +41,7 @@ func TestNewDNSProvider(t *testing.T) { { desc: "missing username", envVars: map[string]string{ - EnvAPIURL: "https://exmaple.com:2222", + EnvAPIURL: "https://example.com:2222", EnvPassword: "secret", }, expected: "directadmin: some credentials information are missing: DIRECTADMIN_USERNAME", @@ -49,7 +49,7 @@ func TestNewDNSProvider(t *testing.T) { { desc: "missing password", envVars: map[string]string{ - EnvAPIURL: "https://exmaple.com:2222", + EnvAPIURL: "https://example.com:2222", EnvUsername: "test", }, expected: "directadmin: some credentials information are missing: DIRECTADMIN_PASSWORD", @@ -87,7 +87,7 @@ func TestNewDNSProviderConfig(t *testing.T) { }{ { desc: "success", - baseURL: "https://api.directadmin.com", + baseURL: "https://example.com", username: "test", password: "secret", }, @@ -97,12 +97,12 @@ func TestNewDNSProviderConfig(t *testing.T) { }, { desc: "missing username", - baseURL: "https://api.directadmin.com", + baseURL: "https://example.com", expected: "directadmin: some credentials information are missing", }, { desc: "missing password", - baseURL: "https://api.directadmin.com", + baseURL: "https://example.com", username: "test", expected: "directadmin: some credentials information are missing", },