Commit Graph

1033 Commits

Author SHA1 Message Date
Simone Basso
0a322ebab0
[forwardport] fix: avoid http3 for dns.google and www.google.com (#593) (#594)
This commit forward ports dedd84fa7ecb09f718f6b1a9c83999cb37b34dfa.

Original commit message:

- - -

This diff changes code the release/3.11 branch to ensure we're not using dns.google and www.google.com over HTTP3. As documented in https://github.com/ooni/probe/issues/1873, since this morning (approx) these services do not support HTTP3 anymore. (I didn't bother with checking whether this issue affects _other_ Google services; I just limited my analysis to the services that we were using as part of testing.)

This patch WILL require forward porting to the master branch.
2021-11-12 14:43:28 +01:00
Simone Basso
3dad324f09
[forwardport] mk: update ooni/go and Android build tools (#590) (#591)
This diff forward ports abd212d014783cb96eaf821e9bb9a7b01039f837.

Original commit message:

- - -

This diff upgrades `./mk` to use go1.17.3 rather than go1.16. While there, also update other Android build tools.

This diff WILL need a forwardport to master.

Closes https://github.com/ooni/probe/issues/1863.
2021-11-10 14:51:59 +01:00
Simone Basso
4d80f7d9f0
[forwardport] chore: use go1.17.3 (#588) (#589)
This diff forward ports adcb0f9ae3b9e074c301d4f7f0e8f2d0ef6466b9.

Original commit message:

- - -

- ensure we use go1.17.3 in workflows

- update to a version of ooni/oohttp that uses go1.17.3

This change WILL need to be forward ported to master.

Closes https://github.com/ooni/probe/issues/1861
2021-11-10 14:18:04 +01:00
Simone Basso
0d65438ea1
[forwardport] fix(netxlite): remove android-specific errno (#586) (#587)
This commit forward ports 74947dbbd12266c12a38fad51a70fc78a21720fd from
the `release/3.11` branch to `master`. Here's the original commit message:

- - -

Android is also Linux. The Android build fails because both
errno_linux.go and errno_android.go are compiled.

There's no difference between the files except into a comment
that mentions "linux" or "android".

Therefore, it's safe to remove the android-specific file
and just keep and use the linux-specific one.

Part of https://github.com/ooni/probe/issues/1863, where we're
forward porting ooni/go patches to go1.17.

I'm still trying to figure out whether I can build oonimkall
using the forward ported patches and this error prevents me
from building, because the build fails.

"やれやれだぜ"

Note that this patch WILL need to be forward ported to master.

This bug was previosuly reported to me by @hellais.

Because I did run `go generate ./internal/netxlite/...` we also
get for free updated certificates, which is OK.
2021-11-10 13:00:41 +01:00
Simone Basso
6a935d5407
fix(netxlite): ensure HTTP errors are always wrapped (#584)
1. introduce implementations of HTTPTransport and HTTPClient
that apply an error wrapping policy using the constructor
for a generic top-level error wrapper

2. make sure we use the implementations in point 1 when we
are constructing HTTPTransport and HTTPClient

3. make sure we apply error wrapping using the constructor for
a generic top-level error wrapper when reading bodies

4. acknowledge that error wrapping would be broken if we do
not return the same classification _and_ operation when we wrap
an already wrapped error, so fix the to code to do that

5. acknowledge that the classifiers already deal with preserving
the error string and explain why this is a quirk and why we
cannot remove it right now and what needs to happen to safely
remove this quirk from the codebase

Closes https://github.com/ooni/probe/issues/1860
2021-11-06 17:49:58 +01:00
Simone Basso
da34cfe6c9
feat(QA): add test cases for websteps vs webconnectivity (#583)
This pull request introduces a set of Node.js scripts for performing A/B comparison of websteps and webconnectivity as described in https://github.com/ooni/probe/issues/1805. Rather than using Jafar, I ended up using `miniooni`'s `--censor` command line flag introduced in [v3.12.0-alpha.1](https://github.com/ooni/probe-cli/releases/tag/v3.12.0-alpha.1). The main reason for doing so is that it's simpler to run tests without requiring root access and Linux _and_ Docker (e.g., I did not develop part of this diff using Linux). Additionally, I choose to use Node.js rather than extending the existing Python framework for QA, because I found Node.js easier when working with JSON data.
2021-11-05 15:56:04 +01:00
Simone Basso
be89878dd4
doc(tutorial): explain the big picture (#582)
Each tutorial provides you a piece of knowledge. Add some text in
the main readme file explaining the big picture to the reader.

Closes https://github.com/ooni/probe/issues/1819
2021-11-05 14:51:14 +01:00
Simone Basso
ba7b981fcb
fix(measurex): allow API user to choose parallelism (#581)
Closes https://github.com/ooni/probe/issues/1818
2021-11-05 14:37:03 +01:00
Simone Basso
3b27780836
fix(webconnectivity): ignore any status code <= 0 (#579)
This diff changes the algorithm used by webconnectivity's
httpanalysis.go to ignore any status code <= 0 rather
than just ignoring the == 0 case.

Make sure we add test cases for when the control's status
code is negative rather than being zero.

While there, simplify code where boolean checks could be
more compact according to staticcheck.

Closes https://github.com/ooni/probe/issues/1825
2021-11-05 13:51:22 +01:00
Simone Basso
5b8f4546f3
cleanup(ooniprobe): remove unused send_crash_report option (#578)
Closes https://github.com/ooni/probe/issues/1766
2021-11-05 13:26:08 +01:00
Simone Basso
8dd051ead0
fix(CONTRIBUTING.md): require specific commit message for fwd/back ports (#577) 2021-11-05 13:08:10 +01:00
Simone Basso
fab7909281
chore: version is now 3.12.0-alpha.2 (#576) 2021-11-05 11:54:19 +01:00
Simone Basso
1f348803dc
fix(websteps): use a single Do53 resolver (#575)
Closes https://github.com/ooni/probe/issues/1807

While there, bump the experiment version number, because we have
applied changes since the last alpha release.
2021-11-05 11:40:58 +01:00
Simone Basso
dad8db4a36
fix(httpheader): use same Accept-Language as Brave (#574)
Closes https://github.com/ooni/probe/issues/1792
2021-11-05 11:31:10 +01:00
Simone Basso
60cfa68b5a
fix(measurex): avoid data race with HTTP request headers (#573)
Closes https://github.com/ooni/probe/issues/1859
2021-11-05 11:11:43 +01:00
Simone Basso
aa27bbe33f
fix(measurex): use same keys of the OONI data format (#572)
This change should simplify the pipeline's job.

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

I previously dismissed this possibility, but now it seems clear it
is simpler to have a very tabular data format internally and to
convert such a format to OONI's data format when serializing.

The OONI data format is what the pipeline expects, but processing
is easier with a more linear/tabular format.
2021-11-05 10:46:45 +01:00
Simone Basso
6f90d29bfa
feat(miniooni): add the --censor flag (#571)
This flag is similar to the previous --self-censor-spec and tells
miniooni what censorship to implement for itself.

This concludes the design at https://github.com/ooni/probe/issues/1803#issuecomment-957323297
2021-11-03 14:23:47 +01:00
Simone Basso
100cc559a2
Revert "feat(filtering): implement the divert policy (#569)" (#570)
This reverts commit 851b9913fa because
it seems it's not enough to allow us to see certificate errors with
quic, plus it's complex code. So, we'd rather develop a better approach,
and perhaps a simpler one, that works with QUIC as well.
2021-11-03 14:01:32 +01:00
Simone Basso
851b9913fa
feat(filtering): implement the divert policy (#569)
This is the policy we need to provoke certificate errors. We'll divert
from, say, `8.8.8.8:443/udp` to, say, `1.1.1.1:443/udp`.

We'll do something similar for `443/tcp`.

This will cause certificate validation errors.

With this change, we have now implemented the simple design described
by https://github.com/ooni/probe/issues/1803#issuecomment-957323297.
2021-11-03 00:29:14 +01:00
Simone Basso
675e3a5ba5
feat(filtering): introduce DNS cache (#568)
When we're testing multiple endpoints, it's quite important to control
the order with which they are returned to the code.

This feature is especially relevant to Web Connectivity, which will
check the endpoints to connect to in order.

Therefore, we need to force deterministic results to ensure that we can
have deterministic tests when doing Web Connectivity QA.

This diff gives us the guarantee that we can have determinism.

Part of https://github.com/ooni/probe/issues/1803#issuecomment-957323297.
2021-11-02 23:35:09 +01:00
Simone Basso
11ccd16a0c
feat(filtering): add transparent proxy with censorship policies (#566)
This PR implements the core concept described at
https://github.com/ooni/probe/issues/1803#issuecomment-957323297
2021-11-02 21:52:32 +01:00
Simone Basso
560b1a9a97
fix(filtering): avoid the if err == nil pattern (#567)
1. in normal code is better to always do if err != nil so that
the ifs only contain error code (this is ~coding policy)

2. in tests we want to ensure we narrow down the error to the
real error that happened, to have greater confidence

Written while working on https://github.com/ooni/probe/issues/1803#issuecomment-957323297
2021-11-02 19:48:10 +01:00
Simone Basso
374577f5a8
feat(filtering): implement HTTP filtering proxy (#565)
Needed to finish the design at https://github.com/ooni/probe/issues/1803#issuecomment-957323297
2021-11-02 14:13:54 +01:00
Simone Basso
a6f5388bac
fix(filtering/dns.go): serve requests in parallel (#564)
Without this change, it takes too much to serve a single query and
we cannot properly use this code for QA.

See https://github.com/ooni/probe/issues/1803#issuecomment-957323297
2021-11-02 12:40:18 +01:00
Simone Basso
d9c43f1d1b
refactor(netxlite/filtering): use strings for blocking policies (#563)
This change will simplify follow-up work done as part of
https://github.com/ooni/probe/issues/1803#issuecomment-957323297 to
implement a comprehensive self-censoring solution.

While there, rename the "proxy" action to "pass" because what we
are effectively doing is passing traffic to the network (that's a
minor change but it seems a better analogy).
2021-11-02 12:31:42 +01:00
Simone Basso
f91de2ecd6
cleanup: move bogon checking code in netxlite (#562)
I develop this diff while working on https://github.com/ooni/probe/issues/1803#issuecomment-957323297.

While there, make sure we don't have duplicate bogon code
and always use the code inside netxlite.
2021-11-02 12:20:04 +01:00
Simone Basso
ffdafaf351
feat(netxlite): implement hooks for transparent proxy (#561)
See https://github.com/ooni/probe/issues/1803#issuecomment-957323297.
2021-11-02 12:04:40 +01:00
Simone Basso
eaa3d6eae0
chore: bump version to 3.12.0-alpha.1 (#559)
Part of https://github.com/ooni/probe/issues/1815
2021-10-22 17:52:48 +02:00
Simone Basso
1f0fcafb8a
fix: ensure we bind oohelperd with the repo's version number (#558)
Work related to https://github.com/ooni/probe/issues/1506#issuecomment-949715707.

This diff cherry-picks from the release/3.11 branch.
2021-10-22 17:21:38 +02:00
Simone Basso
8f202a71ac
doc(readme): improve the content and organisation (#557)
As mentioned in https://github.com/ooni/probe/issues/1506#issuecomment-949703011, it makes sense to tweak the readme while we're making a new release.
2021-10-22 17:02:18 +02:00
Srijan Srivastava
3f0da81bf8
made tutorial outputs more presentable (#555)
Closes https://github.com/ooni/probe/issues/1831
2021-10-22 16:17:57 +02:00
Simone Basso
a9319142f3
feat: only publish pkgs when we're in staging branches (#556)
See https://github.com/ooni/probe/issues/1506#issuecomment-949664779
2021-10-22 16:13:44 +02:00
Simone Basso
197dc37461
doc: document branching and releasing (#554)
This diff starts to better specify branching and the release process, thus addressing https://github.com/ooni/probe/issues/1506#issuecomment-949623019.
2021-10-22 15:41:53 +02:00
Simone Basso
638acb0830
fix: build ooniprobe for linux using debian/amd64 (#552) (#553)
In https://github.com/ooni/probe/issues/1741, we observed that
every attempt to use `docker --platform` along with `debian` for
packaging ooniprobe fails with `SEGFAULT`, except when using
the `debian:oldstable` container.

To fix this issue, in this diff we fix Debian packaging to run on
any debian system (`debian:stable` in our case) provided that we
have `qemu-user-static` installed on the system and the system is
a Debian (or Debian-derived) system.

The trick here is to use `dpkg-buildpackage -a $deb_arch`. We
also need to disable a few `debian/rules` that we don't actually
need anyway.

Closes https://github.com/ooni/probe/issues/1741.

This cherry-picks 36a5bf34f99f382a081efd642dd472888a57602b
from the stable branch into the master branch.
2021-10-22 15:14:11 +02:00
Simone Basso
9848f3713e
fix(ci/debianrepo): avoid running docker arm64 (#551)
The issue at https://github.com/ooni/probe/issues/1741 is that running `docker --platform linux/arm64` segfaults when running `sudo apt-get update -q` inside the `arm64` docker environment.

As far as the `debianrepo` rule is concerned, we can fix the issue by taking advantage of Debian multi-arch. We now configure Debian multi-arch and install the package inside a `debian:stable` environment.

We keep using docker. In principle we could not. But the Ubuntu environment provided by GitHub actions does not support multi-arch for arm. Also, I'd like testing this rule to be possible also locally (where I don't have Debian).
2021-10-21 16:55:00 +02:00
Simone Basso
b7b87ee0de
fix(ci): use correct rule name for debianrepo workflow (#550)
See https://github.com/ooni/probe/issues/1840
2021-10-21 11:04:27 +02:00
Simone Basso
d44970a43f
master: update deps and set version to 3.12.0-alpha (#548)
* chore: update all workflows to use go1.17.2

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

* chore: update all dependencies

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

* chore: run `go generate`

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

* chore: update the user-agent

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

* Set version to 3.12.0-alpha

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

* fix: update to ooni/probe-assets@v0.5.0

This overcomes https://github.com/ooni/probe/issues/1836 in the CLI and,
while there, let us also make maxminddb tests stricter.

* fix(QA/Dockerfile): build using go1.17

See https://github.com/ooni/probe-cli/pull/547#issuecomment-947760839

* chore(mk): use go1.17.2

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

* fix(codeql): always run for master

Otherwise we see a warning that there is no CodeQL information
available for the base branch and this is sub-optimal.

Part of https://github.com/ooni/probe/issues/1815
2021-10-20 18:16:40 +02:00
Simone Basso
2fa87f0e00
fix(wcth): match legacy TH w/ empty DNS reply (#546)
See https://github.com/ooni/probe/issues/1707#issuecomment-944322725
2021-10-15 16:20:07 +02:00
Simone Basso
2d1666b88b
fix(wcth): emit empty Addrs when input URL contains addr (#545)
Matches the behavior that the legacy TH implements in this
situation and reduces slightly the differences.

See https://github.com/ooni/probe/issues/1707#issuecomment-944143329
2021-10-15 12:00:20 +02:00
Simone Basso
730b00ff73
fix(ooniprobe): Measure returns EITHER measurement OR error now (#544)
See https://github.com/ooni/probe/issues/1816

This diff addresses the most immediate issue but there is probably
extra work to do, including testing and making sure experiments
do not return an error when they should not.
2021-10-14 12:16:55 +02:00
Simone Basso
4b8cae692b
fix(oohelperd): reduce errors to what the old TH would emit (#543)
Reducing the errors is not done in a perfect way.

We have documented the most striking differences inside
https://github.com/ooni/probe/issues/1707#issuecomment-942283746 and
some attempts to improve the situation further inside
https://github.com/ooni/probe/issues/1707#issuecomment-942341255.

A better strategy for the future would be to introduce more
specific timeout errors, such as dns_timeout_error, etc.

More testing may be needed to further validate and compare the
old and the new TH, but this requires Jafar improvements to
more precisely simulate more complex censorship.
2021-10-13 16:37:02 +02:00
Simone Basso
299834174a
fix(webconnectivity): gather longer HTML titles (#542)
Allows us to get http://www.isa.gov.il/Pages/default.aspx's one.

Discovered when working on https://github.com/ooni/probe/issues/1707.
2021-10-13 13:50:22 +02:00
Simone Basso
9e365661f0
fix(oohelperd): return HTTP headers as empty map on error (#541)
Part of https://github.com/ooni/probe/issues/1707
2021-10-13 13:27:09 +02:00
Simone Basso
43c349fe38
feat: annotate measurements with their architecture (#540)
Closes https://github.com/ooni/probe/issues/1772
2021-10-13 10:31:46 +02:00
Arturo Filastò
46e00888ae
Edits to the measurex tutorial (#534) 2021-10-11 17:48:45 +02:00
Simone Basso
1ffb2db0ca
fix(measurex): quic follow-up only with https scheme (#538)
Closes https://github.com/ooni/probe/issues/1799
2021-10-05 13:02:56 +02:00
Simone Basso
a6318d6de9
feat(webconnectivity): collect timing information (#537)
Work related to https://github.com/ooni/probe/issues/1797
2021-10-05 12:52:19 +02:00
Simone Basso
3f511d100b
fix(websteps): use correct input for each URL measurement (#536)
Closes https://github.com/ooni/probe/issues/1798
2021-10-05 12:29:00 +02:00
Simone Basso
9b52a050ba
fix: add missing reference to netxlite's tutorial (#535)
See https://github.com/ooni/probe-cli/pull/506
2021-10-04 15:37:48 +02:00
Simone Basso
762fb27c0b
fix(netxlite/quic): close udp conn after failed handshake (#533)
Closes https://github.com/ooni/probe/issues/1794
2021-09-30 18:00:38 +02:00