Commit Graph

728 Commits

Author SHA1 Message Date
Simone Basso
89a584f93b
fix(go-build-alpine): honour OONI_PSIPHON_TAGS (#968)
Closes https://github.com/ooni/probe/issues/2334.

While there, reinstate integration tests, which were also lost in a previous refactoring. However, only run those tests for linux/amd64 because we can be confident that the Go compiler is WAI for all archs we support.

While there, always use bash for running end-to-end tests.

H/T @ainghazal for discovering and reporting this bug.
2022-10-03 11:55:47 +02:00
Simone Basso
c420c8bb29
feat(miniooni): run local oonirun v2 descriptor (#966)
We introduce the -f, --input-file FILE option with which we
are able to run an OONI Run v2 descriptor stored locally.

In this running mode, there are no checks related to whether the
descriptor has changed, since we're dealing with a local file.

Closes https://github.com/ooni/probe/issues/2328
2022-09-29 11:43:23 +02:00
Simone Basso
ad01856beb
fix(web_connectivity@v0.5): limit number of redirects (#965)
Part of https://github.com/ooni/probe/issues/2237
2022-09-15 08:46:53 +02:00
Simone Basso
700f94b62e
doc(webconnectivity@v0.5): link to analysiscore.go 2022-09-15 08:17:55 +02:00
Simone Basso
0a0253f104
doc(webconnectivity@v0.5): improve readme 2022-09-15 08:17:15 +02:00
Simone Basso
5e76c6ec92
refactor(webconnectivity@v0.5): improve logging clarity (#964)
We're bumping the experiment's version number because we changed the name of the field used to contain late/duplicate DNS responses. We have also changed the algorithm to determine `#dnsDiff`. However, the change should only impact how we log this information. Overall, here the idea is to provide users with a reasonably clear explanation of how the probe maps observations to blocking and accessible using expected/unexpected as the conceptual framework.

Part of https://github.com/ooni/probe/issues/2237
2022-09-15 07:03:53 +02:00
DecFox
d6a362d96f
feat: port-filtering experiment (#891)
Part of https://github.com/ooni/probe/issues/2005
2022-09-14 19:54:43 +02:00
Simone Basso
cb632ea0f3
cleanup: remove unneded annotation (#963)
See https://github.com/ooni/probe/issues/2319
2022-09-14 19:19:57 +02:00
Simone Basso
7ee9f096d1
fix(nextlite): wrap DNSDecoder errors (#962)
The simplest fix is to wrap such errors in dnsdecoder.go.

Fixes https://github.com/ooni/probe/issues/2317.
2022-09-14 13:47:20 +02:00
Simone Basso
550b602a00
feat(webconnectivity): detect residual DNS censorship (#961)
See https://github.com/ooni/probe/issues/2308
2022-09-14 11:00:12 +02:00
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
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
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
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
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
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
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
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
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
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