Commit Graph

1131 Commits

Author SHA1 Message Date
Simone Basso
3766ab2721
feat(webconnectivity@v0.5): use TLS info from TH (#933)
This diff modifies webconnectivity@v0.5 to take decisions regarding
TLS blocking by using the response from the TH rather than using
questionable heuristics based on inspecting the TLSHandshake list
alone. This change should improve correctness _when_ we're using
the improved TH, which is currently used for 50% of the probes.

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

While there, modify `control.go` to specify which control is being used.
2022-09-05 11:35:48 +02:00
Simone Basso
34dc029b33
feat(miniooni): optionally log using emojis (#932)
As silly as it seems, emojis help _a lot_ when eyeballing logs
to quickly identify unexpected lines.

I'm doing this work as part of https://github.com/ooni/probe/issues/2257
2022-09-05 10:06:44 +02:00
Simone Basso
4b13e4e78b
chore: upgrade user-agent used for measuring (#931)
Part of https://github.com/ooni/probe/issues/2130
2022-09-04 18:02:59 +02:00
Simone Basso
b669685aea
chore: upgrade to db-ip.com 2022-09 release (#930)
Part of https://github.com/ooni/probe/issues/2130
2022-09-04 17:45:31 +02:00
Simone Basso
6533d8a6c9
chore: run go generate ./... (#929)
This is part of the routine tasks before a release.

See https://github.com/ooni/probe/issues/2130
2022-09-04 17:33:22 +02:00
Simone Basso
ae0613fbb3
feat(ghpublish): choose (pre)release depending on tag (#928)
While there, include integration testing to make sure the script
is working as intended before using it.

While there, edit maketarball.bash's comments.
2022-09-03 12:11:19 +02:00
Simone Basso
7df25795c0
fix(probeservices): use api.ooni.io (#926)
See https://github.com/ooni/probe/issues/2147.

Note that this PR also tries to reduce usage of legacy names inside unit/integration tests.
2022-09-02 16:48:14 +02:00
Simone Basso
535be51cd1
fix(tracex): use HTTP transaction end time for t (#925)
This issue was mentioned in https://github.com/ooni/probe/issues/2137.

I double checked the spec and this field is not mentioned. We will
update it when we do https://github.com/ooni/probe/issues/2238.
2022-09-02 15:10:57 +02:00
Simone Basso
1153850aca
cleanup: doh.powerdns.org is not working anymore (#924)
While there, `.../internal/sessionresolver` => `.../sessionresolver`

See https://github.com/ooni/probe/issues/2255
2022-09-02 14:44:23 +02:00
Simone Basso
ec73ae20b4
fix(dnscheck): trim the static input list (#923)
This should make the measurements faster since users have been
complaining about "experimental" taking too much time.

See https://github.com/ooni/probe/issues/2234
2022-09-02 13:54:59 +02:00
Simone Basso
7cdcf9f15b
fix(dnscheck): record whether residual is enabled (#922)
The residual censorship algorithm prevents dnscheck for checking the
same endpoint again in a short time frame under the assumption that a
previous measurement could have caused residual censorship.

In https://github.com/ooni/probe/issues/2234, we mentioned we probably
wanted to disable this algorithm because we didn't want to slow down
dnscheck too much and because we didn't detect this alleged source of
blocking in our previous measurements.

It turns out the algorithm was already disabled. I probably did this
after we published the paper on DNS censorship to make measurements
overall a bit faster.

So, just introduce a new extension field to the measurement telling us
that the residual censorship algorithm is disabled.

It's not super useful except as for the fact that the next time I
read the source code I notice that the algorithm is disabled.
2022-09-02 13:31:24 +02:00
Simone Basso
0c2744e994
feat(rolling): build fresh binaries every night (#920)
Part of https://github.com/ooni/probe/issues/2249
2022-09-01 19:57:31 +02:00
Simone Basso
a68472dcee
dnscheck: bump patch version number (#919)
Part of https://github.com/ooni/probe/issues/2234
2022-09-01 19:23:46 +02:00
Simone Basso
cee89132af
fix(dnscheck): lower the default timeouts (#917)
Closes https://github.com/ooni/probe/issues/2234
2022-09-01 15:45:42 +02:00
Simone Basso
860426b874
doc: document the minioonirunv2 functionality (#916)
Closes https://github.com/ooni/probe/issues/2184
2022-08-31 19:51:31 +02:00
Simone Basso
d0da224a2a
feat(oonirun): improve tests (#915)
See https://github.com/ooni/probe/issues/2184

While there, rename `runtimex.PanicIfFalse` to `runtimex.Assert` (it was about time...)
2022-08-31 18:40:27 +02:00
Simone Basso
a8a29cc0dd
fix(miniooni): handle panics with --repeat-every (#914)
Most of miniooni panics on errors. We should not panic on error with
--repeat-every, rather we should try the next measurement.

See https://github.com/ooni/probe/issues/2250
2022-08-31 13:07:24 +02:00
Simone Basso
0bc6aae601
feat(miniooni): make CLI much more user friendly (#913)
Part of https://github.com/ooni/probe/issues/2184, because I wanted
to allow swapping commands and options more freely.

As a side effect, this PR closes https://github.com/ooni/probe/issues/2248.

AFAICT, every usage that was legal before is still legal. What has
changed seems the freedom to swap commands and options and a much
better help that lists the available options.
2022-08-31 12:44:46 +02:00
Simone Basso
7daa686c68
refactor(miniooni): divide et impera (#912)
This diff splits miniooni's implementation in smaller and more
easily tractable blocks ahead of future refactoring.

I'm trying to make `miniooni oonirun -i URL` as possible as
`miniooni -i URL oonirun`, because users typically expect this
kind of flexibity from modern Unix commands.

Part of https://github.com/ooni/probe/issues/2184
2022-08-31 10:20:04 +02:00
Simone Basso
196ac55493
fix: attempt to make linux builds faster (#911)
This work aims to make Linux builds faster to make https://github.com/ooni/probe/issues/2249 more convenient. Since those builds runs inside Docker, the problem to solve here is to save/restore the Go caches notwithstanding Docker. Because Docker runs as root, we need to modify the build a bit to run as a normal user. Otherwise, we will not be able to save the Go cache using actions/cache@v3. (Other approaches such as using `sudo` are possible but running the build as an unprivileged user actually looks cleaner, so I chose to do that.) While there, add a `.editorconfig`.
2022-08-30 21:13:33 +02:00
Simone Basso
d10ab88444
feat: implement rolling builds (#910)
This diff modifies all the github actions that produce assets to
publish on a release called rolling when we are not building a tag.

If everything goes as planned, we should be able to provide
people with automatically generated fresh binaries for testing.

While there, introduce caching for all builds to make them
as fast as possible. I suspect gomobile based builds will not
see any speed up but other builds most likely will.

See https://github.com/ooni/probe/issues/2249
2022-08-30 15:29:09 +02:00
Simone Basso
d1b172f3ac
fix: attempt to make android builds faster (#909)
After https://github.com/ooni/probe-cli/pull/908, the Android
build has become super slow, because we build serially.

Attempt to make it faster by building in parallel.

Still part of https://github.com/ooni/probe/issues/2119, because
I don't feel happy with a super slow build.
2022-08-30 12:09:01 +02:00
Simone Basso
0d57899f46
feat: stop cross compiling miniooni (#908)
See https://github.com/ooni/probe/issues/2119

While there, shrink the Makefile to only export the minimum
set of rules to comfortable build using GHA.
2022-08-30 11:36:59 +02:00
Simone Basso
d48d44b880
feat: build miniooni and ooniprobe for android (#907)
This diff introduces a build script, makefile rules, and github actions
rules to build and public android CLI releases.

See https://github.com/ooni/probe/issues/1723
2022-08-30 09:37:15 +02:00
Simone Basso
705589bbe1
fix(oohelperd): measurement -> wctask (#906)
Make sure we don't say measurement in metrics.

See https://github.com/ooni/probe/issues/2183#issuecomment-1230327725
2022-08-29 18:52:30 +02:00
Simone Basso
42b547d311
fix: repair the Android build (#905)
Rather than hardcoding the NDK version inside a script, encode it
as a file in the filesystem, which is easier to share.

Make sure we use the desired NDK by setting environment variables.

Use `-androidabi 21`, which:

1. is what rclone did: 8390ba4ca9

2. is the minimum ABI used by probe-android: 994651be52/app/build.gradle (L10)

Part of https://github.com/ooni/probe/issues/2130
2022-08-29 18:51:25 +02:00
Simone Basso
9e38ee5135
feat: build ooniprobe for armv6 (#904)
Part of https://github.com/ooni/probe/issues/1753.

While there, introduce a rule by which, if the branch is named `fullbuild` we run all possible builds. It helps to test all the builds without creating a release branch. Because release branches are protected, they cannot be deleted easily. On the contrary, the `fullbuild` branch can easily be disposed of.
2022-08-29 17:33:42 +02:00
Simone Basso
8c855ca597
fix(oohelperd): metrics improvements after design review (#903)
This diff updates the metrics according to https://github.com/ooni/probe/issues/2183#issuecomment-1230327725
2022-08-29 16:36:46 +02:00
Simone Basso
ffc2527fc5
fix: repair broken linux-static build (#902)
The issue here is that the repository is owned by the user who
runs the command and the container runs as root.

Part of https://github.com/ooni/probe/issues/2130
2022-08-29 15:45:41 +02:00
Simone Basso
4ce414d104
chore: we're now hacking on v3.16.0-alpha.2 (#901)
Just a chore commit to increase the version given that we just tagged v3.16.0-alpha.1
2022-08-29 09:35:17 +02:00
Simone Basso
37632f60d9
fix: repair releasing miniooni and ooniprobe-windows (#900)
It seems several CI builds failed for [v3.16.0-alpha](https://github.com/ooni/probe-cli/releases/tag/v3.16.0-alpha). Let's aim to repair miniooni and ooniprobe-windows for now. The other failing builds seem more tricky. (Android fails with an unsupported NDK while Linux fails with issues accessing the git repository from Docker, probably because the  the user running inside Docker is not the user that owns the repository.)
2022-08-29 00:48:46 +02:00
Simone Basso
90089d4d8f
chore: we're now hacking on v3.16.0-alpha.1 (#899)
Just a chore commit to increase the version given that we just tagged v3.16.0-alpha
2022-08-29 00:29:01 +02:00
Simone Basso
9bd1c5ff20
fix(oohelperd): refuse to measure bogons (#898)
See the explanatory newly-added comment for more information.

Closes https://github.com/ooni/probe/issues/2064
2022-08-29 00:06:57 +02:00
Simone Basso
dcdd8fb712
feat(oohelperd): add prometheus metrics (#897)
Closes https://github.com/ooni/probe/issues/2183

While there, avoid exposing nil values for optional fields of the
THResponse struct (i.e., "ip_info" and "tls_handshake").

While there, fix `measurexlite`'s `OperationLogger` test
and make it deterministic rather than racy.
2022-08-28 23:54:22 +02:00
Simone Basso
4241ee4bc1
feat(oohelperd): log messages at info level (#896)
We're using a request-specific logger where we also print the ID
of the request. This design helps to observe logs produced by
concurrent requests.

Part of https://github.com/ooni/probe/issues/2183

While there, fix https://github.com/ooni/probe/issues/2241
2022-08-28 22:26:58 +02:00
Simone Basso
8ca7645026
refactor: make measurex depend on measurexlite (#892)
This diff makes `measurex` depend on `measurexlite` rather than the other way around.

While there, add unit tests.

Closes https://github.com/ooni/probe/issues/2240
2022-08-28 21:41:58 +02:00
Simone Basso
7c1b2bbcb0
refactor: move WebGetTitle inside measurexlite (#895)
Part of https://github.com/ooni/probe/issues/2240
2022-08-28 20:26:40 +02:00
Simone Basso
bb6563f363
refactor: move TH structs and definitions to model (#894)
This commit moves the TH structs and definitions to model. We don't want
oohelperd to depend on web_connectivity@v0.4.

Part of https://github.com/ooni/probe/issues/2240
2022-08-28 20:20:12 +02:00
Simone Basso
110a11828b
refactor: spin geoipx off geolocate (#893)
A bunch of packages (including oohelperd) just need the ability to
use MaxMind-like databases. They don't need the additional functionality
implemented by the geolocate package. Such a package, in fact, is
mostly (if not only) needed by the engine package.

Therefore, move code to query MaxMind-like databases to a separate
package, and avoid depending on geolocate in all the packages for
which it's sufficient to use geoipx.

Part of https://github.com/ooni/probe/issues/2240
2022-08-28 20:00:25 +02:00
Simone Basso
1e7384d1cc
feat(oohelperd): measure TLS for :443 endpoints (#886)
This diff improves oohelperd to measure :443 endpoints with TLS.

Part of https://github.com/ooni/probe/issues/2237.
2022-08-28 14:34:40 +02:00
Simone Basso
df0e099b73
feat(oohelperd): follow (and record) TH and probe endpoints (#890)
This diff introduces the following `oohelperd` enhancements:

1. measure both IP addresses resolved by the TH and IP addresses resolved by the probe;

2. when the URL scheme is http and there's no explicit port, measure both 80 and 443 (which will pay off big once we introduce support for optionally performing TLS handshakes);

3. include information about the probe and TH IP addresses into the results: who resolved each IP address, whether an address is a bogon, the ASN associated to an address.

This diff is part of https://github.com/ooni/probe/issues/2237
2022-08-28 13:49:24 +02:00
Simone Basso
867a243fef
refactor(oohelperd): make performing additional measurements easier (#889)
This diff refactors oohelperd to make performing additional measurements easier. We need:

1. to run the DNS task _before_ other tasks such that we can measure both IP addresses returned by the TH and the ones returned by the probe. When we'll introduce TLS measurements, this will allow us to validate probe-provided IP addresses inside the TH call. If probe-provided addresses work with TLS, they are legitimate for the domain.

2. to tie the number of TCP measurements to a list of endpoints collected by the probe _or_ the TH rather than just to the one provided by the probe. Anticipating this change, let us refactor how we read the results of the TCP task to make it independent of the number of addresses provided by the probe.

This work is part of https://github.com/ooni/probe/issues/2237
2022-08-28 12:17:31 +02:00
Simone Basso
b8cc548d41
fix(oohelperd): enforce timeout for each measurement step (#888)
While working on https://github.com/ooni/probe/issues/2237, I noticed
there's no enforced timeout for measurement tasks.

So, this diff introduces the following timeouts:

1. use a 4 seconds timeout for the DNS lookup;

2. use a 10 seconds timeout for TCP;

3. use a 15 seconds timeout for HTTP.

They are a bit stricter than what we have on the probe because the TH
should supposedly have better bandwidth and connectivity.
2022-08-28 12:02:17 +02:00
Simone Basso
d711c19b55
fix(oohelperd): by default listen on localhost (#887)
Part of https://github.com/ooni/probe/issues/2183
2022-08-28 11:54:15 +02:00
Simone Basso
8a0c062844
feat: clearly indicate which resolver we're using (#885)
See what we documented at https://github.com/ooni/spec/pull/257

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

See also the related ooni/spec PR: https://github.com/ooni/spec/pull/257

See also https://github.com/ooni/probe/issues/2237

While there, bump webconnectivity@v0.5 version because this change
has an impact onto the generated data format.

The drop in coverage is unavoidable because we've written some
tests for `measurex` to ensure we deal with DNS resolvers and transport
names correctly depending on the splitting policy we use.

(However, `measurex` is only used for the `tor` experiment and, per
the step-by-step design document, new experiments should use
`measurexlite` instead, so this is hopefully fine(TM).)

While there, fix a broken integration test that does not run in `-short` mode.
2022-08-27 15:47:48 +02:00
Simone Basso
c3964e43b3
feat(webconnectivity@v0.5): record late DNS replies (#883)
Part of https://github.com/ooni/probe/issues/2237
2022-08-26 18:32:36 +02:00
Simone Basso
1a1d3126ae
feat(webconnectivity): long-term-evolution prototype (#882)
See https://github.com/ooni/probe/issues/2237
2022-08-26 16:42:48 +02:00
Simone Basso
9ba6f8dcbb
feat(measurexlite): generate HTTP traces (#881)
In a pure step-by-step model, we don't need to trace HTTP round trips like we did before. We _may_ want in the future to also have some form of HTTP tracing (see https://github.com/ooni/probe-cli/pull/868 for a prototype) but doing that is currently not in scope for moving forward the step-by-step design. For this reason, I only added a public convenience function for formatting an OONI spec compatible request. I also added new fields, which should be documented inside the ooni/spec repository (see https://github.com/ooni/probe/issues/2238).

Required by https://github.com/ooni/probe/issues/2237
2022-08-26 13:11:43 +02:00
DecFox
0ef1f24617
feat: record delayed DNS responses in dnsping (#878)
See https://github.com/ooni/probe/issues/2231

Co-authored-by: decfox <decfox@github.com>
Co-authored-by: Simone Basso <bassosimone@gmail.com>
2022-08-25 13:59:24 +02:00
Simone Basso
6ef3febf69
feat(measurexlite): add T0 and TransactionID (#879)
The T0 field is the moment when we started collecting data, while T
is the moment when we finished collecting data.

The TransactionID field will be repurposed for step-by-step measurements
to indicate related observations collected as part of the same flow
(e.g., TCP+TLS+HTTP).

Note that, for now, this change will only affect measurexlite and we're
not planning on changing other libraries for measuring.

Part of https://github.com/ooni/probe/issues/2137
2022-08-25 13:41:26 +02:00