@@ -16,25 +16,28 @@ import (
1616
1717const (
1818 testName = "riseupvpn"
19- testVersion = "0.2 .0"
19+ testVersion = "0.3 .0"
2020 eipServiceURL = "https://api.black.riseup.net:443/3/config/eip-service.json"
2121 providerURL = "https://riseup.net/provider.json"
2222 geoServiceURL = "https://api.black.riseup.net:9001/json"
2323 tcpConnect = "tcpconnect://"
2424)
2525
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 {
2828 Gateways []GatewayV3
2929}
3030
31+ // CapabilitiesV3 is a list of transports a gateway supports
32+ type CapabilitiesV3 struct {
33+ Transport []TransportV3
34+ }
35+
3136// GatewayV3 describes a gateway.
3237type 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"`
3841}
3942
4043// TransportV3 describes a transport.
@@ -203,7 +206,7 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
203206 FailOnHTTPError : true ,
204207 }},
205208 }
206- for entry := range multi .CollectOverall (ctx , inputs , 0 , 50 , "riseupvpn" , callbacks ) {
209+ for entry := range multi .CollectOverall (ctx , inputs , 0 , 20 , "riseupvpn" , callbacks ) {
207210 tk := entry .TestKeys
208211 testkeys .AddCACertFetchTestKeys (tk )
209212 if tk .Failure != nil {
@@ -241,7 +244,7 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
241244 FailOnHTTPError : true ,
242245 }},
243246 }
244- for entry := range multi .CollectOverall (ctx , inputs , 1 , 50 , "riseupvpn" , callbacks ) {
247+ for entry := range multi .CollectOverall (ctx , inputs , 1 , 20 , "riseupvpn" , callbacks ) {
245248 testkeys .UpdateProviderAPITestKeys (entry )
246249 }
247250
@@ -251,19 +254,21 @@ func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
251254 openvpnEndpoints := generateMultiInputs (gateways , "openvpn" )
252255 obfs4Endpoints := generateMultiInputs (gateways , "obfs4" )
253256 overallCount := 1 + len (inputs ) + len (openvpnEndpoints ) + len (obfs4Endpoints )
257+ startCount := 1 + len (inputs )
254258
255259 // measure openvpn in parallel
256260 for entry := range multi .CollectOverall (
257- ctx , openvpnEndpoints , 1 + len ( inputs ) , overallCount , "riseupvpn" , callbacks ) {
261+ ctx , openvpnEndpoints , startCount , overallCount , "riseupvpn" , callbacks ) {
258262 testkeys .AddGatewayConnectTestKeys (entry , "openvpn" )
259263 }
260264
261265 // measure obfs4 in parallel
262266 // TODO(bassosimone): when urlgetter is able to do obfs4 handshakes, here
263267 // can possibly also test for the obfs4 handshake.
264268 // See https://github.com/ooni/probe/issues/1463.
269+ startCount += len (openvpnEndpoints )
265270 for entry := range multi .CollectOverall (
266- ctx , obfs4Endpoints , 1 + len ( inputs ) + len ( openvpnEndpoints ) , overallCount , "riseupvpn" , callbacks ) {
271+ ctx , obfs4Endpoints , startCount , overallCount , "riseupvpn" , callbacks ) {
267272 testkeys .AddGatewayConnectTestKeys (entry , "obfs4" )
268273 }
269274
@@ -303,7 +308,7 @@ func parseGateways(testKeys *TestKeys) []GatewayV3 {
303308 // TODO(bassosimone,cyberta): is it reasonable that we discard
304309 // the error when the JSON we fetched cannot be parsed?
305310 // See https://github.com/ooni/probe/issues/1432
306- eipService , err := DecodeEIP3 (string (requestEntry .Response .Body ))
311+ eipService , err := DecodeEIPService3 (string (requestEntry .Response .Body ))
307312 if err == nil {
308313 return eipService .Gateways
309314 }
@@ -312,9 +317,9 @@ func parseGateways(testKeys *TestKeys) []GatewayV3 {
312317 return nil
313318}
314319
315- // DecodeEIP3 decodes eip-service.json version 3
316- func DecodeEIP3 (body string ) (* EipService , error ) {
317- var eip EipService
320+ // DecodeEIPService3 decodes eip-service.json version 3
321+ func DecodeEIPService3 (body string ) (* EIPServiceV3 , error ) {
322+ var eip EIPServiceV3
318323 err := json .Unmarshal ([]byte (body ), & eip )
319324 if err != nil {
320325 return nil , err
0 commit comments