Commit Graph

1160 Commits

Author SHA1 Message Date
Simone Basso
6815dd8b2f
webconnectivity@v0.5: handle successful https chains (#960)
This diff includes a rule to recover from the "measurement failed" state that kicks in when we have a chain of successful redirects from the client side leading to a webpage _and_ any URL in the chain uses HTTPS. See https://github.com/ooni/probe/issues/2307.

While there, fix `i/e/w/iox.go` to avoid triggering the `./script/nocopyreadall.bash` script.
2022-09-14 08:40:13 +02:00
Simone Basso
d289b80386
feat(webconnectivity@v0.5): stream the response body (#959)
Reference issue: https://github.com/ooni/probe/issues/2295
2022-09-13 21:54:40 +02:00
Simone Basso
019aa4cbca
feat(webconnectivity@v0.5): detect TLS misconfig for probe and TH (#958)
See https://github.com/ooni/probe/issues/2300.
2022-09-13 10:40:38 +02:00
Simone Basso
8d8554eb8f
feat(webconnectivity@v0.5): probe and TH can't connect => website down (#957)
This diff introduces a special rule to avoid emitting null, null when all the connects failed in both the probe and the TH.

While there, recognize that the subset of null, null we're hunting actually deals with websites that are down, so change the internal naming to reflect that and make the code easier to read/understand.

See https://github.com/ooni/probe/issues/2299
2022-09-13 09:02:29 +02:00
Simone Basso
1638c450f0
refactor(engine): scrub the whole measurement (#956)
Part of https://github.com/ooni/probe/issues/2297
2022-09-12 22:22:25 +02:00
Simone Basso
f77474a91a
fix(webconnectivity@v0.5): avoid confusing log message (#954)
It's confusing to see

```
measuring additional addrs from TH: []
```

when actually nothing is going to be measured.

So, instead, let us log about the additional addrs
discovered by the TH instead, which is less confusing.

Part of https://github.com/ooni/probe/issues/2237
2022-09-12 11:03:55 +02:00
Simone Basso
b10eea47e7
feat(webconnectivity@v0.5): flag case where noone resolved any address (#953)
See https://github.com/ooni/probe/issues/2290

While there, notice that in such a case the priority selector would hang because of the WaitGroup, so get rid of the WaitGroup and accept that the priority selector is going to hang around for the whole duration of the measurement in some cases. The cancellable `measurer.go`'s context will cause the priority selector to eventually exit when we return from `measurer.go`'s `Run` method.
2022-09-12 07:33:34 +02:00
Simone Basso
449b981f7f
fix(webconnectivity@v0.5): account for broken ipv6 in dnsdiff algorithm (#952)
See https://github.com/ooni/probe/issues/2284
2022-09-11 23:14:22 +02:00
Simone Basso
2dd4e75945
fix(webconnectivity@v0.5): status code always match with equal codes (#951)
See https://github.com/ooni/probe/issues/2287
2022-09-11 22:48:28 +02:00
Simone Basso
5e75512396
feat(webconnectivity@v0.5): get a webpage whenever possible (#950)
Implements https://github.com/ooni/probe/issues/2276 and supersedes https://github.com/ooni/probe-cli/pull/949.
2022-09-11 22:12:48 +02:00
Simone Basso
6b8b13344a
fix(webconnectivity@v0.5): DoH failure shouldn't set flags (#948)
See: https://github.com/ooni/probe/issues/2274
2022-09-10 16:26:59 +02:00
Simone Basso
dbe935c055
fix: use github.com/ooni/probe-assets@v0.13.0 (#947)
See https://github.com/ooni/probe/issues/2271
2022-09-09 19:02:36 +02:00
DecFox
f2b88ddb4a
feat: tlsmiddlebox experiment (#817)
See https://github.com/ooni/probe/issues/2124
2022-09-08 17:31:03 +02:00
Simone Basso
b78b9aca51
refactor(datafmt): use "udp" instead of "quic" (#946)
This diff changes the data format to prefer "udp" to "quic" everywhere we were previously using "quic".

Previously, the code inconsistently used "quic" for operations where we knew we were using "quic" and "udp" otherwise (e.g., for generic operations like ReadFrom).

While it would be more correct to say that a specific HTTP request used "quic" rather than "udp", using "udp" consistently allows one to see how distinct events such as ReadFrom and an handshake all refer to the same address, port, and protocol triple. Therefore, this change makes it easier to programmatically unpack a single measurement and create endpoint stats.

Before implementing this change, I discussed the problem with @hellais who mentioned that ooni/data is not currently using the "quic" string anywhere. I know that ooni/pipeline also doesn't rely on this string. The only users of this feature have been research-oriented experiments such as urlgetter, for which such a change would actually be acceptable.

See https://github.com/ooni/probe/issues/2238 and https://github.com/ooni/spec/pull/262.
2022-09-08 17:19:59 +02:00
Simone Basso
800217d15b
chore: bump web_connectivity@v0.5 version to 0.5.5 (#945)
chore: web_connectivity v0.5.5

We're bumping the version number to reflect recent improvements in the
data format implemented in these pull requests:

- https://github.com/ooni/probe-cli/pull/942

- https://github.com/ooni/probe-cli/pull/943

- https://github.com/ooni/probe-cli/pull/944

Reference issue: https://github.com/ooni/probe/issues/2238
2022-09-08 11:22:42 +02:00
Simone Basso
8167de5805
fix(measurexlite): emit resolve_start and resolve_done (#944)
Part of https://github.com/ooni/probe/issues/2238
2022-09-08 11:05:38 +02:00
Simone Basso
5ade2d9568
fix(webconnectivity@v0.5): include http transaction start/done (#943)
Code based on urlgetter had this event and we would like to have this
event with step-by-step code as well.

Because there's no tracing for HTTP when using step-by-step, we will
need to include emitting these events inside the boilerplate.

By doing that, we emit events out of order, so make sure we sort
them by T, which is "the moment when the event was collected".

Part of https://github.com/ooni/probe/issues/2238
2022-09-08 10:37:08 +02:00
Simone Basso
596eab4a42
fix(QA): rundocker.sh => rundocker.bash
H/T @lorenzoPrimi
2022-09-08 10:09:30 +02:00
Simone Basso
39cb5959c9
fix(datafmt): sync measurexlite and v0.5 with previous code (#942)
* fix(model/archival.go): more optional keys

Basically, `t0` and `transaction_id` should be optional. Version 0.4.x
of web_connectivity should not include them, version 0.5.x should.

There is a technical reason why v0.4.x should not include them. The code
it is based on, tracex, does not record these two fields.

Whereas, v0.5.x, uses measurexlite, which records these two fields.

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

* fix(webconnectivity@v0.5): add more fields

This diff adds the following fields to webconnectivity@v0.5:

1. agent, always set to "redirect" (legacy field);

2. client_resolver, properly initialized w/ the resolver's IPv4 address;

3. retries, legacy field always set to null;

4. socksproxy, legacy field always set to null.

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

* fix(webconnectivity@v0.5): register extensions

The general idea behind this field is that we would be able
in the future to tweak the data model for some fields, by declaring
we're using a later version, so it seems useful to add it.

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

* fix(measurexlite): use tcp or quic for tls handshake network

This diff fixes a bug where measurexlite was using "tls" as the
protocol for the TLS handshake when using TCP.

While this choice _could_ make sense, the rest of the code we have
written so far uses "tcp" instead.

Using "tcp" makes more sense because it allows you to search for
the same endpoint across different events by checking for the same
network and for the same endpoint rather than special casing TLS
handshakes for using "tls" when the endpoint is "tcp".

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

* chore: run alltests.yml for "alltestsbuild" branches

Part of https://github.com/ooni/probe/issues/2238
2022-09-08 10:02:47 +02:00
Simone Basso
6ae5b5fce4
chore: more dependencies updates (#941)
Part of https://github.com/ooni/probe/issues/2130
2022-09-08 08:31:22 +02:00
Simone Basso
551e4a979c
chore: upgrade obfs4 to v0.0.14 (#940)
See https://github.com/ooni/probe/issues/2262
2022-09-07 21:33:59 +02:00
DecFox
59d8b6ecef
feat: add uTLS support in measurexlite (#918)
Closes https://github.com/ooni/probe/issues/2253 

Co-authored-by: decfox <decfox@github.com>
2022-09-07 15:19:53 +02:00
Simone Basso
9e8ad551aa
chore: set version to 3.17.0-alpha (#939)
I've just branched off the `release/3.16` branch since we're
really looking good for release modulo minor changes.

Hence, it's time to update `master`'s version.
2022-09-07 15:12:06 +02:00
Simone Basso
2389c7cab3
QA: refactor, cleanup, fix, and simplify (#938)
While working on https://github.com/ooni/probe/issues/2130, and specifically on the action item related to making sure all workflows are green, I was confronted with the complexity of the QA directory.

There's plenty of cleaning up and simplifying there. The original intent was to A/B test `miniooni` and `measurement_kit` to ensure they were behaving the same. We don't have this need anymore.

Rather, it seems the QA scripts have grown large and flaky, to the point that I am always tempted to ignore them. The underlying censorship engine, jafar, has also not been developed for quite some time.

So, the first step towards improve the QA infrastructure seems to be humble and acknowledge that we cannot realistically maintain these checks using jafar as a backend for so many experiments.

Let us focus on our most important experiment, Web Connectivity, and let us keep QA checks for it.

Additionally, let us simplify and cleanup QA as much as possible, though without introducing radical changes.

The end result is a QA for Web Connectivity that seems reasonable and runs in six minutes.
2022-09-07 14:55:36 +02:00
Simone Basso
1fc6babcc8
chore: use go1.18.6 (#937)
While there, also update to using go1.19.1 in the dedicated CI workflow.

Closes https://github.com/ooni/probe/issues/2256
2022-09-07 13:19:10 +02:00
Simone Basso
4247640a17
chore: update to ooni/go-libtor v1.1.6 (#936)
This is the last dependency we needed to update according to
the https://github.com/ooni/probe/issues/2130 checklist.
2022-09-05 21:52:46 +02:00
Simone Basso
71ce88d4af
chore: set version to 3.16.0-alpha.3 2022-09-05 13:35:41 +02:00
Simone Basso
3b24b1196d
fix(webconnectivity@v0.5): fetch HTTP only using system-resolver addrs (#935)
While there, change the emoji logger to emit whitespace on info logs. This makes warnings stand out even more.

Closes https://github.com/ooni/probe/issues/2258
2022-09-05 13:33:59 +02:00
Simone Basso
a72a9284f1
fix(measurexlite): expose TCP connect event (#934)
See https://github.com/ooni/probe/issues/2254
2022-09-05 12:21:16 +02:00
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