-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/web connectivity #9
Conversation
orchestrateBaseURL, | ||
ctl.Ctx.Location.CountryCode) | ||
|
||
resp, err := http.Get(reqURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be able to request this through tor / domain fronting? should we have a central request manager interface to deal with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for sure. This is just quick and dirty prototype code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should also add, that this functionality should actually be part of measurement-kit (that of fetching URL lists from the orchestration backend), however I implemented it inside of gooni for the time being to get the whole prototype working faster.
|
||
body, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return urls, errors.Wrap(err, "failed to read response body") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to have a way to retry built in on failures to interact with the orchestrator, which may be transient?
parsed = new(URLResponse) | ||
urls []string | ||
) | ||
reqURL := fmt.Sprintf("%s/api/v1/urls?probe_cc=%s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a Todo to include other config constraints here, like which categories the user is okay with,
I guess also - in the orchestrator url request, does the client include any form of ID of itself to allow linking of the different requests its making to proteus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah for sure. The nettest class is designed to have knowledge of the config options via ctl.Ctx.Config.Foo
, but currently config support is not complete. As soon as we have the chosen categories as part of the config, it will be possible to pass those to the orchestrator.
My comments were mostly to suggest adding some signpost TODO's in the areas that are going to need additional work so that in the future it's clear where to hook in the additional complexity that's missing from this first pass. This looks good though 👍 |
To generate the result summary we need to refactor how the SummaryMap works
Pass the geoip databases to measurement-kit
} | ||
|
||
// GeoIPDir returns the geoip data dir for the given OONI Home | ||
func GeoIPDir(home string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somethings weird about having these path things split up so that geoid is in util, the db folder is in database/database.go
,
and the creation is in /ooni.go
.
Consider a refactor to make this a bit easier to track down, potentially?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe all the path stuff should go into a path package. It can't live in ooni
or database
, because of circular dependencies.
utils/geoip.go
Outdated
|
||
f, err := os.Open(out.Name()) | ||
// DownloadGeoIPDatabaseFiles into the target directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be an issue on devices with limited memory. The in-process tgz will do worse at being able to do this - in that it isn't streaming the file in the way that a native tar process would. that said, this is nice from a compatibility perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are less than 10MB, so I don't think it's going to be an issue for this particular use case (I think OONI Probe already uses more than that memory in general).
As per suggestion by @willscott in: #9 (comment)
Feature/web connectivity
As per suggestion by @willscott in: ooni#9 (comment)
## Checklist - [x] I have read the [contribution guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md) - [x] reference issue for this pull request: ooni/probe#2650 - [x] if you changed anything related to how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: N/A - [x] if you changed code inside an experiment, make sure you bump its version number ## Description Closes ooni/probe#2650 Here's an example of the output now: ``` % ./miniooni dnsping -i udp://8.8.8.8:53/ -O Domains='www.example.com thepiratebay.net' [ 0.000028] <info> Current time: 2024-01-12 14:48:25 UTC [ 0.000125] <info> miniooni home directory: $HOME/.miniooni [ 0.000319] <info> ooniprobe-engine/v3.21.0-alpha 9b035a4 dirty=false go1.20.12 [ 0.001050] <info> Looking up OONI backends; please be patient... [ 0.001640] <info> httpsDialer: [#1] TCPConnect 162.55.247.208:443... started [ 0.047764] <info> httpsDialer: [#1] TCPConnect 162.55.247.208:443... ok [ 0.047788] <info> httpsDialer: [#1] TLSHandshake with 162.55.247.208:443 SNI=interactive.guim.co.uk ALPN=[h2 http/1.1]... started [ 0.100400] <info> httpsDialer: [#1] TLSHandshake with 162.55.247.208:443 SNI=interactive.guim.co.uk ALPN=[h2 http/1.1]... ok [ 0.100417] <info> httpsDialer: [#1] TLSVerifyCertificateChain api.ooni.io... started [ 0.102877] <info> httpsDialer: [#1] TLSVerifyCertificateChain api.ooni.io... ok [ 0.169226] <info> session: using probe services: {Address:https://api.ooni.io Type:https Front:} [ 0.169246] <info> Looking up your location; please be patient... [ 0.169272] <info> iplookup: using stun_google [ 0.170163] <info> sessionresolver: lookup stun.l.google.com using system:///... started [ 0.172175] <info> sessionresolver: lookup stun.l.google.com using system:///... ok [ 0.190530] <info> - country: IT [ 0.190545] <info> - network: Vodafone Italia S.p.A. (AS30722) [ 0.190549] <info> - resolver's IP: 91.80.36.88 [ 0.190552] <info> - resolver's network: Vodafone Italia S.p.A. (AS30722) [ 0.190587] <info> [1/1] running with input: udp://8.8.8.8:53/ [ 0.190728] <info> DNSPing #0 8.8.8.8:53 thepiratebay.net... started [ 0.190729] <info> DNSPing #0 8.8.8.8:53 www.example.com... started [ 0.201393] <info> DNSPing #0 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 0.212578] <info> DNSPing #0 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 1.191531] <info> DNSPing #1 8.8.8.8:53 thepiratebay.net... started [ 1.191527] <info> DNSPing #1 8.8.8.8:53 www.example.com... started [ 1.199034] <info> DNSPing #1 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 1.208817] <info> DNSPing #1 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 2.191812] <info> DNSPing #2 8.8.8.8:53 thepiratebay.net... started [ 2.191815] <info> DNSPing #2 8.8.8.8:53 www.example.com... started [ 2.228774] <info> DNSPing #2 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 2.228793] <info> DNSPing #2 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 3.191340] <info> DNSPing #3 8.8.8.8:53 thepiratebay.net... started [ 3.191370] <info> DNSPing #3 8.8.8.8:53 www.example.com... started [ 3.197974] <info> DNSPing #3 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 3.211675] <info> DNSPing #3 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 4.191878] <info> DNSPing #4 8.8.8.8:53 www.example.com... started [ 4.191889] <info> DNSPing #4 8.8.8.8:53 thepiratebay.net... started [ 4.203056] <info> DNSPing #4 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 4.211179] <info> DNSPing #4 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 5.191830] <info> DNSPing #5 8.8.8.8:53 www.example.com... started [ 5.191830] <info> DNSPing #5 8.8.8.8:53 thepiratebay.net... started [ 5.233596] <info> DNSPing #5 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 5.261641] <info> DNSPing #5 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 6.191596] <info> DNSPing #6 8.8.8.8:53 thepiratebay.net... started [ 6.191573] <info> DNSPing #6 8.8.8.8:53 www.example.com... started [ 6.200647] <info> DNSPing #6 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 6.208036] <info> DNSPing #6 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 7.191875] <info> DNSPing #7 8.8.8.8:53 thepiratebay.net... started [ 7.191879] <info> DNSPing #7 8.8.8.8:53 www.example.com... started [ 7.200336] <info> DNSPing #7 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 7.213787] <info> DNSPing #7 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 8.191866] <info> DNSPing #8 8.8.8.8:53 thepiratebay.net... started [ 8.191900] <info> DNSPing #8 8.8.8.8:53 www.example.com... started [ 8.204297] <info> DNSPing #8 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 8.214435] <info> DNSPing #8 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 9.191857] <info> DNSPing #9 8.8.8.8:53 www.example.com... started [ 9.191863] <info> DNSPing #9 8.8.8.8:53 thepiratebay.net... started [ 9.200628] <info> DNSPing #9 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 9.216799] <info> DNSPing #9 8.8.8.8:53 thepiratebay.net... 83.224.65.41 Domain IPAddress ASN Org #Seen LateResponse -------------------------------------------------------------------------------------------------------------------------------------------------- www.example.com 2606:2800:220:1:248:1893:25c8:1946 15133 Edgecast Inc. 10 false www.example.com 93.184.216.34 15133 Edgecast Inc. 10 false thepiratebay.net 83.224.65.41 30722 Vodafone Italia S.p.A. 10 false [ 10.193633] <info> submitting measurement to OONI collector; please be patient... [ 10.262480] <info> New reportID: 20240112T144835Z_dnsping_IT_30722_n1_qbyxPwKoifjgp6AM [ 10.372279] <info> saving measurement to disk [ 10.373693] <info> experiment: recv 0.00 byte, sent 0.00 byte [ 10.375159] <info> whole session: recv 2.28 kbyte, sent 19.24 kbyte ```
## Checklist - [x] I have read the [contribution guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md) - [x] reference issue for this pull request: ooni/probe#2650 - [x] if you changed anything related to how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: N/A - [x] if you changed code inside an experiment, make sure you bump its version number ## Description Closes ooni/probe#2650 Here's an example of the output now: ``` % ./miniooni dnsping -i udp://8.8.8.8:53/ -O Domains='www.example.com thepiratebay.net' [ 0.000028] <info> Current time: 2024-01-12 14:48:25 UTC [ 0.000125] <info> miniooni home directory: $HOME/.miniooni [ 0.000319] <info> ooniprobe-engine/v3.21.0-alpha 9b035a4 dirty=false go1.20.12 [ 0.001050] <info> Looking up OONI backends; please be patient... [ 0.001640] <info> httpsDialer: [#1] TCPConnect 162.55.247.208:443... started [ 0.047764] <info> httpsDialer: [#1] TCPConnect 162.55.247.208:443... ok [ 0.047788] <info> httpsDialer: [#1] TLSHandshake with 162.55.247.208:443 SNI=interactive.guim.co.uk ALPN=[h2 http/1.1]... started [ 0.100400] <info> httpsDialer: [#1] TLSHandshake with 162.55.247.208:443 SNI=interactive.guim.co.uk ALPN=[h2 http/1.1]... ok [ 0.100417] <info> httpsDialer: [#1] TLSVerifyCertificateChain api.ooni.io... started [ 0.102877] <info> httpsDialer: [#1] TLSVerifyCertificateChain api.ooni.io... ok [ 0.169226] <info> session: using probe services: {Address:https://api.ooni.io Type:https Front:} [ 0.169246] <info> Looking up your location; please be patient... [ 0.169272] <info> iplookup: using stun_google [ 0.170163] <info> sessionresolver: lookup stun.l.google.com using system:///... started [ 0.172175] <info> sessionresolver: lookup stun.l.google.com using system:///... ok [ 0.190530] <info> - country: IT [ 0.190545] <info> - network: Vodafone Italia S.p.A. (AS30722) [ 0.190549] <info> - resolver's IP: 91.80.36.88 [ 0.190552] <info> - resolver's network: Vodafone Italia S.p.A. (AS30722) [ 0.190587] <info> [1/1] running with input: udp://8.8.8.8:53/ [ 0.190728] <info> DNSPing #0 8.8.8.8:53 thepiratebay.net... started [ 0.190729] <info> DNSPing #0 8.8.8.8:53 www.example.com... started [ 0.201393] <info> DNSPing #0 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 0.212578] <info> DNSPing #0 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 1.191531] <info> DNSPing #1 8.8.8.8:53 thepiratebay.net... started [ 1.191527] <info> DNSPing #1 8.8.8.8:53 www.example.com... started [ 1.199034] <info> DNSPing #1 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 1.208817] <info> DNSPing #1 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 2.191812] <info> DNSPing #2 8.8.8.8:53 thepiratebay.net... started [ 2.191815] <info> DNSPing #2 8.8.8.8:53 www.example.com... started [ 2.228774] <info> DNSPing #2 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 2.228793] <info> DNSPing #2 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 3.191340] <info> DNSPing #3 8.8.8.8:53 thepiratebay.net... started [ 3.191370] <info> DNSPing #3 8.8.8.8:53 www.example.com... started [ 3.197974] <info> DNSPing #3 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 3.211675] <info> DNSPing #3 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 4.191878] <info> DNSPing #4 8.8.8.8:53 www.example.com... started [ 4.191889] <info> DNSPing #4 8.8.8.8:53 thepiratebay.net... started [ 4.203056] <info> DNSPing #4 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 4.211179] <info> DNSPing #4 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 5.191830] <info> DNSPing ooni#5 8.8.8.8:53 www.example.com... started [ 5.191830] <info> DNSPing ooni#5 8.8.8.8:53 thepiratebay.net... started [ 5.233596] <info> DNSPing ooni#5 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 5.261641] <info> DNSPing ooni#5 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 6.191596] <info> DNSPing #6 8.8.8.8:53 thepiratebay.net... started [ 6.191573] <info> DNSPing #6 8.8.8.8:53 www.example.com... started [ 6.200647] <info> DNSPing #6 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 6.208036] <info> DNSPing #6 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 7.191875] <info> DNSPing ooni#7 8.8.8.8:53 thepiratebay.net... started [ 7.191879] <info> DNSPing ooni#7 8.8.8.8:53 www.example.com... started [ 7.200336] <info> DNSPing ooni#7 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 7.213787] <info> DNSPing ooni#7 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 8.191866] <info> DNSPing ooni#8 8.8.8.8:53 thepiratebay.net... started [ 8.191900] <info> DNSPing ooni#8 8.8.8.8:53 www.example.com... started [ 8.204297] <info> DNSPing ooni#8 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 8.214435] <info> DNSPing ooni#8 8.8.8.8:53 thepiratebay.net... 83.224.65.41 [ 9.191857] <info> DNSPing ooni#9 8.8.8.8:53 www.example.com... started [ 9.191863] <info> DNSPing ooni#9 8.8.8.8:53 thepiratebay.net... started [ 9.200628] <info> DNSPing ooni#9 8.8.8.8:53 www.example.com... 93.184.216.34 2606:2800:220:1:248:1893:25c8:1946 [ 9.216799] <info> DNSPing ooni#9 8.8.8.8:53 thepiratebay.net... 83.224.65.41 Domain IPAddress ASN Org #Seen LateResponse -------------------------------------------------------------------------------------------------------------------------------------------------- www.example.com 2606:2800:220:1:248:1893:25c8:1946 15133 Edgecast Inc. 10 false www.example.com 93.184.216.34 15133 Edgecast Inc. 10 false thepiratebay.net 83.224.65.41 30722 Vodafone Italia S.p.A. 10 false [ 10.193633] <info> submitting measurement to OONI collector; please be patient... [ 10.262480] <info> New reportID: 20240112T144835Z_dnsping_IT_30722_n1_qbyxPwKoifjgp6AM [ 10.372279] <info> saving measurement to disk [ 10.373693] <info> experiment: recv 0.00 byte, sent 0.00 byte [ 10.375159] <info> whole session: recv 2.28 kbyte, sent 19.24 kbyte ```
No description provided.