DNS config refactoring

This commit is contained in:
Roland Shoemaker 2015-07-22 15:54:40 -07:00
parent 61394e4f2d
commit bf0673c35f
6 changed files with 22 additions and 23 deletions

View File

@ -39,9 +39,9 @@ func main() {
rai := ra.NewRegistrationAuthorityImpl() rai := ra.NewRegistrationAuthorityImpl()
rai.AuthzBase = c.Common.BaseURL + wfe.AuthzPath rai.AuthzBase = c.Common.BaseURL + wfe.AuthzPath
rai.MaxKeySize = c.Common.MaxKeySize rai.MaxKeySize = c.Common.MaxKeySize
raDNSTimeout, err := time.ParseDuration(c.RA.DNSTimeout) raDNSTimeout, err := time.ParseDuration(c.Common.DNSTimeout)
cmd.FailOnError(err, "Couldn't parse RA DNS timeout") cmd.FailOnError(err, "Couldn't parse RA DNS timeout")
rai.DNSResolver = core.NewDNSResolverImpl(raDNSTimeout, []string{c.RA.DNSResolver}) rai.DNSResolver = core.NewDNSResolverImpl(raDNSTimeout, []string{c.Common.DNSResolver})
go cmd.ProfileCmd("RA", stats) go cmd.ProfileCmd("RA", stats)

View File

@ -38,9 +38,9 @@ func main() {
go cmd.ProfileCmd("VA", stats) go cmd.ProfileCmd("VA", stats)
vai := va.NewValidationAuthorityImpl(c.CA.TestMode) vai := va.NewValidationAuthorityImpl(c.CA.TestMode)
dnsTimeout, err := time.ParseDuration(c.VA.DNSTimeout) dnsTimeout, err := time.ParseDuration(c.Common.DNSTimeout)
cmd.FailOnError(err, "Couldn't parse DNS timeout") cmd.FailOnError(err, "Couldn't parse DNS timeout")
vai.DNSResolver = core.NewDNSResolverImpl(dnsTimeout, []string{c.VA.DNSResolver}) vai.DNSResolver = core.NewDNSResolverImpl(dnsTimeout, []string{c.Common.DNSResolver})
vai.UserAgent = c.VA.UserAgent vai.UserAgent = c.VA.UserAgent
for { for {

View File

@ -90,9 +90,6 @@ type Config struct {
} }
RA struct { RA struct {
DNSResolver string
DNSTimeout string
// DebugAddr is the address to run the /debug handlers on. // DebugAddr is the address to run the /debug handlers on.
DebugAddr string DebugAddr string
} }
@ -106,9 +103,7 @@ type Config struct {
} }
VA struct { VA struct {
DNSResolver string UserAgent string
DNSTimeout string
UserAgent string
// DebugAddr is the address to run the /debug handlers on. // DebugAddr is the address to run the /debug handlers on.
DebugAddr string DebugAddr string
@ -167,6 +162,9 @@ type Config struct {
// Path to a PEM-encoded copy of the issuer certificate. // Path to a PEM-encoded copy of the issuer certificate.
IssuerCert string IssuerCert string
MaxKeySize int MaxKeySize int
DNSResolver string
DNSTimeout string
} }
SubscriberAgreementURL string SubscriberAgreementURL string

View File

@ -114,8 +114,6 @@
}, },
"ra": { "ra": {
"dnsResolver": "8.8.8.8:53",
"dnsTimeout": "10s",
"debugAddr": "localhost:8002" "debugAddr": "localhost:8002"
}, },
@ -126,8 +124,6 @@
}, },
"va": { "va": {
"dnsResolver": "8.8.8.8:53",
"dnsTimeout": "10s",
"userAgent": "boulder", "userAgent": "boulder",
"debugAddr": "localhost:8004" "debugAddr": "localhost:8004"
}, },
@ -171,7 +167,9 @@
"common": { "common": {
"baseURL": "http://localhost:4000", "baseURL": "http://localhost:4000",
"issuerCert": "test/test-ca.pem", "issuerCert": "test/test-ca.pem",
"maxKeySize": 4096 "maxKeySize": 4096,
"dnsResolver": "8.8.8.8:53",
"dnsTimeout": "10s"
}, },
"subscriberAgreementURL": "http://localhost:4300/terms" "subscriberAgreementURL": "http://localhost:4300/terms"

View File

@ -101,8 +101,6 @@
}, },
"ra": { "ra": {
"dnsResolver": "8.8.8.8:53",
"dnsTimeout": "10s",
"debugAddr": "localhost:8002" "debugAddr": "localhost:8002"
}, },
@ -112,6 +110,11 @@
"debugAddr": "localhost:8003" "debugAddr": "localhost:8003"
}, },
"va": {
"userAgent": "boulder",
"debugAddr": "localhost:8004"
},
"sql": { "sql": {
"SQLDebug": true, "SQLDebug": true,
"CreateTables": true "CreateTables": true
@ -150,7 +153,9 @@
"common": { "common": {
"baseURL": "http://localhost:4000", "baseURL": "http://localhost:4000",
"issuerCert": "test/test-ca.pem" "issuerCert": "test/test-ca.pem",
"dnsResolver": "8.8.8.8:53",
"dnsTimeout": "10s"
}, },
"subscriberAgreementURL": "http://localhost:4000/terms" "subscriberAgreementURL": "http://localhost:4000/terms"

View File

@ -105,8 +105,6 @@
}, },
"ra": { "ra": {
"dnsResolver": "127.0.0.1:8053",
"dnsTimeout": "10s",
"debugAddr": "localhost:8002" "debugAddr": "localhost:8002"
}, },
@ -117,8 +115,6 @@
}, },
"va": { "va": {
"dnsResolver": "127.0.0.1:8053",
"dnsTimeout": "10s",
"userAgent": "boulder", "userAgent": "boulder",
"debugAddr": "localhost:8004" "debugAddr": "localhost:8004"
}, },
@ -138,7 +134,9 @@
"common": { "common": {
"baseURL": "http://localhost:4300", "baseURL": "http://localhost:4300",
"issuerCert": "test/test-ca.pem", "issuerCert": "test/test-ca.pem",
"maxKeySize": 4096 "maxKeySize": 4096,
"dnsResolver": "127.0.0.1:8053",
"dnsTimeout": "10s"
}, },
"subscriberAgreementURL": "http://example.com/terms" "subscriberAgreementURL": "http://example.com/terms"