Commit Graph

64 Commits

Author SHA1 Message Date
kelmenhorst
10a2055163
quic: use RFC9000 version (#376)
* #1682: RFC9000 as main QUIC version

* removed extra ALPN values from the TLSConfig

* updated to quic-go v0.21.0

* only use h3
2021-06-14 16:59:24 +02:00
Simone Basso
85c71c09dc
feat: introduce ptx package for pluggable transports dialers (#373)
* feat: introduce ptx package for pluggable transports dialers

Version 2 of the pluggable transports specification defines a function
that's like `Dial() (net.Conn, error`).

Because we use contexts as much as possible in `probe-cli`, we are
wrapping such an interface into a `DialContext` func.

The code for obfs4 is adapted from https://github.com/ooni/probe-cli/pull/341.

The code for snowflake is significantly easier than it is in
https://github.com/ooni/probe-cli/pull/341, because now Snowflake
supports the PTv2 spec (thanks @cohosh!).

The code for setting up a pluggable transport listener has also
been adapted from https://github.com/ooni/probe-cli/pull/341.

We cannot merge this code yet, because we need unit testing, yet the
newly added code already seems suitable for these use cases:

1. testing by dialing and seeing whether we can dial (which is not
very useful but still better than not doing it);

2. spawning tor+pluggable transports for circumvention (we need a
little more hammering like we did in https://github.com/ooni/probe-cli/pull/341,
which is basically https://github.com/ooni/probe/issues/1565, and then
we will be able to do that, as demonstrated by the new, simple client which
already allows us to use pluggable transports with tor);

3. testing by launching tor (when available) with a set of
pluggable transports (which depends on https://github.com/ooni/probe-engine/issues/897
and has not been assigned an issue yet).

* fix: tweaks after self code-review

* feat: write quick tests for ptx/obfs4

(They run in 0.4s, so I think it's fine for them to always run.)

* feat(ptx/snowflake): write unit and integration tests

* feat: create a fake PTDialer

The idea is that we'll use this simpler PTDialer for testing.

* feat: finish writing tests for new package

* Apply suggestions from code review

* Update internal/ptx/dependencies_test.go

Co-authored-by: Arturo Filastò <arturo@openobservatory.org>

* Update internal/ptx/dependencies_test.go

Co-authored-by: Arturo Filastò <arturo@openobservatory.org>

* chore: use as testing bridge one that's used by tor browser

The previous testing bridge used to be used by tor browser but
it was subsequently removed here:

e26e91bef8

See https://github.com/ooni/probe-cli/pull/373#discussion_r649820724

Co-authored-by: Arturo Filastò <arturo@openobservatory.org>
2021-06-14 10:20:54 +02:00
Simone Basso
a4cf473ee9
Release 3.10.0 beta.3 (#345)
* chore: run go-generate

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

* chore: update all the dependencies

Unclear to me why `go get -u -v ./...` did not actually update
all of them and I needed to spell out each of them and force to
update by going `go get -u -v $pkg@latest` ¯\_(ツ)_/¯.

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

* fix(c/o/i/d/actions_test.go): ensure we check for return value

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

* chore: update the user agents we use

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

* chore: set version to 3.10.0-beta.3

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

* chore: use probe-assets v0.3.1

Part of https://github.com/ooni/probe/issues/1468
2021-05-13 08:16:28 +02:00
Simone Basso
1d70b81187
More progress towards release v3.10.0 (#320)
* chore: unvendor github.com/mitchellh/go-wordwrap

The library seems reasonably maintained and tested.

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

* fix(netx/quicdialer): ensure we handle all errors

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

* fix previous

* cleanup: remove unnecessary shutil fork

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

* doc: documented some undocumented functions

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

* fix(ooniprobe): rename mis-named function

Part of https://github.com/ooni/probe/issues/1439
2021-04-29 15:59:53 +02:00
Simone Basso
a88d2f35a8
Prepare 3.10.0-beta release (#313)
This diff implements part of the release checklist at https://github.com/ooni/probe/issues/1439. The plan is to bless a beta release and use it for further testing on Android devices. Afterward, we need to apply some extra changes to the `cli` (including https://github.com/ooni/probe-cli/pull/314 and https://github.com/ooni/probe-cli/pull/312). Finally, we will bless a full 3.10.0 release.
2021-04-28 09:34:14 +02:00
Simone Basso
973501dd11
feat(tunnel): implement the fake tunnel (#298)
This functionality should be helpful to test that the general
interface of the tunnel package is okay from the engine package.

Part of https://github.com/ooni/probe/issues/985
2021-04-05 17:41:15 +02:00
Simone Basso
c89ecce3e0
feat: support embedding encrypted psiphon config (#285)
We use an optional build tag to hide this configuration. When you
choose this configuration, you need to provide the encrypted config
as well as the corresponding decryption key.

This is not the final design. This is an interim design to start
working and experimenting with this functionality. The general
idea here is to support psiphon in the binaries we build without
committing the psiphon config to the repository itself.

Part of https://github.com/ooni/probe/issues/985
2021-04-02 17:36:06 +02:00
Simone Basso
31e478b04e
refactor: redesign how we import assets (#260)
* fix(pkg.go.dev): import a subpackage containing the assets

We're trying to fix this issue that pkg.go.dev does not build.

Thanks to @hellais for this very neat idea! Let's keep our
fingers crossed and see whether it fixes!

* feat: use embedded geoip databases

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

Work done as part of https://github.com/ooni/probe/issues/1369.

* fix(assetsx): add tests

* feat: simplify and just vendor uncompressed DBs

* remove tests that seems not necessary anymore

* fix: run go mod tidy

* Address https://github.com/ooni/probe-cli/pull/260/files#r605181364

* rewrite a test in a better way

* fix: gently cleanup the legacy assetsdir

Do not remove the whole directory with brute force. Just zap the
files whose name we know. Then attempt to delete the legacy directory
as well. If not empty, just fail. This is fine because it means the
user has stored other files inside the directory.

* fix: create .miniooni if missing
2021-04-01 16:57:31 +02:00
Simone Basso
7ca32b5ce6
release process: update dependencies (#280)
Part of the check-list at https://github.com/ooni/probe/issues/1369
2021-03-31 16:40:58 +02:00
Simone Basso
55bdebe8b2
engine/ooapi: autogenerated API with login and caching (#234)
* internal/engine/ooapi: auto-generated API client

* feat: introduce the callers abstraction

* feat: implement API caching on disk

* feat: implement cloneWithToken when we require login

* feat: implement login

* fix: do not cache all APIs

* feat: start making space for more tests

* feat: implement caching policy

* feat: write tests for caching layer

* feat: add integration tests and fix some minor issues

* feat: write much more unit tests

* feat: add some more easy unit tests

* feat: add tests that use a local server

While there, make sure many fields we care about are OK.

* doc: write basic documentation

* fix: tweak sentence

* doc: improve ooapi documentation

* doc(ooapi): other documentation improvements

* fix(ooapi): remove caching for most APIs

We discussed this topic yesterday with @FedericoCeratto. The only
place where we want LRU caching is MeasurementMeta.

* feat(ooapi): improve handling of errors during login

This was also discussed yesterday with @FedericoCeratto

* fix(swaggerdiff_test.go): temporarily disable

Before I work on this, I need to tend onto other tasks.

* fix(ootest): add one more test case

We're going towards 100% coverage of this package, as it ought to be.

* feat(ooapi): test cases for when the probe clock is off

* fix(ooapi): change test to have 100% unittest coverage

* feat: sync server and client APIs definition

Companion PR: https://github.com/ooni/api/pull/218

* fix(ooapi): start testing again against API

* fix(ooapi): only generate each file once

* chore: set version to 3.7.0-alpha

While there, make sure we don't always skip a currently failing
riseupvpn test, and slightly clarify the readme.

* fix(kvstore): less scoped error message
2021-03-04 11:51:07 +01:00
Simone Basso
0d4323ae66
Release 3.6.0 (#239)
* chore: update dependencies

* chore: update user agent for measurements

* chore: we're now at v3.6.0

* chore: update assets

* chore: update bundled CA

* fix: address some goreportcard.com warnings

* fix(debian/changelog): zap release that breaks out build scripts

We're forcing the content of changelog with `dch`, so it's fine to
not have any specific new release in there.

* fix: make sure tests are passing locally

Notably, I removed a chunk of code where we were checking for network
activity. Now we don't fetch the databases and it's not important. Before,
it was important because the databases are ~large.

* fix: temporarily comment out riseupvn integration tests

See https://github.com/ooni/probe/issues/1354 for work aimed at
reducing the rate of false positives (thanks @cyBerta!)
2021-03-03 14:42:17 +01:00
Simone Basso
322394fe63
feat: use go1.16 and resources embedding (#235)
* feat: use go1.16 embedding for resources

We want to embed everything that can be easily embedded. We should, at a
minimum, replace the downloading of resources and bindata.

Ref: https://github.com/ooni/probe/issues/1367.

* fix: get rid of bindata and use go embed instead

* fix: start unbreaking some automatic tests

* fix: fetch resources as part of the mobile build

* fix: convert more stuff to go1.16

I still expect many breakages, but we'll fix them.

* fix: make the windows CI green

* fix: get resources before running QA

* fix: go1.16 uses modules by default

* hopefully fix all other outstanding issues

* fix(QA/telegram.py): add another DC IP address

* Apply suggestions from code review
2021-03-02 12:08:24 +01:00
Arturo Filastò
92ddbd5a5f Update dependencies 2021-02-12 20:01:03 +01:00
Arturo Filastò
978cd28d88
Disable sentry based crash reporting in probe-cli (#228) 2021-02-12 19:49:18 +01:00
Simone Basso
d57c78bc71
chore: merge probe-engine into probe-cli (#201)
This is how I did it:

1. `git clone https://github.com/ooni/probe-engine internal/engine`

2. ```
(cd internal/engine && git describe --tags)
v0.23.0
```

3. `nvim go.mod` (merging `go.mod` with `internal/engine/go.mod`

4. `rm -rf internal/.git internal/engine/go.{mod,sum}`

5. `git add internal/engine`

6. `find . -type f -name \*.go -exec sed -i 's@/ooni/probe-engine@/ooni/probe-cli/v3/internal/engine@g' {} \;`

7. `go build ./...` (passes)

8. `go test -race ./...` (temporary failure on RiseupVPN)

9. `go mod tidy`

10. this commit message

Once this piece of work is done, we can build a new version of `ooniprobe` that
is using `internal/engine` directly. We need to do more work to ensure all the
other functionality in `probe-engine` (e.g. making mobile packages) are still WAI.

Part of https://github.com/ooni/probe/issues/1335
2021-02-02 12:05:47 +01:00
Simone Basso
b1ce300c8d
fix: import path should be github.com/ooni/probe-cli/v3 (#200)
See https://github.com/ooni/probe/issues/1335#issuecomment-771499511
2021-02-02 10:32:46 +01:00
Simone Basso
504a4e79d4
feat: implement darwin launch agent (#192)
* feat: sketch out periodic command

* feat: sketch out periodic command for macOS

* feat: implement darwin's launch agent

* refactor: better way to run on darwin

Make sure we have code that builds on all platforms.

* fix(run): max 10 URLs with darwin in unattended mode

* feat: add support for seeing/streaming logs

* feat: implement the status command and add usage hints

* feat(periodic): run onboarding if needed

* fix: no too confusing function names

* fix: s/periodic/autorun/

Discussed earlier this morning with @hellais.

* fix: we cannot show logs before Big Sur

Bug reported by @hellais.
2021-01-14 18:32:05 +01:00
Simone Basso
acfa429127
chore: update deps (probe-engine 0.22.0 et al.) (#190)
The CloseReport method is gone. We don't need to close reports
anymore with the new OONI backend.

The InputsRequired flags now is InputsOrQueryTestLists.
2021-01-13 00:25:25 +01:00
Simone Basso
a8070edc27
chore: update dependencies (#185) 2020-12-07 11:51:09 +01:00
Simone Basso
cb58fb5b79
go get -v github.com/ooni/probe-engine@f8284475147 (#184) 2020-12-04 14:36:52 +01:00
Simone Basso
a324e94973
refactor(webconnectivity): use engine.InputLoader (#179)
This diff pins to ooni/probe-engine@3049779878
and starts using the recently introduced probe-engine APIs.

Namely, here, we use the InputLoader for loading URLs.

I've confirmed manually everything is still working as intended.

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

(In particular, the InputLoader is the abstraction allowing us to load
input from several sources, including command line flags and external
files.)
2020-11-30 15:39:25 +01:00
Simone Basso
95906fbcce
feat: use ooni/probe-engine@286613b74e and cleanup (#177)
* feat: use ooni/probe-engine@286613b74e and cleanup

1. zap unused configuration settings from the config file but do not
bump the version number because doing that _may_ interact in unexpected
ways with probe-desktop (hence https://github.com/ooni/probe/issues/1297)
and also because we've just _removed_ stuff for now, therefore any
previous configuration file will continue to work, except that we'll
be ignoring a bunch of options. In a future version of probe-cli I'll
spend some time to further improve config file management.

2. accordingly, make sure all current configuration files that are around
in the tree are current and only feature supported options.

3. update to ooni/probe-engine@286613b74e, which contains a bunch of
APIs that should allow us to simplify the interaction between the cli and
the engine, by sharing code more cleverly.

4. zap GetTestKeys because now we use code in probe-engine instead.

5. zap LogSummary because it was not being used.

6. the main change related to cleaning up the config and to the update
to the latest probe-engine is that include_{cc,asn,ip} settings are
gone and we now share the CC and the ASN and we never share the IP addr.

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

After this change is landed, there's a bunch more work to do to further
unify cli and engine. The final state will be that the cli uses ~the code
used by miniooni, so it will have a bunch of desirable options.

* fix: bindata after recent changes
2020-11-26 18:48:20 +01:00
Simone Basso
c55f67273e
chore: set version to 3.0.12-alpha (#172)
* chore: set version to 3.0.12-alpha

I need to bless 3.0.11 now to pin to ooni/probe-engine v0.20.2.

* chore: update all dependencies

Most notably, pin to ooni/probe-engine 0.20.2.
2020-11-17 18:22:46 +01:00
Simone Basso
c4da81e894
chore: upgrade all dependencies (#159)
See https://github.com/ooni/probe-engine/issues/1004
2020-11-13 06:58:39 +01:00
Simone Basso
f172031a03
Release 3.0.9 (#156)
* chore(version.go): we're now at 3.0.9

* chore(go.mod go.sum): update dependencies

* fix(gha/cross.yml): brew update seems broken?

See https://github.com/ooni/probe-cli/pull/156/checks?check_run_id=1315116799
2020-10-27 15:23:24 +01:00
Simone Basso
acfbbd9dd5 go.mod: pin to ooni/probe-engine@v0.18.0 2020-10-06 12:49:56 +02:00
Simone Basso
ad88fefe41 Start testing v3.0.8-beta
This beta release incorporates recent fixes in ooni/probe-engine that we
would like to test and ship relatively soon.

I'm doing this as part of https://github.com/ooni/explorer/issues/495
2020-10-05 19:25:19 +02:00
Simone Basso
f1f2350bfa
Release v3.0.7 (#152)
* Update go-bindata and regenerate binary data

* Pin to ooni/probe-engine 0.17.0 and update dependencies

* Set version to 3.0.7

* Readme.md: better release instructions
2020-09-30 10:54:58 +02:00
Simone Basso
4c65147009
WIP: Start preparing release v3.0.7 (#147)
* Use ooni/probe-engine 0.16.0
* Update all the other dependencies
* Use GitHub Actions rather than Travis CI
* Automatically build and test binaries on the target OS (for Windows, macOS, Linux on amd64)
* Make sure we correctly measure coverage
* Make sure we use `-race` when running tests
* Remove unnecessary scripts
* Make sure the README is up-to-date
* Write small script to update binary data and add GitHub Actions checks for it
* Notice that we needed to run ./updatebindata.sh and run it
* Self documenting instructions regarding cross compiling
* Set version number to v3.0.7-beta

Part of https://github.com/ooni/probe-engine/issues/748
2020-08-22 11:20:50 +02:00
Simone Basso
b05ec668e3 Pin to ooni/probe-engine 0.15.2 2020-07-23 19:39:06 +02:00
Simone Basso
de62c51342 Pin to ooni/probe-engine@v0.15.1 2020-07-23 11:29:55 +02:00
Simone Basso
6587c4d386 Pin to 57a29da91d
See 2d94c2eb4c
2020-07-21 20:33:19 +02:00
Simone Basso
552d8e73c2 Upgrade all deps to the latest stable version 2020-07-21 15:48:02 +02:00
Simone Basso
2f47634ad1
Use ooni/probe-engine@v0.14.1 (#141) 2020-07-10 11:23:45 +02:00
Simone Basso
9902d74f19 go get -v github.com/ooni/probe-engine@v0.13.2 && go mod tidy
Part of https://github.com/ooni/probe-engine/issues/728
2020-06-24 11:59:15 +02:00
Simone Basso
596e3ae0f5 go.mod go.sum: pin to github.com/ooni/probe-engine@v0.13.1 2020-06-19 12:59:58 +02:00
Simone Basso
ef4b1aee76
Upgrade to probe-engine@v0.13.0 and fix Psiphon logic (#138)
* go.mod go.sum: pin to ooni/probe-engine@v0.13.0, update all other deps

Make sure dependencies of probe-engine are at the same exact version to
which is probe-engine, to avoid any possible issue.

* Readme.md: clarify the procedure for updating deps
2020-06-15 14:57:00 +02:00
Simone Basso
b4934b1619
Use ooni/probe-engine 0.12.0+patches (#133)
* nettests/groups.go: remove redundant struct names

* go.mod go.sum: update deps except probe-engine

* Update to ooni/probe-engine@e768161f91

The API has changed. Methods that used to change bits of the session have
been removed. Now the session is more immutable than before.

As such, we need to completely fill the config before using it.

* Set IncludeCountry to always true

Co-authored-by: Arturo Filastò <arturo@filasto.net>
2020-06-04 11:19:38 +02:00
Simone Basso
76bb083ec4 Update to probe-engine@v0.11.0
This also updates all the dependencies that needed it.
2020-05-14 16:53:22 +02:00
Simone Basso
46e01eab98 Pin to ooni/probe-engine@v0.10.0
Part of https://github.com/ooni/probe-engine/issues/504
2020-04-22 17:16:51 +02:00
Simone Basso
acbe133ad6 go.mod go.sum: pin to ooni/probe-engine@7ac6a37960
This includes fixes in the data format emitted by ndt7.
2020-04-08 13:04:25 +02:00
Simone Basso
4a563ebe13 Pin to latest probe-engine and bless v3.0.0-rc.13
I'm pinning to ooni/probe-engine@72c12b0b81
because it generates more correct data and I think we're going to have
most likely this probe-cli version in the stable desktop release.
2020-04-06 13:22:10 +02:00
Simone Basso
9f4ae7c78b Update direct and indirect dependencies 2020-04-05 23:38:39 +02:00
Simone Basso
07e4367f6d
nettests: Just use "ndt", which is now "ndt7" in probe-engine (#121)
Part of https://github.com/ooni/backend/issues/369
2020-03-18 15:50:55 +01:00
Simone Basso
fe0b4a02be
nettests/ndt.go: use ndt7 rather than ndt5 (#119)
Part of https://github.com/ooni/probe/issues/969
2020-03-12 19:36:32 +01:00
Simone Basso
1d5c913019
Update deps and pin to ooni/probe-engine@v0.8.0 (#118)
Part of https://github.com/ooni/probe/issues/1030
2020-03-10 12:02:30 +01:00
Simone Basso
6b9353ebe1 Pin to ooni/probe-engine@8ba2a70c5f
This allows us to pull this fix https://github.com/ooni/probe-engine/pull/375.

It's part of the QA for probe-cli https://github.com/ooni/probe/issues/1028.
2020-02-27 14:34:13 +01:00
Simone Basso
f3b21f90c6
deps: latest upper.io/db and pin probe-engine (#116)
We're specifically pinning a commit of probe-engine that is using
MK v0.10.11, so that we address the following issues:

1. we use db-ip.com for the country database as opposed to using
the increasingly stale MaxMind database (see https://github.com/ooni/probe-engine/issues/334)

2. we're using an implementation of WhatsApp that does not suffer
from the super-old CIDR bug (see https://github.com/ooni/probe-engine/issues/341)

3. we're not linking to libcurl anymore on Windows and Linux, thanks to
this new version of MK where we can optionally disable libcurl; we are
still linking to libcurl on macOS, but that has no impact on the binary
size since on macOS libcurl is part of the system

This should be enough, from my side to bless a new release of the
probe-cli (see https://github.com/ooni/probe/issues/1028).
2020-02-26 22:34:23 +01:00
Simone Basso
051aee1aac
Update all deps, pin to probe-engine@v0.7.0 (#114) 2020-02-22 15:23:20 +01:00
Simone Basso
c38c01f974
build.sh: pass -tags ooni to build (#112)
See https://github.com/ooni/probe-engine/pull/333

Closes https://github.com/ooni/probe-engine/issues/267
2020-02-18 09:53:38 +01:00