1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

AUTODNSSEC -> AUTODNSSEC_ON (#863)

* AUTODNSSEC -> AUTODNSSEC_ON
* Validate AutoDNSSEC values
* AUTODNSSEC now generates a warning and does nothing.
This commit is contained in:
Tom Limoncelli
2020-09-27 16:37:42 -04:00
committed by GitHub
parent 9953bf41e9
commit f082ad36c8
15 changed files with 228 additions and 154 deletions

View File

@@ -392,11 +392,20 @@ func ValidateAndNormalizeConfig(config *models.DNSConfig) (errs []error) {
errs = append(errs, fmt.Errorf("record named '%s' does not have correct FQDN for domain '%s'. FQDN: %s", r.Name, d.Name, r.NameFQDN))
}
}
// Verify AutoDNSSEC is valid.
errs = append(errs, checkAutoDNSSEC(d)...)
}
return errs
}
func checkAutoDNSSEC(dc *models.DomainConfig) (errs []error) {
if dc.AutoDNSSEC != "" && dc.AutoDNSSEC != "on" && dc.AutoDNSSEC != "off" {
errs = append(errs, fmt.Errorf("Domain %q AutoDNSSEC=%q is invalid (expecting \"\", \"off\", or \"on\")", dc.Name, dc.AutoDNSSEC))
}
return
}
func checkCNAMEs(dc *models.DomainConfig) (errs []error) {
cnames := map[string]bool{}
for _, r := range dc.Records {
@@ -510,7 +519,7 @@ func checkProviderCapabilities(dc *models.DomainConfig) error {
hasAny := false
switch ty.rType {
case "AUTODNSSEC":
if dc.AutoDNSSEC {
if dc.AutoDNSSEC != "" {
hasAny = true
}
default: