Browse Source
httpcaddyfile: Add resolvers subdir of tls (close #4008 )
Allows conveniently setting the resolvers for the DNS challenge using a TLS subdirective, which applies to default issuers, rather than having to explicitly define the issuers and overwrite the defaults.
master
Matthew Holt
4 years ago
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with
18 additions and
0 deletions
caddyconfig/httpcaddyfile/builtins.go
@ -316,6 +316,8 @@ func parseTLS(h Helper) ([]ConfigValue, error) {
}
if acmeIssuer . Challenges == nil {
acmeIssuer . Challenges = new ( caddytls . ChallengesConfig )
}
if acmeIssuer . Challenges . DNS == nil {
acmeIssuer . Challenges . DNS = new ( caddytls . DNSChallengeConfig )
}
modID := "dns.providers." + provName
@ -325,6 +327,22 @@ func parseTLS(h Helper) ([]ConfigValue, error) {
}
acmeIssuer . Challenges . DNS . ProviderRaw = caddyconfig . JSONModuleObject ( unm , "name" , provName , h . warnings )
case "resolvers" :
args := h . RemainingArgs ( )
if len ( args ) == 0 {
return nil , h . ArgErr ( )
}
if acmeIssuer == nil {
acmeIssuer = new ( caddytls . ACMEIssuer )
}
if acmeIssuer . Challenges == nil {
acmeIssuer . Challenges = new ( caddytls . ChallengesConfig )
}
if acmeIssuer . Challenges . DNS == nil {
acmeIssuer . Challenges . DNS = new ( caddytls . DNSChallengeConfig )
}
acmeIssuer . Challenges . DNS . Resolvers = args
case "ca_root" :
arg := h . RemainingArgs ( )
if len ( arg ) != 1 {