mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-04-05 08:54:09 -04:00
fix(netcup): allow wildcard domains (#863)
This commit is contained in:
@@ -26,7 +26,7 @@ Also keep in mind, that TTL, Expire, Retry and Refresh values of the given Domai
|
||||
|
||||
### Compulsory parameters
|
||||
|
||||
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`).
|
||||
- `"domain"` is the domain to update. It can be `example.com` (root domain) or `sub.example.com` (subdomain of `example.com`) or the wildcard `*.example.com`.
|
||||
- `"api_key"` is your api key (generated in the [customercontrolpanel](https://www.customercontrolpanel.de))
|
||||
- `"password"` is your api password (generated in the [customercontrolpanel](https://www.customercontrolpanel.de)). Netcup only allows one ApiPassword. This is not the account password. This password is used for all api keys.
|
||||
- `"customer_number"` is your customer number (viewable in the [customercontrolpanel](https://www.customercontrolpanel.de) next to your name). As seen in the example above, provide the number as string value.
|
||||
|
||||
@@ -38,7 +38,7 @@ func New(data json.RawMessage, domain, owner string,
|
||||
return nil, fmt.Errorf("JSON decoding provider specific settings: %w", err)
|
||||
}
|
||||
|
||||
err = validateSettings(domain, owner, extraSettings.CustomerNumber,
|
||||
err = validateSettings(domain, extraSettings.CustomerNumber,
|
||||
extraSettings.APIKey, extraSettings.Password)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("validating provider specific settings: %w", err)
|
||||
@@ -55,15 +55,13 @@ func New(data json.RawMessage, domain, owner string,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func validateSettings(domain, owner, customerNumber, apiKey, password string) (err error) {
|
||||
func validateSettings(domain, customerNumber, apiKey, password string) (err error) {
|
||||
err = utils.CheckDomain(domain)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w: %w", errors.ErrDomainNotValid, err)
|
||||
}
|
||||
|
||||
switch {
|
||||
case owner == "*":
|
||||
return fmt.Errorf("%w", errors.ErrOwnerWildcard)
|
||||
case customerNumber == "":
|
||||
return fmt.Errorf("%w", errors.ErrCustomerNumberNotSet)
|
||||
case apiKey == "":
|
||||
|
||||
Reference in New Issue
Block a user