Skip to content

Commit

Permalink
netcup: remove TTL option (#2396)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Jan 10, 2025
1 parent c2b88e1 commit 4c65680
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion cmd/zz_gen_cmd_dnshelp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/content/dns/zz_gen_netcup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}}).
Expand Down
3 changes: 0 additions & 3 deletions providers/dns/netcup/internal/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ func TestClient_GetDNSRecords(t *testing.T) {
Destination: "bGVnbzE=",
DeleteRecord: false,
State: "yes",
TTL: 300,
}, {
ID: 2,
Hostname: "example2.com",
Expand All @@ -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")
Expand Down Expand Up @@ -363,7 +361,6 @@ func TestClient_UpdateDNSRecord_Live(t *testing.T) {
RecordType: "TXT",
Destination: "asdf5678",
DeleteRecord: false,
TTL: 120,
}

// test
Expand Down
1 change: 0 additions & 1 deletion providers/dns/netcup/internal/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 6 additions & 4 deletions providers/dns/netcup/netcup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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{
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion providers/dns/netcup/netcup.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ lego --email [email protected] --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]
Expand Down

0 comments on commit 4c65680

Please sign in to comment.