From 4c65680b7a9b3926ae7ef445623b2daddf642be2 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 10 Jan 2025 16:17:25 +0100 Subject: [PATCH] netcup: remove TTL option (#2396) --- cmd/zz_gen_cmd_dnshelp.go | 1 - docs/content/dns/zz_gen_netcup.md | 1 - providers/dns/netcup/internal/client_test.go | 3 --- providers/dns/netcup/internal/types.go | 1 - providers/dns/netcup/netcup.go | 10 ++++++---- providers/dns/netcup/netcup.toml | 1 - 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cmd/zz_gen_cmd_dnshelp.go b/cmd/zz_gen_cmd_dnshelp.go index e529ce234..6f6dc8858 100644 --- a/cmd/zz_gen_cmd_dnshelp.go +++ b/cmd/zz_gen_cmd_dnshelp.go @@ -2088,7 +2088,6 @@ func displayDNSHelp(w io.Writer, name string) error { ew.writeln(` - "NETCUP_HTTP_TIMEOUT": API request timeout`) ew.writeln(` - "NETCUP_POLLING_INTERVAL": Time between DNS propagation check`) ew.writeln(` - "NETCUP_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`) - ew.writeln(` - "NETCUP_TTL": The TTL of the TXT record used for the DNS challenge`) ew.writeln() ew.writeln(`More information: https://go-acme.github.io/lego/dns/netcup`) diff --git a/docs/content/dns/zz_gen_netcup.md b/docs/content/dns/zz_gen_netcup.md index e1973c814..cd19c45c6 100644 --- a/docs/content/dns/zz_gen_netcup.md +++ b/docs/content/dns/zz_gen_netcup.md @@ -54,7 +54,6 @@ More information [here]({{% ref "dns#configuration-and-credentials" %}}). | `NETCUP_HTTP_TIMEOUT` | API request timeout | | `NETCUP_POLLING_INTERVAL` | Time between DNS propagation check | | `NETCUP_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation | -| `NETCUP_TTL` | The TTL of the TXT record used for the DNS challenge | 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/netcup/internal/client_test.go b/providers/dns/netcup/internal/client_test.go index 0e028e881..da70e65e0 100644 --- a/providers/dns/netcup/internal/client_test.go +++ b/providers/dns/netcup/internal/client_test.go @@ -202,7 +202,6 @@ func TestClient_GetDNSRecords(t *testing.T) { Destination: "bGVnbzE=", DeleteRecord: false, State: "yes", - TTL: 300, }, { ID: 2, Hostname: "example2.com", @@ -211,7 +210,6 @@ func TestClient_GetDNSRecords(t *testing.T) { Destination: "bGVnbw==", DeleteRecord: false, State: "yes", - TTL: 300, }} records, err := client.GetDNSRecords(context.Background(), "example.com") @@ -363,7 +361,6 @@ func TestClient_UpdateDNSRecord_Live(t *testing.T) { RecordType: "TXT", Destination: "asdf5678", DeleteRecord: false, - TTL: 120, } // test diff --git a/providers/dns/netcup/internal/types.go b/providers/dns/netcup/internal/types.go index 55212f909..e4cc5ec14 100644 --- a/providers/dns/netcup/internal/types.go +++ b/providers/dns/netcup/internal/types.go @@ -72,7 +72,6 @@ type DNSRecord struct { Destination string `json:"destination"` DeleteRecord bool `json:"deleterecord,omitempty"` State string `json:"state,omitempty"` - TTL int `json:"ttl,omitempty"` } // ResponseMsg as specified in netcup WSDL. diff --git a/providers/dns/netcup/netcup.go b/providers/dns/netcup/netcup.go index b0ef4a2bf..4f4500e90 100644 --- a/providers/dns/netcup/netcup.go +++ b/providers/dns/netcup/netcup.go @@ -24,7 +24,9 @@ const ( EnvAPIKey = envNamespace + "API_KEY" EnvAPIPassword = envNamespace + "API_PASSWORD" - EnvTTL = envNamespace + "TTL" + // Deprecated: the TTL is not configurable on record. + EnvTTL = envNamespace + "TTL" + EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT" EnvPollingInterval = envNamespace + "POLLING_INTERVAL" EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT" @@ -37,16 +39,17 @@ type Config struct { Key string Password string Customer string - TTL int PropagationTimeout time.Duration PollingInterval time.Duration HTTPClient *http.Client + + // Deprecated: the TTL is not configurable on record. + TTL int } // NewDefaultConfig returns a default configuration for the DNSProvider. func NewDefaultConfig() *Config { return &Config{ - TTL: env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL), PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 15*time.Minute), PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, 30*time.Second), HTTPClient: &http.Client{ @@ -120,7 +123,6 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { Hostname: hostname, RecordType: "TXT", Destination: info.Value, - TTL: d.config.TTL, } zone = dns01.UnFqdn(zone) diff --git a/providers/dns/netcup/netcup.toml b/providers/dns/netcup/netcup.toml index 0954d07d6..67c52cf04 100644 --- a/providers/dns/netcup/netcup.toml +++ b/providers/dns/netcup/netcup.toml @@ -19,7 +19,6 @@ lego --email you@example.com --dns netcup -d '*.example.com' -d example.com run [Configuration.Additional] NETCUP_POLLING_INTERVAL = "Time between DNS propagation check" NETCUP_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation" - NETCUP_TTL = "The TTL of the TXT record used for the DNS challenge" NETCUP_HTTP_TIMEOUT = "API request timeout" [Links]