@@ -16,25 +16,28 @@ import (
16
16
17
17
const (
18
18
testName = "riseupvpn"
19
- testVersion = "0.2 .0"
19
+ testVersion = "0.3 .0"
20
20
eipServiceURL = "https://api.black.riseup.net:443/3/config/eip-service.json"
21
21
providerURL = "https://riseup.net/provider.json"
22
22
geoServiceURL = "https://api.black.riseup.net:9001/json"
23
23
tcpConnect = "tcpconnect://"
24
24
)
25
25
26
- // EipService is the main JSON object of eip-service.json.
27
- type EipService struct {
26
+ // EIPServiceV3 is the main JSON object returned by eip-service.json.
27
+ type EIPServiceV3 struct {
28
28
Gateways []GatewayV3
29
29
}
30
30
31
+ // CapabilitiesV3 is a list of transports a gateway supports
32
+ type CapabilitiesV3 struct {
33
+ Transport []TransportV3
34
+ }
35
+
31
36
// GatewayV3 describes a gateway.
32
37
type GatewayV3 struct {
33
- Capabilities struct {
34
- Transport []TransportV3
35
- }
36
- Host string
37
- IPAddress string `json:"ip_address"`
38
+ Capabilities CapabilitiesV3
39
+ Host string
40
+ IPAddress string `json:"ip_address"`
38
41
}
39
42
40
43
// TransportV3 describes a transport.
@@ -203,7 +206,7 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
203
206
FailOnHTTPError : true ,
204
207
}},
205
208
}
206
- for entry := range multi .CollectOverall (ctx , inputs , 0 , 50 , "riseupvpn" , callbacks ) {
209
+ for entry := range multi .CollectOverall (ctx , inputs , 0 , 20 , "riseupvpn" , callbacks ) {
207
210
tk := entry .TestKeys
208
211
testkeys .AddCACertFetchTestKeys (tk )
209
212
if tk .Failure != nil {
@@ -241,7 +244,7 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
241
244
FailOnHTTPError : true ,
242
245
}},
243
246
}
244
- for entry := range multi .CollectOverall (ctx , inputs , 1 , 50 , "riseupvpn" , callbacks ) {
247
+ for entry := range multi .CollectOverall (ctx , inputs , 1 , 20 , "riseupvpn" , callbacks ) {
245
248
testkeys .UpdateProviderAPITestKeys (entry )
246
249
}
247
250
@@ -251,19 +254,21 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
251
254
openvpnEndpoints := generateMultiInputs (gateways , "openvpn" )
252
255
obfs4Endpoints := generateMultiInputs (gateways , "obfs4" )
253
256
overallCount := 1 + len (inputs ) + len (openvpnEndpoints ) + len (obfs4Endpoints )
257
+ startCount := 1 + len (inputs )
254
258
255
259
// measure openvpn in parallel
256
260
for entry := range multi .CollectOverall (
257
- ctx , openvpnEndpoints , 1 + len ( inputs ) , overallCount , "riseupvpn" , callbacks ) {
261
+ ctx , openvpnEndpoints , startCount , overallCount , "riseupvpn" , callbacks ) {
258
262
testkeys .AddGatewayConnectTestKeys (entry , "openvpn" )
259
263
}
260
264
261
265
// measure obfs4 in parallel
262
266
// TODO(bassosimone): when urlgetter is able to do obfs4 handshakes, here
263
267
// can possibly also test for the obfs4 handshake.
264
268
// See https://github.com/ooni/probe/issues/1463.
269
+ startCount += len (openvpnEndpoints )
265
270
for entry := range multi .CollectOverall (
266
- ctx , obfs4Endpoints , 1 + len ( inputs ) + len ( openvpnEndpoints ) , overallCount , "riseupvpn" , callbacks ) {
271
+ ctx , obfs4Endpoints , startCount , overallCount , "riseupvpn" , callbacks ) {
267
272
testkeys .AddGatewayConnectTestKeys (entry , "obfs4" )
268
273
}
269
274
@@ -303,7 +308,7 @@ func parseGateways(testKeys *TestKeys) []GatewayV3 {
303
308
// TODO(bassosimone,cyberta): is it reasonable that we discard
304
309
// the error when the JSON we fetched cannot be parsed?
305
310
// See https://github.com/ooni/probe/issues/1432
306
- eipService , err := DecodeEIP3 (string (requestEntry .Response .Body ))
311
+ eipService , err := DecodeEIPServiceV3 (string (requestEntry .Response .Body ))
307
312
if err == nil {
308
313
return eipService .Gateways
309
314
}
@@ -312,9 +317,9 @@ func parseGateways(testKeys *TestKeys) []GatewayV3 {
312
317
return nil
313
318
}
314
319
315
- // DecodeEIP3 decodes eip-service.json version 3
316
- func DecodeEIP3 (body string ) (* EipService , error ) {
317
- var eip EipService
320
+ // DecodeEIPServiceV3 decodes eip-service.json version 3
321
+ func DecodeEIPServiceV3 (body string ) (* EIPServiceV3 , error ) {
322
+ var eip EIPServiceV3
318
323
err := json .Unmarshal ([]byte (body ), & eip )
319
324
if err != nil {
320
325
return nil , err
0 commit comments