netcup: remove TTL option (#2396)

This commit is contained in:
Ludovic Fernandez 2025-01-10 16:17:25 +01:00 committed by GitHub
commit 4c65680b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 6 additions and 11 deletions

View file

@ -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`)

View file

@ -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" %}}).

View file

@ -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

View file

@ -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.

View file

@ -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)

View file

@ -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]