Skip to content

Commit bf0673c

Browse files
DNS config refactoring
1 parent 61394e4 commit bf0673c

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

cmd/boulder-ra/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ func main() {
3939
rai := ra.NewRegistrationAuthorityImpl()
4040
rai.AuthzBase = c.Common.BaseURL + wfe.AuthzPath
4141
rai.MaxKeySize = c.Common.MaxKeySize
42-
raDNSTimeout, err := time.ParseDuration(c.RA.DNSTimeout)
42+
raDNSTimeout, err := time.ParseDuration(c.Common.DNSTimeout)
4343
cmd.FailOnError(err, "Couldn't parse RA DNS timeout")
44-
rai.DNSResolver = core.NewDNSResolverImpl(raDNSTimeout, []string{c.RA.DNSResolver})
44+
rai.DNSResolver = core.NewDNSResolverImpl(raDNSTimeout, []string{c.Common.DNSResolver})
4545

4646
go cmd.ProfileCmd("RA", stats)
4747

cmd/boulder-va/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ func main() {
3838
go cmd.ProfileCmd("VA", stats)
3939

4040
vai := va.NewValidationAuthorityImpl(c.CA.TestMode)
41-
dnsTimeout, err := time.ParseDuration(c.VA.DNSTimeout)
41+
dnsTimeout, err := time.ParseDuration(c.Common.DNSTimeout)
4242
cmd.FailOnError(err, "Couldn't parse DNS timeout")
43-
vai.DNSResolver = core.NewDNSResolverImpl(dnsTimeout, []string{c.VA.DNSResolver})
43+
vai.DNSResolver = core.NewDNSResolverImpl(dnsTimeout, []string{c.Common.DNSResolver})
4444
vai.UserAgent = c.VA.UserAgent
4545

4646
for {

cmd/shell.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ type Config struct {
9090
}
9191

9292
RA struct {
93-
DNSResolver string
94-
DNSTimeout string
95-
9693
// DebugAddr is the address to run the /debug handlers on.
9794
DebugAddr string
9895
}
@@ -106,9 +103,7 @@ type Config struct {
106103
}
107104

108105
VA struct {
109-
DNSResolver string
110-
DNSTimeout string
111-
UserAgent string
106+
UserAgent string
112107

113108
// DebugAddr is the address to run the /debug handlers on.
114109
DebugAddr string
@@ -167,6 +162,9 @@ type Config struct {
167162
// Path to a PEM-encoded copy of the issuer certificate.
168163
IssuerCert string
169164
MaxKeySize int
165+
166+
DNSResolver string
167+
DNSTimeout string
170168
}
171169

172170
SubscriberAgreementURL string

test/boulder-config.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@
114114
},
115115

116116
"ra": {
117-
"dnsResolver": "8.8.8.8:53",
118-
"dnsTimeout": "10s",
119117
"debugAddr": "localhost:8002"
120118
},
121119

@@ -126,8 +124,6 @@
126124
},
127125

128126
"va": {
129-
"dnsResolver": "8.8.8.8:53",
130-
"dnsTimeout": "10s",
131127
"userAgent": "boulder",
132128
"debugAddr": "localhost:8004"
133129
},
@@ -171,7 +167,9 @@
171167
"common": {
172168
"baseURL": "http://localhost:4000",
173169
"issuerCert": "test/test-ca.pem",
174-
"maxKeySize": 4096
170+
"maxKeySize": 4096,
171+
"dnsResolver": "8.8.8.8:53",
172+
"dnsTimeout": "10s"
175173
},
176174

177175
"subscriberAgreementURL": "http://localhost:4300/terms"

test/boulder-pkcs11-example-config.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@
101101
},
102102

103103
"ra": {
104-
"dnsResolver": "8.8.8.8:53",
105-
"dnsTimeout": "10s",
106104
"debugAddr": "localhost:8002"
107105
},
108106

@@ -112,6 +110,11 @@
112110
"debugAddr": "localhost:8003"
113111
},
114112

113+
"va": {
114+
"userAgent": "boulder",
115+
"debugAddr": "localhost:8004"
116+
},
117+
115118
"sql": {
116119
"SQLDebug": true,
117120
"CreateTables": true
@@ -150,7 +153,9 @@
150153

151154
"common": {
152155
"baseURL": "http://localhost:4000",
153-
"issuerCert": "test/test-ca.pem"
156+
"issuerCert": "test/test-ca.pem",
157+
"dnsResolver": "8.8.8.8:53",
158+
"dnsTimeout": "10s"
154159
},
155160

156161
"subscriberAgreementURL": "http://localhost:4000/terms"

test/boulder-test-config.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@
105105
},
106106

107107
"ra": {
108-
"dnsResolver": "127.0.0.1:8053",
109-
"dnsTimeout": "10s",
110108
"debugAddr": "localhost:8002"
111109
},
112110

@@ -117,8 +115,6 @@
117115
},
118116

119117
"va": {
120-
"dnsResolver": "127.0.0.1:8053",
121-
"dnsTimeout": "10s",
122118
"userAgent": "boulder",
123119
"debugAddr": "localhost:8004"
124120
},
@@ -138,7 +134,9 @@
138134
"common": {
139135
"baseURL": "http://localhost:4300",
140136
"issuerCert": "test/test-ca.pem",
141-
"maxKeySize": 4096
137+
"maxKeySize": 4096,
138+
"dnsResolver": "127.0.0.1:8053",
139+
"dnsTimeout": "10s"
142140
},
143141

144142
"subscriberAgreementURL": "http://example.com/terms"

0 commit comments

Comments
 (0)