Commit Graph

948 Commits

Author SHA1 Message Date
Simone Basso
6c388d2c61
netxlite: factor common code for parsing UDPAddr (#730)
This diff has been extracted from c2f7ccab0e

See https://github.com/ooni/probe/issues/2096
2022-05-14 17:15:08 +02:00
Simone Basso
2238908afe
cleanup(quic): wait for handshake completion in netxlite (#729)
See https://github.com/ooni/probe/issues/2097
2022-05-14 16:32:32 +02:00
Simone Basso
5904e6988d
fix(netxlite): map servfail error (#728)
This error occurred for example when querying kazemjalali.com
in websteps measurements run from Iran.

This error is relatively uncommon, but it still makes sense to
create a specific mapping rule for it.

Originally: 4269e82fbd

See https://github.com/ooni/probe/issues/2096
2022-05-13 19:25:22 +02:00
Simone Basso
b872dd0e1e
fix(netxlite): HTTPSSvc: better no_answer checks (#727)
I've seen some measurements returning some IP addresses for HTTPSSvc
queries but not returning any ALPN value.

For example:

```
% d4
decoding DNS round trip 0:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57768
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;psiphon.ca.                    IN      HTTPS

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57768
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;psiphon.ca.                    IN      HTTPS
;; ANSWER SECTION:
psiphon.ca.             121     IN      A       31.13.85.53
```

Now, the response is clearly bogus. At the time of this writing that
IP address belongs to Facebook. This measurement has been collected in
China, so it's expected for the GFW to behave like this.

Yet, I don't feel like it's accurate to report this measurement as a
"no answer" response. Rather, this response is a valid one containing
a clearly invalid IP address and should be flagged as such.

Originally: 57a023bcf4

See https://github.com/ooni/probe/issues/2096
2022-05-13 19:00:51 +02:00
Simone Basso
192dfd49b4
fix(netxlite): consolidate IPv4/IPv6 checking code (#726)
Originally 966e7f7cdd

See https://github.com/ooni/probe/issues/2096
2022-05-13 18:49:18 +02:00
Simone Basso
e126e73de7
fix(netxlite): LookupHTTPS: short circuit IP addr (#725)
This diff fixes the short-circuit-IP-addr resolver to
correctly handle IP addrs during LookupHTTPS.

The original diff was: 2b51d144bf

See https://github.com/ooni/probe/issues/2096

While there, add unit tests for IPv6.
2022-05-13 18:26:15 +02:00
Simone Basso
ec0561ea8c
feat(netxlite): implement parallel resolver (#724)
This diff imports the parallel resolver from websteps winter 2022
edition, which was originally implemented here:

55231d73cd

See https://github.com/ooni/probe/issues/2096
2022-05-13 17:36:58 +02:00
Simone Basso
0efd4ff130
chore: import improved bogons handling code (#723)
This diff imports improved bogons handling code from websteps
winter 2022 edition's repository.

See https://github.com/ooni/probe/issues/2095

See a65f3e8579/internal/netxlite/bogon.go
2022-05-13 15:32:47 +02:00
Simone Basso
1776ea1288
cleanup: remove websteps summer 2021 implementation (#722)
See https://github.com/ooni/probe/issues/2094
2022-05-13 15:06:03 +02:00
Simone Basso
e93756be20
chore(ci): start saving/restoring go build cache (#721)
This commit uses a build cache for the coverage and netxlite github actions.

See https://github.com/ooni/probe/issues/2093.
2022-05-13 14:39:06 +02:00
Yeganathan S
ded4b08113
fix(ndt7): discards all incoming websockets messages during upload (#719)
See https://github.com/ooni/probe/issues/2084
2022-05-12 08:18:05 +02:00
Simone Basso
b7cc309901
feat: re-implement the vanilla_tor experiment (#718)
This diff re-implements the vanilla_tor experiment. This experiment was
part of the ooni/probe-legacy implementation.

The reference issue is https://github.com/ooni/probe/issues/803. We didn't
consider the possible improvements mentioned by the
https://github.com/ooni/probe/issues/803#issuecomment-598715694 comment,
which means we'll need to create a follow-up issue for them. We will
then decide whether, when, and how to implement those follow-up measurements
either into `vanilla_tor` or into the existing `tor` experiment.

This novel `vanilla_tor` implementation emits test_keys that are mostly
compatible with the original implementation, however:

1. the `timeout` is a `float64` rather than integer (but the default
timeout is an integer, so there are no JSON-visible changes);

2. the `tor_log` string is gone and replaced by the `tor_logs` list
of strings, which contains the same information;

3. the definition of `error` has been augmented to include the
case in which there is an unknown error;

4. the implementation of vanilla_tor mirrors closely the one of torsf
and we have taken steps to make the two implementations as comparable
as possible in terms of the generated JSON measurement.

The main reason why we replaced `tor_log` with `tor_logs` are:

1. that `torsf` already used that;

2. that reading the JSON is easier with this implementation compared to
an implementation where all logs are into the same string.

If one is processing the new data format using Python, then it will
not be difficult convert `tor_log` to `tor_logs`. In any case, because
we extract the most interesting fields (e.g., the percentage of the
bootstrap where tor fails), it seems that logs are probably more useful
as something you want to read in edge cases (I guess).

Also, because we want `torsf` and `vanilla_tor` to have similar JSONs,
we renamed `torsf`'s `default_timeout` to `timeout`. This change has little
to none real-world impact, because no stable version of OONI Probe has
ever shipped a `torsf` producing the `default_timeout` field.

Regarding the structure of this diff, we have:

1. factored code to parse tor logs into a separate package;

2. implemented `vanilla_tor` as a stripped down `torsf` and added further
changes to ensure compatibility with the previous `vanilla_tor`'s data format;

3. improved `torsf` to merge back the changes in `vanilla_tor`, so the two
data formats of the two experiments are as similar as possible.

We believe producing as similar as possible data formats helps anyone who's
reading measurements generated by both experiments.

We have retained/introduced `vanilla_tor`'s `error` field, which is not very
useful when one has a more precise failure but is still what `vanilla_tor`
used to emit, so it makes sense to also have this field.

In addition to changing the implementation, we also updated the specs.

As part of our future work, we may want to consider factoring the common code
of these two experiments into the same underlying support library.
2022-05-10 15:43:28 +02:00
Yeganathan S
3d81845614
fix(httpx): correctly combine paths (#706)
See https://github.com/ooni/probe/issues/2010

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-05-09 21:32:49 +02:00
Simone Basso
36ca28d673
feat: add a simple dnsping experiment (#674)
See https://github.com/ooni/probe/issues/1987 (issue).

See https://github.com/ooni/spec/pull/238 (impl).

While there, fix the build for go1.18 by adding go1.18 specific tests. I was
increasingly bothered by the build being red.
2022-05-09 15:28:18 +02:00
Simone Basso
a7a6d7df7f
feat: introduce the simplequicping experiment (#717)
See https://github.com/ooni/probe/issues/2091 (issue) and https://github.com/ooni/spec/pull/237 (spec).
2022-05-09 11:22:44 +02:00
Simone Basso
2917dd6c76
feat: introduce the tlsping experiment (#716)
See https://github.com/ooni/probe/issues/2088 (issue) and https://github.com/ooni/spec/pull/236 (spec).
2022-05-09 10:25:50 +02:00
Simone Basso
e983a5cffb
feat: introduce the tcpping experiment (#696)
See https://github.com/ooni/probe/issues/2030 (reference issue) and https://github.com/ooni/spec/pull/235 (spec).
2022-05-09 09:33:18 +02:00
stergem
8010e9783a
chore: upgrade to github.com/upper/db/v4 (#705)
* Upgrade to github.com/upper/db/v4

* fix(oonitest): repair imports after merge

Oops, okay, it seems the merge did not preserve all the import
changes, so let's ensure we use the right imports here!

* cleanup(go.mod): don't refer to upper.io/db/v3

These lines didn't disappear previously because the merge commit
failed to remove all references to upper.io/db/v3.

Co-authored-by: stergem <sgemelas@protonmail.com>
Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-05-06 13:05:24 +02:00
DecFox
5d2afaade4
cli: upgrade to lucas-clemente/quic-go@v0.27.0 (#715)
* quic-go upgrade: replaced Session/EarlySession with Connection/EarlyConnection

* quic-go upgrade: added context to RoundTripper.Dial

* quic-go upgrade: made corresponding changes to tutorial

* quic-go upgrade: changed sess variable instances to qconn

* quic-go upgrade: made corresponding changes to tutorial

* cleanup: remove unnecessary comments

Those comments made sense in terms of illustrating the changes
but they're going to be less useful once we merge.

* fix(go.mod): apparently we needed `go1.18.1 mod tidy`

VSCode just warned me about this. It seems fine to apply this
change as part of the pull request at hand.

* cleanup(netxlite): http3dialer can be removed

We used to use http3dialer to glue a QUIC dialer, which had a
context as its first argument, to the Dial function used by the
HTTP3 transport, which did not have a context as its first
argument.

Now that HTTP3 transport has a Dial function taking a context as
its first argument, we don't need http3dialer
anymore, since we can use the QUIC dialer directly.

Cc: @DecFox

* Revert "cleanup(netxlite): http3dialer can be removed"

This reverts commit c62244c620cee5fadcc2ca89d8228c8db0b96add
to investigate the build failure mentioned at
https://github.com/ooni/probe-cli/pull/715#issuecomment-1119450484

* chore(netx): show that test was already broken

We didn't see the breakage before because we were not using
the created transport, but the issue of using a nil dialer was
already present before, we just didn't see it.

Now we understand why removing the http3transport in
c62244c620cee5fadcc2ca89d8228c8db0b96add did cause the
breakage mentioned at
https://github.com/ooni/probe-cli/pull/715#issuecomment-1119450484

* fix(netx): convert broken integration test to working unit test

There's no point in using the network here. Add a fake dialer that
breaks and ensure we're getting the expected error.

We've now improved upon the original test because the original test was
not doing anything while now we're testing whether we get back a QUIC
dialer that _can be used_.

After this commit, I can then readd the cleanup commit
c62244c620cee5fadcc2ca89d8228c8db0b96add and it won't be
broken anymore (at least, this is what I expected to happen).

* Revert "Revert "cleanup(netxlite): http3dialer can be removed""

This reverts commit 0e254bfc6ba3bfd65365ce3d8de2c8ec51b925ff
because now we should have fixed the broken test.

Co-authored-by: decfox <decfox>
Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-05-06 12:24:03 +02:00
DecFox
a72cc7151c
tls_handshakes: add endpoint addresses to handshake list (#711)
* tls_handshakes: add IP addresses

* tls_handshakes: extract ip from tcp-connect

* tls_handshake: switched to trace event

* saver.go: get remoteAddr before handshake

Not sure whether this is strictly necessary, but I'd rather take the
remoteAddr before calling Handshake, just in case a future version
of the handshake closes the `conn`. In such a case, `conn.RemoteAddr`
would return `nil` and we would crash here.

This occurred to me while reading once again the diff before merging.

Co-authored-by: decfox <decfox>
Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-05-06 11:09:54 +02:00
DecFox
b81af5b058
feat(torsf): add default_timeout test keys (#709)
See https://github.com/ooni/probe/issues/2061
2022-05-06 10:47:26 +02:00
ParitoshKabra
4c55102789
fix(torsf): ensure tor-logs-filtering regexp is correct (#707)
* Fix Regex in TorProgressRegex

* fix: update regexp link

As suggested by @hellais

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-05-06 10:36:26 +02:00
ParitoshKabra
d984c2dac8
fix(cli/geoip): correct typos in tests (#710) 2022-05-06 10:20:57 +02:00
Simone Basso
d3c5196474
fix(ooniprobe): use ooniprobe-cli-unattended for unattended runs (#714)
This diff changes the software name used by unattended runs for which
we did not override the default software name (`ooniprobe-cli`).

It will become `ooniprobe-cli-unattended`. This software name is in line
with the one we use for Android, iOS, and desktop unattended runs.

While working in this diff, I introduced string constants for the run
types and a string constant for the default software name.

See https://github.com/ooni/probe/issues/2081.
2022-04-29 13:41:09 +02:00
Simone Basso
596bdf6e57
fix(CONTRIBUTING.md): typo
"I have seen a typo on your CONTRIBUTING.md but I am on the phone"

-- @RobertoDauria
2022-04-28 01:34:17 +02:00
Simone Basso
e4e6ec3820
chore: use go1.17.9 (#713)
See https://github.com/ooni/probe/issues/2076
2022-04-22 15:47:07 +02:00
Simone Basso
0461e6eebc
chore: use ooni/go-libtor v1.1.5 (#712)
See https://github.com/ooni/probe/issues/1996
2022-04-22 15:32:25 +02:00
Simone Basso
306d18e466
chore: support go1.18 and update dependencies (#708)
Here's the squash of the following patches that enable support
for go1.18 and update our dependencies.

This diff WILL need to be backported to the release/3.14 branch.

* chore: use go1.17.8

See https://github.com/ooni/probe/issues/2067

* chore: upgrade to probe-assets@v0.8.0

See https://github.com/ooni/probe/issues/2067.

* chore: update dependencies and enable go1.18

As mentioned in 7a0d17ea91,
the tree won't build with `go1.18` unless we say it does.

So, not only here we need to update dependencies but also we
need to explicitly say `go1.18` in the `go.mod`.

This work is part of https://github.com/ooni/probe/issues/2067.

* chore(coverage.yml): run with go1.18

This change will give us a bare minimum confidence that we're
going to build our tree using version 1.18 of golang.

See https://github.com/ooni/probe/issues/2067.

* chore: update user agent used for measuring

See https://github.com/ooni/probe/issues/2067

* chore: run `go generate ./...`

See https://github.com/ooni/probe/issues/2067

* fix(dialer_test.go): make test work with go1.17 and go1.18

1. the original test wanted the dial to fail, so ensure we're not
passing any domain name to exercise dialing not resolving;

2. match the end of the error rather than the whole error string.

Tested locally with both go1.17 and go1.18.

See https://github.com/ooni/probe-cli/pull/708#issuecomment-1096447186
2022-04-12 11:43:12 +02:00
Yeganathan S
340cd826ff
fix: experimental should be unattended (#704)
See https://github.com/ooni/probe/issues/2056
2022-03-15 16:24:21 +01:00
jan Anja
0f29f6f092
chore(ci): generate tarball with vendored dependencies when releasing (#702)
Closes https://github.com/ooni/probe/issues/2053

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-03-08 12:42:58 +01:00
Dionysis Grigoropoulos
07f8db9dc2
feat: add support for OpenBSD (#703)
Closes https://github.com/ooni/probe/issues/2052
2022-03-08 12:25:33 +01:00
Yeganathan S
74e31d5cc1
cleanup: use ErrorToStringOrOK func in other tests that returns nil (#701)
Reference issue: https://github.com/ooni/probe/issues/2040
2022-03-08 11:59:44 +01:00
Simone Basso
024eb42334
fix(ndt7): force our bundled CA pool (#700)
This change should prevent old clients (e.g., Android 6) from
failing to perform a ndt7 experiment because their internal CA
bundle is now too old.

Reference issue: https://github.com/ooni/probe/issues/2031

While there, run `go mod tidy` to fix a minor inconsistence in
the current `go.mod` file.

This diff WILL require a backport to release/3.14.
2022-02-23 12:59:03 +01:00
Simone Basso
ac2e0d718f
[forwardport] fix(oonimkall): ensure we can submit last measurement (#699)
This diff forward ports 018b5de8ce10040b553f0923f70543c1071b954c, whose
original commit message follows:

- - -

The underlying issue causing https://github.com/ooni/probe/issues/2037
is that the final measurement of a web_connectivity run is not
submitted because the context expires while we're submitting it
in most cases.

In turn, this happens because a web_connectivity measurement is not
interrupted midway, since it's not interruptible. This choice is sound
in that we want to finish an in progress measurement. And this is
also why the max_runtime is never 100% accurate.

Yet, once the context is expired, the subsequent submission fails.

Fix the issue by using three contexts. The root context is the one that
the user controls. The measurement context is the one tied to the max
runtime. The submit context is tied to the max runtime plus extra slack
time to ensure we submit the measurement.

With this diff applied, I run the mobile app a couple of times and did
not notice any unsubmitted measurements. Still, more testing is also
probably required to further ensure we've properly fixed.

I'm committing this diff in the release/3.14 branch but we WILL also
need to forward port it into the master branch.

While there, since pkg/oonimkall is a large package, let us create
a doc.go file for keeping the docs.

 Conflicts:
	pkg/oonimkall/task.go
2022-02-23 12:38:58 +01:00
Yeganathan S
ce401272e8
doc(CONTRIBUTING.md): add golang resources and links to community channels (#697)
This diff improves the CONTRIBUTING.md after @bassosimone and @yeganathan18 had a conversation about improving the quality of our default community resources.
2022-02-18 21:09:51 +01:00
Yeganathan S
6e78cc2d71
chore: import DoH servers from DNSCrypt/dnscrypt-resolvers (#693)
See https://github.com/ooni/probe/issues/1969
2022-02-17 17:52:16 +01:00
Yeganathan S
6a63f1b044
fix(dnscheck): log "ok" rather than "<nil>" on success (#695)
See https://github.com/ooni/probe/issues/2020
2022-02-16 20:47:44 +01:00
kelmenhorst
88236a4352
feat: add an experimental quicping experiment (#677)
This experiment pings a QUIC-able host. It can be used to measure QUIC availability independently from TLS.
This is the reference issue: https://github.com/ooni/probe/issues/1994

### A QUIC PING is:
- a QUIC Initial packet with a size of 1200 bytes (minimum datagram size defined in the [RFC 9000](https://www.rfc-editor.org/rfc/rfc9000.html#initial-size)),
- with a random payload (i.e. no TLS ClientHello),
- with the version string 0xbabababa which forces Version Negotiation at the server.

QUIC-able hosts respond to the QUIC PING with a Version Negotiation packet.

The input is a domain name or an IP address. The default port used by quicping is 443, as this is the port used by HTTP/3. The port can be modified with the `-O Port=` option.
The default number of repetitions is 10, it can be changed with `-O Repetitions=`.

### Usage:
```
./miniooni -i google.com quicping
./miniooni -i 142.250.181.206 quicping
./miniooni -i 142.250.181.206 -OPort=443 quicping
./miniooni -i 142.250.181.206 -ORepetitions=2 quicping

```
2022-02-14 19:21:16 +01:00
kelmenhorst
0735e2018f
feat: add oonireport client (#682)
The oonireport client (re-)uploads a measurement report file. This can be helpful when the measurement was not uploaded at runtime.

Usage: `./oonireport upload <file>`, where `<file>` is a json(l) file containing one OONI measurement per line.

This pull request refers to https://github.com/ooni/probe/issues/2003 and https://github.com/ooni/probe/issues/950.

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-02-14 15:24:36 +01:00
Simone Basso
fbae9ddece
[forwardport] fix(ooniprobe): ensure tunnelDir is correctly set (#694)
This commit forward ports 59c63ee0b2249c803c40f1eb19c0f6c062838bf1,
whose original log message follows:

- - -

While doing QA in https://github.com/ooni/probe/issues/1845, I
noticed we're not using the correct directory.

Results are written in the current directory inside of the OONI_HOME,
which is quite not what we want to happen.

This diff WILL require forward porting to master.
2022-02-11 12:57:54 +01:00
Ain Ghazal
00b5c73c3a
jafar(README.md): fix typo (#692)
Co-authored-by: Ain Ghazal <ainghazal@riseup.net>
2022-02-10 17:38:51 +01:00
Simone Basso
e72263dacb
[forwardport] fix(qa): adapt to new wcth (#691)
This diff forward ports 36ba3630c9002db0bd79e3a7e49641ce6b665471,
whose original commit message follows:

- - -

This diff contains minimal changes to make webconnectivity QA
WAI with the new Web Connectivity test helper.

It seems we're currently doing round robin between the old and
the new implementation, so I needed to locally pin my probes
to use the new implementation by changing the code. But, obviously,
I don't want to commit this code.

Likewise, in my working environment, I need to build the docker
container using `docker buildx build --platform linux/amd64`, but
I am not sure whether to commit this code.

While there, I noticed there was a missing QA test for the case
in which we're passing through a transparent HTTP proxy. I noticed
as well that the test that said it was passing through such a
proxy was actually using a transparent TLS proxy. I remediated
this by ensuring we have a test for both cases.

The other major change in the suite is that, when using the new TH,
there's uncommon headers intersection in some tests, so we have
had a flip from headers not matching to headers matching.

Finally, some formatting changes because I did re-run black.

These changes should be enough to call it a day with respect to
QA (see https://github.com/ooni/probe/issues/2016#issuecomment-1033813344).

This diff WILL need to be forward ported to master.

(I don't know whether the GitHub QA will converge after these changes
and I suspect it won't because of the test helper round robin.)
2022-02-09 23:09:37 +01:00
Simone Basso
7bbd36a434
[forwardport] fix(jafar/iptables/test): force using pure Go resolver (#690)
This commit forward ports 8f2d7945f806579af4d0495f4b8f5a6a01eefb0c, whose
commit message is as follows:

- - -

The discrepancy I was seeing between my local tests and tests run
in the CI is that my systemd is configured to use DoT.

Hence, it was bypassing iptables rules because the query was sent
over an encrypted tunnel. Using a pure Go resolver fixes since
that always uses UDP, so the filter works.

Also, reason that we want as minimal as possible tests, so refactor
a test so that we use just a resolver rather than an HTTP client, and,
while there, also enforce this resolver to be a pure Go resolver.

Reference issue: https://github.com/ooni/probe/issues/2016

This diff WILL need to be forward ported to master.
2022-02-09 15:32:45 +01:00
Simone Basso
bf3c8bcdc3
[forwardport] fix(netx): stop collecting HTTP performance metrics (#689)
This diff forward ports b6db4f64dc83a2a27ee3ce6bba5ac93db922832d, whose
original log message is the following:

- - -

We're now using ooni/oohttp as our HTTP library in most cases.

A limitation of this library is that net/http/httptrace does not
work very well and reliably because (1) we need to use oohttp's
version of that code and (2) we cannot observe net events.

I noticed this fact because an integration test for collecting
HTTP performance metrics was broken.

The best solution here is to remove this functionality, since
it was basically unused in the repository. Only some integration
tests inside urlgetter bothered with these metrics.

A more clinical fix would have been to use ooni/oohttp/httptrace
instead of net/http/httptrace in the stdlib, but it does not
seem to be a good idea, given that those metrics were not used.

With this diff applied, we'll further reduce the number of locally
failing integration tests to just jafar-specific tests.

This diff WILL need to be forwardported to `master`.
2022-02-09 15:08:19 +01:00
Simone Basso
872971ed8c
doc: clarify semantic versioning policy (#688)
The oonimkall package is only public for technical reasons. We
cannot use `go mobile` on a private package. We consider oonimkall
our private interface to our mobile apps, thus we reserve the
right to change its API without bumping the major number.

We'll bump the major number in case of breaking changes in the
cmd/ooniprobe CLI interface, or in case of other major improvements
that significantly modify cmd/ooniprobe.
2022-02-09 14:43:03 +01:00
Simone Basso
eed007a5d0
chore: start hacking on 3.15.0-alpha (#687)
We've just branched off the release/3.14 branch for finalizing
the release of 3.14.0, hence let's declare that from now on we're
3.15.0-alpha to avoid any confusion.
2022-02-09 14:15:50 +01:00
Simone Basso
024de0e498
fix(geolocate): enforce 7s timeout for each lookupper (#678)
This issue aims at making life slighly better for users impacted by
sanctions whose iplookup may be quite slow in case there are timeouts
as documented in https://github.com/ooni/probe/issues/1988.
2022-02-09 13:22:01 +01:00
Srijan Srivastava
f7fd29b246
geolocate: add cloudflare-based IP lookup (#676)
Cloudflare hosted services provide a certain service of `/cdn-cgi/trace` with their base url (for example, `www.cloudflare.com` or `www.nginx.com`), which can be used to obtain `ip` in the probe's `geolocate` feature.

The same feature was added in this pr, hence, increasing the number of `baseURL`s in `geolocate`.

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-02-09 11:54:19 +01:00
Simone Basso
85664f1e31
feat(torsf): collect tor logs, select rendezvous method, count bytes (#683)
This diff contains significant improvements over the previous
implementation of the torsf experiment.

We add support for configuring different rendezvous methods after
the convo at https://github.com/ooni/probe/issues/2004. In doing
that, I've tried to use a terminology that is consistent with the
names being actually used by tor developers.

In terms of what to do next, this diff basically instruments
torsf to always rendezvous using domain fronting. Yet, it's also
possible to change the rendezvous method from the command line,
when using miniooni, which allows to experiment a bit more. In the
same vein, by default we use a persistent tor datadir, but it's
also possible to use a temporary datadir using the cmdline.

Here's how a generic invocation of `torsf` looks like:

```bash
./miniooni -O DisablePersistentDatadir=true \
           -O RendezvousMethod=amp \
           -O DisableProgress=true \
           torsf
```

(The default is `DisablePersistentDatadir=false` and
`RendezvousMethod=domain_fronting`.)

With this implementation, we can start measuring whether snowflake
and tor together can boostrap, which seems the most important thing
to focus on at the beginning. Understanding why the bootstrap most
often does not converge with a temporary datadir on Android devices
remains instead an open problem for now. (I'll also update the
relevant issues or create new issues after commit this.)

We also address some methodology improvements that were proposed
in https://github.com/ooni/probe/issues/1686. Namely:

1. we record the tor version;

2. we include the bootstrap percentage by reading the logs;

3. we set the anomaly key correctly;

4. we measure the bytes send and received (by `tor` not by `snowflake`, since
doing it for snowflake seems more complex at this stage).

What remains to be done is the possibility of including Snowflake
events into the measurement, which is not possible until the new
improvements at common/event in snowflake.git are included into a
tagged version of snowflake itself. (I'll make sure to mention
this aspect to @cohosh in https://github.com/ooni/probe/issues/2004.)
2022-02-07 17:05:36 +01:00
Simone Basso
4e5f9bd254
fix(Readme.md): clarify what is the internal/engine pkg
One may otherwise wonder why there are some package still inside
the `internal/engine` package. This is a long running refactoring started
when we merged `probe-engine` into this package and it will
eventually be done :-).
2022-02-05 12:24:10 +01:00