Commit Graph

384 Commits

Author SHA1 Message Date
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
bd451016f5
release 3.9.0 process: reduce warnings (#279)
* fix(riseupvpn): address gofmt warning

Thanks to https://goreportcard.com/report/github.com/ooni/probe-cli.

* fix(utils.go): correct the docu-comment

Thanks to https://goreportcard.com/report/github.com/ooni/probe-cli

* fix: improve spelling

Thanks to https://goreportcard.com/report/github.com/ooni/probe-cli

* fix(modelx_test.go): avoid inefassign warning

Thanks to https://goreportcard.com/report/github.com/ooni/probe-cli

* fix: reduce number of ineffective assignments

Thanks to https://goreportcard.com/report/github.com/ooni/probe-cli
2021-03-31 15:59:19 +02:00
cyBerta
991b0a6120
riseupvpn: reduce false positives (#233)
* fetch RiseupVPN CA cert with MultiGetter. It allows us to write better tests and ensures this test step is added in the logs

* Implement TransportStatus for RiseupVPN tests. It indicates if a whole transport is blocked, which is considered as a test anomaly

* Redesign unit tests for RiseupVPN. Instead of a real backend, mocked server responses are used. Tests for invalid CA certs and for TransportStatus are added.

* Update internal/engine/experiment/riseupvpn/riseupvpn.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-03-30 12:02:51 +02:00
Simone Basso
a0763756b2
fix(miniooni): replace --limit with --max-runtime (#272)
Part of https://github.com/ooni/probe/issues/1299
2021-03-29 20:38:23 +02:00
Simone Basso
b718335ee3
refactor(inputloader): remove unnecessary javisms (#271)
Part of https://github.com/ooni/probe/issues/1299.
2021-03-29 20:00:50 +02:00
Simone Basso
1da64f6d9f
fix(internal/fsx): remove pre Go 1.16 definitions (#270)
Occurred to me while working on https://github.com/ooni/probe/issues/1299.
2021-03-29 19:37:32 +02:00
Simone Basso
87e5234586
refactor(inputloader): all fast tests together (#269)
This change allows us to have all fasts tests together. They are
mostly unit tests or integration tests that do not require the
network. The advantage of this strategy is the following. We can
now run all these tests with a single click in VSCode. In turn,
doing that tells us which lines of code we are not covering.

The tests requiring the network are in a separate file, so we can
easily see which lines of code are testing without using the network
and which ones instead depend on that. (Currently, 100% of the
inputloader.go file is tested without using the network.)

While there, rename the other file such that is clear that it
contains tests requiring the network. We now have some tests in
inputloader_test.go that are not strictly unit tests.

This refactoring was identified as useful while working
on https://github.com/ooni/probe/issues/1299.
2021-03-29 19:19:06 +02:00
Simone Basso
f5b5ac47b0
refactor: merge libminiooni into cmd/miniooni (#268)
We used to have an external package called libminiooni so that
third parties could use it. We wrote this such that we could
support github.com/bassosimone/aladdin.

That was actually a not-so-good idea because it added to the APIs
we needed to maintain.

Since the merge of engine into cli, such an API is not public
anymore and aladdin has been deprecated and archived.

Therefore, we can now cleanup the situation and merge libminiooni
into miniooni again, thus making the codebase more local.

This cleanup has been identified while working on
https://github.com/ooni/probe/issues/1299.
2021-03-29 19:03:53 +02:00
Simone Basso
5973c88a05
feat(inputloader): use check-in to fetch URLs (#267)
* ongoing work

* reduce diff with master

* feat(inputloader): use the check-in API

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

* fix: better naming for a variable

* chore: add more tests

* fix: add one more TODO
2021-03-29 18:46:26 +02:00
Simone Basso
e0b0dfedc1
feat(session): expose CheckIn method (#266)
* feat(session): expose CheckIn method

It seems to me the right thing to do is to query the CheckIn API
from the Session rather than querying it from InputLoader.

Then, InputLoader could just take a reference to a Session-like
interface that allows this functionality.

So, this diff exposes the Session.CheckIn method.

Doing that, in turn, required some refactoring to allow for
more and better unit tests.

While doing that, I also noticed that Session required a mutex
to be a well-behaving type, so I did that.

While doing that, I also tried to cover all the lines in session.go
and, as part of that, I have removed unused code.

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

* fix: reinstate comment I shan't have removed

* fix: repair broken test

* fix: a bit more coverage, annotations, etc.

* Update internal/engine/session.go

* Update internal/engine/session_integration_test.go

* Update internal/engine/session_internal_test.go
2021-03-29 15:04:41 +02:00
Simone Basso
0115d6c470
refactor(inputloader): better docs and naming (#265)
* refactor(inputloader): better docs and naming

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

* fix: correct a typo
2021-03-26 09:34:27 +01:00
Simone Basso
c94721d9e5
fix(sessionresolver): proxy check conditional on existing proxy (#264)
There was a face-palming error in the implementation causing the proxy
check to be implemented also without a proxy.

This meant that we were ALWAYS skipping http3 and system resolvers.

The bug has been introduced in 3.8.0. So, the currently released
version of the probe, sadly, has this beheavior :-(.

Reference issue https://github.com/ooni/probe/issues/1426.
2021-03-25 15:18:29 +01:00
Simone Basso
3b029ee0d6
feat(ExperimentOrchestraClient): add CheckIn (#263)
We use ExperimentOrchestraClient in several places to help us
calling probe-services APIs. We need to call CheckIn because we
want to use CheckIn in InputLoader.

(We also want to remove the URLs API, but that is not something
doable now, since the mobile app is still using this API via
the wrappers at pkg/oonimkall.)

Work part of https://github.com/ooni/probe/issues/1299.
2021-03-25 12:02:02 +01:00
Simone Basso
576059b3fa
fix: apply staticcheck suggestions (#262)
Preliminary work done as part of https://github.com/ooni/probe/issues/1299
2021-03-24 12:35:53 +01:00
Simone Basso
fc19c9901a
fix(webconnectivity): expose network events (#258)
* fix(webconnectivity): expose network events

By not exposing network events in webconnectivity, we are missing
several interesting, explanatory data points.

This diff fixes the issue by:

1. enriching the definition of network events to include extra
data useful for performing (manual) data analysis;

2. adding a tags field to network events such that we can add
tags to specific events and understand where they come from;

3. exposing all the (tagged) network events that happen when running
a webconnectivity experiment.

See https://github.com/ooni/probe-engine/issues/1157.

* progress

* more work towards landing this diff

* Apply suggestions from code review
2021-03-23 16:46:46 +01:00
Arturo Filastò
70d7c1a22c
Add signal to the im test group (#259)
* Add signal to the im test group

* fix(ipconfig_test.go): disable when running in CI

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

* fix(geolocate): remove unused variable

Came across this while looking into this issue with the CI that
is now failing. Guess fixing it here comes across as leaving the
camp slightly less in a bad shape than how I found it.

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-03-22 14:31:50 +01:00
Simone Basso
28ce79eff1
feat(ooapi): add toplevel client and simplify API (#248)
* feat(ooapi): add toplevel client and simplify API

This diff should simplify using ooapi from other packages by
adding more abstraction that wraps the existing code.

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

* fix(ooapi): use correct comment for cloners

See https://github.com/ooni/probe-cli/pull/248#discussion_r590663843

* fix(ooapi): make sure the documentation is current

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665773

* fix(ooapi): automate copying APIs

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665837

* feat(ooapi): add unit tests for clientcall.go

See https://github.com/ooni/probe-cli/pull/248#discussion_r590666297

* fix(ooapi): rewrite integration tests to use toplevel API

See https://github.com/ooni/probe-cli/pull/248#discussion_r590665084
2021-03-19 09:30:42 +01:00
Simone Basso
c22828d369
chore: bless 3.9.0-alpha (#257) 2021-03-18 08:47:07 +01:00
Simone Basso
53e6b694cb
chore: bless 3.8.0 (#256) 2021-03-15 14:54:13 +01:00
Simone Basso
c324822870
fix(stunreachability): avoid goroutine spin and memleak (#255)
This fix addresses the bug described in issue https://github.com/ooni/probe/issues/1403.
2021-03-15 10:59:28 +01:00
Simone Basso
a02052fb0c
chore: rename stun_reachability => stunreachability (#254)
See https://github.com/ooni/probe/issues/1394

Ok @hellais @FedericoCeratto
2021-03-11 19:35:22 +01:00
Simone Basso
fbee736e90
fix(geolocate): no proxy when discovering our IP address (#251)
* fix(geolocate): no proxy when discovering our IP address

The use case of --proxy is that you cannot contact the OONI
backend otherwise. It is wrong, though, using the proxy when
discovering our IP address. The measurement won't use the
proxy anyway. Therefore, we need to use the IP address that
is performing the measurement. Not the one of the proxy.

What's more, stun is not using a proxy. Therefore, it does
not make much sense that http IP resolvers use a proxy. This
leads to inconsistencies. So, here's anothe reason why this
patch is a good thing (TM).

Finally, because knowing the IP address enables us to sanitize
the data, it's important we discover the correct IP.

Now, up until this point, the `--proxy` option has mostly
been a developers toy. But, users have asked us to have the
possibility of configuring a proxy.

This explains why I have been looking into making `--proxy`
right for a couple of hours now.

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

* fix(session): properly configure the IP lookupper
2021-03-10 12:01:08 +01:00
Simone Basso
f0110fe85a
fix(sessionresolver): honour the proxy (#250)
In reality, we are not going to use the sessionresolver when we're
using a proxy (I just tested). But, it nonetheless feels a lot more
robust to write a correct sessionresolver that handles the proxy
in the most correct way. That is, the sessionresolver will now skip
all the entries that cannot use a socks5 proxy (including among them
also the system resolver). What's more, it will construct a child
resolver that propagates the proxy.

We have confidence that this holds true because we have added a test
ensuring that we are really using the configured proxy.

See https://github.com/ooni/probe/issues/1381
2021-03-10 10:39:57 +01:00
Simone Basso
4da372a84d
feat(libminiooni): implement --version and --limit (#247)
See https://github.com/ooni/probe/issues/1380
2021-03-08 18:31:42 +01:00
Simone Basso
58788d3a83
chore: we're now at v3.8.0-alpha (#245) 2021-03-08 14:46:48 +01:00
Simone Basso
784d3d0f73
chore: release 3.7.0 (#244)
This comes just a few days after 3.6.0. It contains small
improvements required by ooni/probe-desktop.

For this reason, I am going to skeep the normal release
process and I am just bumping the version number.
2021-03-08 13:51:43 +01:00
Simone Basso
2ef5fb503a
fix(webconnectivity): allow measuring https://1.1.1.1 (#241)
* fix(webconnectivity): allow measuring https://1.1.1.1

There were two issues preventing us from doing so:

1. in netx, the address resolver was too later in the resolver
chain. Therefore, its result wasn't added to the events.

2. when building the DNSCache (in httpget.go), we didn't consider
the case where the input is an address. We need to treat this
case specially to make sure there is no DNSCache.

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

* fix: add unit tests for code making the dnscache

* fix(netx): make sure all tests pass

* chore: bump webconnectivity version
2021-03-08 12:05:43 +01: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
ae32ffa13b
chore: set version to 3.7.0-alpha (#240)
While there, make sure we don't always skip a currently failing
riseupvpn test, and slightly clarify the readme.
2021-03-04 11:36:41 +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
034db78f94
refactor(sessionresolver): adapt to changing network conditions (#238)
* feat(sessionresolver): try many and use what works

* fix(sessionresolver): make sure we can use quic

* fix: the config struct is unnecessary

* fix: make kvstore optional

* feat: write simple integration test

* feat: start adding tests

* feat: continue writing tests

* fix(sessionresolver): add more unit tests

* fix(sessionresolver): finish adding tests

* refactor(sessionresolver): changes after code review
2021-03-03 11:28:39 +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ò
f46fbcad16
Add new telegram DC endpoint (#232)
* Add new telegram DC endpoint

Based on: 65ba81f504/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp

* Update internal/engine/experiment/telegram/telegram.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-02-26 14:11:24 +01:00
Arturo Filastò
5e5cfa72e7
MVP of a signal messenger test (#230)
* MVP of a signal messenger test

* Add minimal signal test unit tests

* Add Signal test to the im nettest group

* Add test for https://sfu.voip.signal.org/

* Fix bug in client-side determination of blocking status

* Add uptime.signal.org to the test targets

* Add more tests

* Check for invalid CA being passed
* Check that the update function works as expected

* Update internal/engine/experiment/signal/signal_test.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>

* fix: back out URL we shouldn't have changed

When merging probe-engine into probe-cli, we changed too many URLs
and some of them should not have been changed.

I noticed this during the review of Signal and I choose to add
this commit to revert such changes.

While there, make sure the URL of the experiment is OK.

* fix(signal): reach 100% of coverage

Just so that we can focus on areas of the codebase where we need
more coverage, let us avoid missing an easy line to test.

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-02-26 10:16:34 +01:00
Arturo Filastò
fe7b5eda68 Bump to version 3.5.2 2021-02-12 19:56:46 +01:00
Simone Basso
311c30a961
chore(miniooni): print start time (#227)
This is useful when someone is running manual measurements and is
sharing their measurements with us, because it means we don't need
manually keep track of this bit of information.

Closes https://github.com/ooni/probe-engine/issues/1194
2021-02-12 08:17:16 +01:00
Simone Basso
3155549513
fix(http body saver): properly deal with EOF terminated bodies (#226)
See https://github.com/ooni/probe-engine/issues/1191
2021-02-11 14:57:14 +01:00
Simone Basso
c41114261c
Revert "fix(riseupvpn): skip currently failing tests (#212)" (#225)
This reverts commit 43f95e2c9a.

We can now safely close https://github.com/ooni/probe/issues/1338,
since the upstream issue is gone. I think this issue we have seen is
also possibly related to https://github.com/ooni/probe/issues/1348.

Cc: @cyberta.
2021-02-11 10:10:52 +01:00
Simone Basso
18ca6d5f35
fix: use golang.org/x/sys/execabs (#224)
Closes https://github.com/ooni/probe-engine/issues/1195
2021-02-10 07:40:48 +01:00
Simone Basso
f53b3be66e
feat: add end-to-end testing to this repository (#220)
* feat: add end-to-end testing to this repository

Part of https://github.com/ooni/probe-engine/issues/1181

Motivation: we want to run this check from the repository where
we work the most, such that it's unlikely it pauses due to inactivity,
as it may happen for less frequently touched upon repositories.

Code adapted from https://github.com/ooni/e2etesting/

* fix: correct name for main branch
2021-02-04 14:25:03 +01:00
Simone Basso
26d807c50f
fix: always use probe-cli version (and make it alpha) (#219)
See https://github.com/ooni/probe-engine/issues/1181

While there, run `go fmt ./...`
2021-02-04 11:00:27 +01:00
Simone Basso
cc5fcede44
doc: merge the engine and the cli readmes (#215)
Part of https://github.com/ooni/probe/issues/1335
2021-02-03 19:29:12 +01:00
Simone Basso
31cf7d2fdf
doc: ensure all top dirs have an explanatory README (#214)
* doc: ensure all top dirs have an explanatory README

This makes the repository a lil bit nicer to newcomers.

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

* fix: re-run bindata to embed the README

The readme is small, so we can pay the price of adding it.

On a related note, I am very pleased the Go team implemented the
`//go:embed` feature, so we can get rid of this bindata thing.
2021-02-03 16:54:00 +01:00
Simone Basso
43f95e2c9a
fix(riseupvpn): skip currently failing tests (#212)
Part of https://github.com/ooni/probe/issues/1335.

Tracked also by https://github.com/ooni/probe/issues/1338.
2021-02-03 16:06:03 +01:00
Simone Basso
ef8fa97e13
chore: continue merging probe-engine into probe-cli (#211)
* chore: remove duplicate code of conduct

* chore: remove AUTHORS file

I doubt this actually has any value in the era of GitHub.

* chore: move CODEOWNERS to toplevel

* chore: move CONTRIBUTING.md to toplevel and adapt it

* chore: remove duplicated LICENSE file

* chore(engine): remove now-obsolete design document

* chore: remove the testusing test

We're not going to make this code importable from third parties
like we did for probe-engine. It seems this feature was only used
for the experiment in Spain so it makes sense to drop it.

* chore: enable code generation tests

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

* chore: enable code-ql checks

* cleanup: remove libooniffi code and tests

It seems this code is not used. We are not aware of anyone using it. And we
don't want to expose it publicly as an API. So, what to do?

I guess it's fine to delete it. If there is anyone that needs it, we have
in the history a reference to it and we can always reinstate it.

* chore: move issue templates to ooni/probe
2021-02-03 14:42:51 +01:00
Simone Basso
c824612812
refactor: enable automatic iOS builds (#209)
* refactor: enable automatic iOS builds

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

* fix: go mod tidy
2021-02-03 13:51:15 +01:00
Simone Basso
0c48bc0746
refactor: enable QA tests and jafar self test (#208)
* refactor: enable QA tests and jafar self test

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

* chore: make sure all workflows run on release branches
2021-02-03 13:20:37 +01:00
Simone Basso
4eeadd06a5
refactor: move more commands to internal/cmd (#207)
* refactor: move more commands to internal/cmd

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

We would like all commands to be at the same level of engine
rather than inside engine (now that we can do it).

* fix: update .gitignore

* refactor: also move jafar outside engine

* We should be good now?
2021-02-03 12:23:15 +01:00
Simone Basso
6351d898d6
refactor: miniooni should be outside of the engine (#206)
* refactor: miniooni should be outside of the engine

This is part of https://github.com/ooni/probe/issues/1335. We also need
to think whether we wanna keep libminiooni and miniooni separated.

The previous use case for having a top-level libminiooni was that of
enabling others to integrate miniooni into other binaries.

This was usegul when studying internet censorship in Spain in May 2020.

I am wondering whether we should be keeping this complexity. I am not
sure about this and probably we should be killing it.

(In any case, reducing complexity is not the objective of this diff,
since I would like instead to move things around with minimal changes
and make sure we have a ~good repository organization here.)

* fix: import in libminiooni
2021-02-03 11:21:10 +01:00
Simone Basso
99b28c1d95
refactor: start building an Android package (#205)
* refactor: start building an Android package

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

This seems also a good moment to move some packages out of the
engine, e.g., oonimkall. This package, for example, is a consumer
of the engine, so it makes sense it's not _inside_ it.

* fix: committed some stuff I didn't need to commit

* fix: oonimkall needs to be public to build

The side effect is that we will probably need to bump the major
version number every time we change one of these APIs.

(We can also of course choose to violate the basic guidelines of Go
software, but I believe this is bad form.)

I have no problem in bumping the major quite frequently and in
any case this monorepo solution is convinving me more than continuing
to keep a split between engine and cli. The need to embed assets to
make the probe more reliable trumps the negative effects of having to
~frequently bump major because we expose a public API.

* fix: let's not forget about libooniffi

Honestly, I don't know what to do with this library. I added it
to provide a drop in replacement for MK but I have no idea whether
it's used and useful. I would not feel comfortable exposing it,
unlike oonimkall, since we're not using it.

It may be that the right thing to do here is just to delete the
package and reduce the amount of code we're maintaining?

* woops, we're still missing the publish android script

* fix(publish-android.bash): add proper API key

* ouch fix another place where the name changed
2021-02-03 10:51:14 +01:00
Simone Basso
6714b79f97
refactor: integrate more probe-engine workflows (#204)
This diff is part of https://github.com/ooni/probe/issues/1335.

We are moving more probe-engine workflows to toplevel.

The general idea here is to migrate all possible workflows and to
delete the ones that we cannot use in this repo (if any).
2021-02-02 15:57:37 +01:00
Simone Basso
90d15c1c09
refactor: build miniooni from toplevel (#203)
* refactor: build miniooni from toplevel

Of course, also move the specific test checking whether we are
still able of building miniooni.

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

* build for current branch just to confirm

* fix: correct the path where linux/arm binary is

* okay, it works, we can remove the special rule
2021-02-02 15:34:03 +01:00
Simone Basso
47dd063b77
fix: add missing files causing tests to fail (#202)
* fix: add missing files causing tests to fail

See https://github.com/ooni/probe/issues/1335#issuecomment-771559718

* fix: toggle verbose so we better understand the tests output
2021-02-02 14:18:22 +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
Arturo Filastò
b84fe2c7e3
Merge pull request #197 from ooni/fix-list-ui
Fixup the rightpad on the list command
2021-01-22 13:48:54 +01:00
Arturo Filastò
06699445a7 Fixup the rightpad on the list command 2021-01-22 12:46:57 +01:00
Simone Basso
f2af3db193
fix(show): make sure we quote URL/query (#196) 2021-01-22 12:14:19 +01:00
Simone Basso
9577d7e11e
chore: 3.5.0-alpha for the master branch 2021-01-20 14:06:12 +01:00
Simone Basso
795f3be44e
chore: release 3.4.0 (#195)
This release only contains updates in debian packaging. All other platforms
could safely continue to use 3.2.0 or 3.3.0.

I didn't want to make a path release, though, because I didn't want to convey
the meaning that something was fixed.

Related to https://github.com/ooni/ooni.org/issues/677
2021-01-20 13:31:54 +01:00
Simone Basso
dc6b492986
chore: v3.4.0-alpha for the main branch 2021-01-19 20:36:38 +01:00
Simone Basso
4853ddf810
chore: bless v3.3.0 (#194) 2021-01-19 20:25:00 +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
6fbad8555f
chore: set version to 3.3.0-alpha 2021-01-13 00:47:12 +01:00
Simone Basso
40d5f86698
chore: bless 3.2.0 (#191) 2021-01-13 00:40:48 +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
Arturo Filastò
af4cbd1846
Implement support for not writing to disk and fetching measurements f… (#189)
* Implement support for not writing to disk and fetching measurements from the API

* Handle case of input not being set

* Comment about exposing raw_measurement in probe-engine

* Add basic test for GetMeasurementJSON

* Update internal/database/actions.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-01-11 19:59:20 +01:00
Arturo Filastò
5cfce6acd0 Implement informed consent migration using the config file 2021-01-08 14:14:14 +01:00
Simone Basso
1a4b70c9aa chore: we're now at 3.2.0-alpha 2020-12-08 15:59:48 +01:00
Simone Basso
c9ea92fc53
chore: bless 3.1.0 (#186) 2020-12-07 19:42:13 +01:00
cyBerta
9192ead36d
cli: expose riseupvpn (#171) 2020-12-07 17:14:48 +01:00
Simone Basso
d402cd9090
feat: implement the unattended group (#183)
We don't want to run performance in the background because this
causes too much traffic towards m-lab servers.

When we'll have the check-in API, this will be the entry point we'll
use to contact such an API and get things to do.

Part of https://github.com/ooni/probe/issues/1289.
2020-12-01 16:52:12 +01:00
Simone Basso
60d08eef3b
refactor: move code to run group in nettests package (#182)
Part of https://github.com/ooni/probe/issues/1289
2020-12-01 15:04:04 +01:00
Simone Basso
2381c50dc5
feat: implement syslog logging (#181)
* feat: implement syslog logging

With this functionality in tree, macOS users could easily access
ooniprobe logs by filtering by process name in the console app.

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

* fix: build on windows

* fix: all build issues
2020-12-01 13:31:15 +01:00
Simone Basso
cfd3b8f9b2
feat(cli/run): read inputs from file/cmdline (#180)
This diff introduces the possibility of specifying --input-file file
multiple times to force ooniprobe to read inputs from file.

Like we do for miniooni, the file shall contain a single entry per
line and this entry should be a URL for websites.

Likewise, one can specify --input URL multiple times.

This implementation is a very simple, initial implementation and there
is a bunch of changes I'd like to add on top of it.

And also perhaps a bunch of cleanups.

I've chosen to expose these flag _only_ for websites for now.

Part of https://github.com/ooni/probe/issues/1283.
2020-12-01 07:21:33 +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
2fc160b202
cleanup(nettests): remove unused OnDataUsage (#178)
Part of https://github.com/ooni/probe/issues/1283
2020-11-26 19:12:27 +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
e4ef279b80
fix(onboard): fail if input is /dev/null (#176)
When the input is /dev/null, every read returns EOF. In general, it
may also happen that read doesn't work as intended. So, the robust thing
to do here is to ensure that we check the return values. By doing that
we notice of io.EOF errors and we don't proceed with the onboarding.

This diff fixes the issue described by https://github.com/ooni/probe/issues/1281
however it may be that we also want (in the near or not-so-near future)
to stop onboarding if the input terminal is not a tty. This is however a
possible future evolution that should not prevent us for committing and
merging this simple fix that unblocks creating a Debian package.
2020-11-24 09:19:34 +01:00
Simone Basso
7eedf4d947 feat(geoip, info): write comprehensive unit tests 2020-11-20 12:19:51 +01:00
Simone Basso
fa803300bb refactor(ooni): introduce interfaces for testability 2020-11-20 12:19:51 +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
9e238c27dd
refactor(internal/ooni): Context => Probe (#170)
Closes https://github.com/ooni/probe/issues/939
2020-11-13 19:01:06 +01:00
Simone Basso
163922e001
refactor: run go fmt ./... (#169) 2020-11-13 18:42:10 +01:00
Simone Basso
c81393b31a
refactor: move ooni into the internal package (#168)
With this commit we've reorganised the package structure. Now I will
go more in depth and perform further refactoring.
2020-11-13 17:47:29 +01:00
Simone Basso
bc85efa6e5
refactor: version is now an internal package (#167)
Like for previous commits, just refactoring/yak shaving.
2020-11-13 17:37:06 +01:00
Simone Basso
a4ae94b5ec
refactor: now utils is an internal package (#166)
Let us make internal everything because this is not a library.
2020-11-13 17:28:02 +01:00
Simone Basso
a58dff3050
refactor: nettests is now an internal package (#165)
I'm moving everything into internal packages since this ain't a library.

While there, remove typo that was causing a build breakage.
2020-11-13 17:14:26 +01:00
Simone Basso
fb2ca32004
refactor: config is now a private package (#164)
We are working on ooniprobe for Debian. Before starting to apply
changes to the codebase, I'd like to apply some refactoring steps
that I've been thinking about for quite some time.

The general concept here is that the purpose of this repository
changed since it was designed and now there is probe-engine which
is a library, therefore, this repo can be mostly private.
2020-11-13 16:58:14 +01:00
Sarath
73d6b550e5
Replace ooni with ooniprobe in example usage (#163) 2020-11-13 16:57:01 +01:00
Arturo Filastò
c0a95c037f
Add support for deleting all measurements (#158)
Co-authored-by: Simone Basso <bassosimone@gmail.com>
2020-11-13 07:43:00 +01: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
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
Arturo Filastò
f2e62b7ad7 Always include the country code and drop include_probe_cc setting
Fixes: https://github.com/ooni/probe/issues/1183
2020-06-02 19:16:09 +02:00
Arturo Filastò
35016a183e Interrupt the nettestGroup loop early on termination
Fixes ooni/probe#1013
2020-02-20 12:24:24 +01:00
Simone Basso
040bee0ee6
Optionally treat EOF on stdin just like SIGTERM (#111)
* Optionally treat EOF on stdin just like SIGTERM

On Unix, Node.js allows us to gracefully kill a process. On Windows
this is more compex. You certainly cannot rely on the default `kill()`
function, which calls `TerminateProcess`.

There is a bunch of C/C++ extensions that in principle allow you to
attempt to gracefully shutdown a Windows process.

But, hey, here's a reality check. Node.js controls our stdin. Node.js
does IPC easy. Controlling uv_spawn flags and using the right not well maintained
C/C++ Node.js extension to kill a process is fragile.

So, treat EOF and any other error on stdin as equivalent to SIGTERM.

However, systemd.

The sane thing to do with systemd is `StandardInput=null`. With such
configuration, stdin immediately returns EOF.

Then, introduce the `OONI_STDIN_EOF_IMPLIES_SIGTERM` environment
variable. When it is `true`, this behaviour is enabled, e.g.:

```bash
export OONI_STDIN_EOF_IMPLIES_SIGTERM=true  # behaviour enabled
ooniprobe run
```

I want the default to be disabled because:

1. in the future we may find a better way to solve this problem and I
don't want the _default behaviour_ to change in such case

2. we know we need this knob for ooniprobe-desktop, and we will not
fail to provide it, so it won't suprise/damage us

3. a person trying to write a systemd unit for ooniprobe would be very
surprised to find out they need to disable this behaviour, if it was
enabled by default by this PR

Hence, I believe this design is consistent with designing for the
future and for trying to minimize surprises.

Also, why an environment variable and not a command line flag? Because:

1. we don't want such hypothetical flag to be available where it does not
make sense, e.g., for all subcommands but `run`

2. we don't want the ooni/probe-desktop app to write conditional
code because it needs to check the command we're using and then decide
whether to add such hypothetical flag

Also, why not enabling this only on Windows? Because again we don't
want the ooni/probe-desktop app to write conditional code.

To summarize: we want ooni/probe-desktop app to see the same behaviour
everywhere and we want others to be the least surprised.

Related to https://github.com/ooni/probe/issues/1005

* Update ooni.go
2020-02-13 14:53:06 +01:00
Arturo Filastò
20fb419126 Explicitly handle SIGINT 2020-02-07 15:33:37 +01:00
Arturo Filastò
cf21fd1fd8 Improve error handling 2020-02-05 18:28:10 +01:00
Arturo Filastò
b22f224ad3 Fix bug in measurement_file_path collision
We were writing to the same measurement_file_path for a given test
group, because we were using a different filename only in the case of a
many input test, but not in the case of many test_names inside of a
given test group.
2020-02-05 18:26:26 +01:00
Arturo Filastò
52332c0977 Changes based on feedback from @bassosimone 2020-01-29 18:48:12 +01:00
Arturo Filastò
4711a76c11 Handle the case when we try to access an old measurement 2020-01-29 10:43:08 +01:00
Arturo Filastò
e38d42d33a Update the actions tests 2020-01-28 12:08:09 +01:00
Arturo Filastò
e3d68457b3 Implement writing using the new single measurement pattern 2020-01-28 11:53:00 +01:00
Arturo Filastò
af46a495f4 Update bindata 2020-01-28 11:52:37 +01:00
Arturo Filastò
27d98a8660 Small cosmetic fix 2020-01-28 11:05:09 +01:00
Arturo Filastò
8dff1cc54a Use ~/.ooniprobe as the home directory (#101)
* Use ~/.ooniprobe as the home directory

Remove all probe-legacy related to code since there is no more conflict
between the two
Fixes: ooni/probe#972

* Update .gitignore

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2020-01-27 15:19:32 +01:00
Arturo Filastò
24316728b9 Improve the output and extraction of psiphon metrics 2020-01-07 16:13:13 +02:00
Simone Basso
1e8b482c23
Allow to specify custom software name and version (#94)
In turn, this allows us to identify as ooniprobe-cli v3.0.0-rc.5.

Closes #41.
2019-12-29 14:07:57 +01:00
Simone Basso
955509e6f8 nettests: don't say ETA is infinite
1. only print time left if ETA is positive

2. skip ETA calculation with a single input

3. don't compute ETA for first entry[*]

[*] this is actually what avoids emitting infinite but the other
parts of this diff felt useful yak shaving as well.

Closes #91
2019-12-28 18:28:08 +01:00
Simone Basso
259ab41b15 Implement the circumvention nettest group
Only Psiphon for now. Closes #87 #77.
2019-12-28 17:48:07 +01:00
Arturo Filastò
7bbbab8774 Handle the SIGINT and SIGTERM signals to support stopping a test cleanly (#84) 2019-12-27 11:32:08 +01:00
Arturo Filastò
274e533b2e Fix import for groups 2019-12-02 18:05:02 +02:00
Arturo Filastò
58199a020e Refactoring to reduce package count
* Consolidate util and utils into the same package
* Move internal/onboard into internal/cli/onboard
* Move maybeOnboard into the onboard package
2019-12-02 15:15:50 +02:00
Arturo Filastò
bc1314ca61
Add support for calculating the estimate time remaining (#71) 2019-11-14 12:01:40 +01:00
Simone Basso
946289d6fe
Use more general ooni/probe-engine API (#67)
No functional change, just importing less stuff and meddling
much less with the internals of ooni/probe-engine.
2019-10-28 14:05:05 +01:00
Simone Basso
7cde93fca4
Make sure ooniprobe show <id> is WAI (#61)
1. the description of the command and the helper function are
clear hints that the command is intended to show a single JSON
measurement at a time (also the use case seems clear) [*]

2. the function used to read lines was failing for all my
measurements that take input. Since that was not the optimal
pattern anyway, use a better pattern to fix it.

3. some changes are automatically applied by my editor (VSCode
with the Go plugin) and I am fine with them.

4. while reading code, I also applied my preferred pattern
wrt whitespaces, i.e.: no whitespace inside functions, if a
function feels too long in this way, just break it.

Closes #57

[*] Even if we want to show many measurements at a time, which
does not seem needed, given the UI patterns, this functionality
won't be P0. What is P0 is to bless a new beta and give to
@sarathms binaries for all archs that support a basic `show`.
2019-10-03 11:18:07 +02:00
Simone Basso
f3865d2ec0
Upgrade to ooni/probe-engine@v0.1.1 (#60) 2019-10-03 09:43:25 +02:00
Arturo Filastò
f425d3f007 Implement the show command (#53) 2019-10-02 18:23:14 +02:00
Simone Basso
b9b555ba68 Integrate further with ooni/probe-engine: episode two (#46)
* utils/geoip.go: use github.com/ooni/probe-engine

Let's start using the engine by rewriting utils/geoip.go to
be just a thin wrapper around the engine functionality.

* Ready for review

* Checkpoint: the im tests are converted

Still have some doubts with respect to the variables that
are passed to MK via probe-engine. Will double check.

* fix(i/c/r/run.go): write the correct logic

* nettests: one more comment and also fix a format string

* Tweak previous

* progress

* Fix doofus

* better comment

* XXX => actionable comment

* Add glue to simplify test keys management

Making the concept of measurement more abstract in the engine is
not feasible because, when submitting a measurement, we need to
modify it to update the report ID and the measurement ID. Therefore,
returning a serialized measurement is not a good idea. We will
keep using a model.Measurement in the engine.

Changing model.Measurement.TestKeys's type from a `interface{}`
pointing to a well defined data structure to `map[string]interface{}`
is a regression because means that we are moving from code that
has a clear and defined structure to code that is more complicated
to parse and validate. Since we're already suffering havily from
the lack of a good schema, I'm not going to make the situation
worst by worsening the engine. At least for ndt7 and psiphon, we
now have a good schema and I don't want to lose that.

However, the current code in this repository is expecting the
test keys to be a `map[string]interface{}`. This choice was
dictated by the fact that we receive a JSON from Measurement Kit
and by the fact that there's not a clear schema.

To solve this tension, in this commit I am going to write glue
adapter code that makes sure that the TestKeys of a Measurement
are converted to `map[string]interface{}`. This will be done
using a type cast where possible and JSON serialization and parsing
otherwise. In a perfect world, glue is not a good idea, but in a
real world it may actually be useful.

When all tests in the engine will have a clear Go data structure,
we'll then remove the glue and just cast to the proper data
structure from `interface{}` where required.

* nettests/performance: use probe-engine

* go.{mod,sum}: upgrade to latest probe-engine

* nettests/middlebox: use ooni/probe-engine

* Update to the latest probe-engine

* web_connectivity: rewrite to use probe-engine

* Cosmetic change suggested by @hellais

* nettests/nettests.go: remove unused code

* nettests/nettests.go: fix progress

* nettests/nettests.go: remove go-measurement-kit code

* We don't depend on go-measurement-kit anymore

* Improve non-verbose output where possible

See also: https://github.com/measurement-kit/measurement-kit/issues/1856

* Make web_connectivity output pleasant

* Update to the latest probe-engine

* nettests/nettests.go: honour sharing settings

* Update to the latest probe-engine

* Use log.WithFields for probe-engine

* Update go.mod go.sum

* Revert "Update go.mod go.sum"

This reverts commit 5ecd38d8236f4a4e9b77ddb8e8a0d1e3cdd4b818.

* Revert "Revert "Update go.mod go.sum""

This reverts commit 6114b31eca98826112032776bd0feff02d763ecd.

* Upgrade ooni/probe-engine

* Unset GOPATH before running go build commands

* Dockefile: fix linux build by using latest

* Update to the latest ooni/probe-engine

```
go get -u github.com/ooni/probe-engine
go mod tidy
```

* Repair build
2019-08-15 18:08:43 +02:00
Simone Basso
df629237be
Use ooni/probe-engine: episode 1 (#42) 2019-05-23 16:38:46 +02:00
Arturo Filastò
9ad7c6507a Remove shutil tests 2019-05-15 18:13:34 +02:00
Arturo Filastò
826822df31 Copy and delete instead of rename
Fixes: https://github.com/ooni/probe-cli/issues/21
2019-05-15 18:06:09 +02:00
Arturo Filastò
dbed661357 Vendor shutil from: bcacb06fec 2019-05-15 18:05:51 +02:00
Simone Basso
9992690f8f Use MK v0.10.x, zap legacy GeoIP, build also on Linux (#29)
* Gopkg.lock: use MK v0.10.3

* ooni: stop using legacy GeoIP database files

* Some yak shaving of Makefile

1. remove now broken commands to download deps

2. also define the CXX cross compiler

* chore(dep): migrate from dep to go 1.11+ modules

See https://blog.callr.tech/migrating-from-dep-to-go-1.11-modules/

I need this to simplify my life in building for Travis.

* Introduce build.sh and repair build

In going forward, I believe we don't actually need a Makefile but I
didn't want to make such a radical change now.

* Another strategy wrt gopath

* travis: run regress tests on macOS

Closes #30
2019-05-15 15:48:06 +03:00
Arturo Filastò
34556dcbf1 Add support for running all tests with ooni run 2018-09-27 18:38:37 +02:00
Arturo Filastò
8916ff8398 Add note about the testKeys extraction function 2018-09-27 11:42:55 +02:00
Arturo Filastò
6735c8d617 Strip the trailing slash from the bouncer url 2018-09-26 15:35:17 +02:00
Arturo Filastò
2b01dfaa17 Close the DB before deleting ooni_home 2018-09-26 15:09:59 +02:00
Arturo Filastò
a60f376846 Adjust the progress bars depending on the test type 2018-09-24 15:57:28 +02:00
Arturo Filastò
4fc745172d Update bindata 2018-09-21 18:54:56 +02:00
Arturo Filastò
0d21186492 Add support for custom collectors and bouncers 2018-09-21 18:54:44 +02:00
Arturo Filastò
8402446e47 Use Stdout in CLI logging 2018-09-18 09:55:23 +02:00
Arturo Filastò
47a2fbb88c Add rm command to delete results 2018-09-18 09:54:27 +02:00
Arturo Filastò
e6a67ca5aa Improve output of CLI 2018-09-18 09:36:26 +02:00
Arturo Filastò
aad8a395ed Fix return value of database.Connect method 2018-09-17 17:57:26 +02:00
Arturo Filastò
41f449d6c9 Remove debug log from unittests 2018-09-17 17:35:57 +02:00
Arturo Filastò
18a89f4cbd [schema-change] Prefix all columns that could cause conflicts 2018-09-17 17:30:38 +02:00
Arturo Filastò
52bfe5df6c Add support for deleting measurements 2018-09-17 17:30:29 +02:00
Arturo Filastò
30c6041423 Remove unused nettest command 2018-09-17 16:33:56 +02:00
Arturo Filastò
d55cccc236 Exit with non-zero code when trying to do interactive onboarding and --batch is set 2018-09-17 16:16:56 +02:00
Arturo Filastò
6c49bd694f Improve output of incomplete measurements
Rename done to is_done
2018-09-17 13:04:48 +02:00
Arturo Filastò
5cae6b0b83 Make it possible to disable uploading of results 2018-09-17 11:51:54 +02:00
Arturo Filastò
867204adfb Improve the testKeys logging 2018-09-13 15:59:29 +02:00
Arturo Filastò
4ed94dfc53 Improve the presentation of the measurement listing from the CLI 2018-09-13 14:54:56 +02:00
Arturo Filastò
251f136b53 Move include_country to the sharing options 2018-09-13 11:02:49 +02:00
Arturo Filastò
7f5df07782 Fix a very annoying logic bug in URL insertion
Write test case for it
2018-09-12 18:47:57 +02:00
Arturo Filastò
b1ae8bc13e Show data usage in summary of measurements 2018-09-12 15:41:54 +02:00
Arturo Filastò
2b1fb662fb Fix showing data usage indicators 2018-09-12 14:03:07 +02:00
Arturo Filastò
54af7170d4 Add support for data_usage event 2018-09-12 13:42:16 +02:00
Arturo Filastò
2081c25b73 Expose the median_bitrate in the list view 2018-09-11 18:41:15 +02:00
Arturo Filastò
044748c2ce Fix exposing the country code 2018-09-11 18:16:14 +02:00
Arturo Filastò
0ee0c28129 Resolve country code ambigious selection 2018-09-11 18:06:15 +02:00
Arturo Filastò
d02ed117f9 Include total_runtime in the summary of measurements 2018-09-11 16:36:09 +02:00
Arturo Filastò
8da12a9c07 Add measurement summary to list command 2018-09-11 15:40:42 +02:00
Arturo Filastò
31ccb1c181 Improvements to the list output 2018-09-11 15:19:08 +02:00
Arturo Filastò
1637fdbf93 Structured output of measurements 2018-09-10 18:03:32 +02:00
Arturo Filastò
e5c508a94c Fix bug in result listing 2018-09-10 16:56:32 +02:00
Arturo Filastò
e0c0acffeb Make error reporting more robust to panic 2018-09-10 16:29:14 +02:00
Arturo Filastò
5055eaa88a Add info and reset commands 2018-09-10 15:15:29 +02:00
Arturo Filastò
898332064b Add result testkeys projection 2018-09-10 15:03:52 +02:00
Arturo Filastò
73fafacc2c Zap unused method 2018-09-10 12:53:43 +02:00
Arturo Filastò
b29071f37b Replace summary with test_keys 2018-09-10 12:41:28 +02:00
Arturo Filastò
b727aba854 Update result listing 2018-09-07 15:39:22 +02:00
Arturo Filastò
ca505dfff3 Write a unittest for the URL creation function 2018-09-07 15:29:16 +02:00
Arturo Filastò
6f0defc672 Refactor URL table row creation into the actions file 2018-09-07 15:23:29 +02:00
Arturo Filastò
c2ea0c2a63 Fix List* workflows and add unittests for them 2018-09-07 15:16:20 +02:00
Arturo Filastò
dabbdc15d2 Fix bug in the test creation workflow 2018-09-07 14:06:08 +02:00
Arturo Filastò
ecc8216ceb Update bindata 2018-09-07 12:56:06 +02:00
Arturo Filastò
35bd334cfc Update the measurement, network and url creation to the new schema 2018-09-07 12:55:27 +02:00
Arturo Filastò
5ed67ee422 Update bindata 2018-09-06 16:17:00 +02:00
Arturo Filastò
b75cee5e84 Progress on schema and fixing unittests 2018-09-06 16:13:04 +02:00
Arturo Filastò
a518ca79da Fix DB schema, write a basic unittest for the DB operations 2018-09-06 15:34:56 +02:00
Arturo Filastò
ff2f973523 Start integrating upper/db as a new ORM 2018-09-05 18:40:37 +02:00
Arturo Filastò
ec459a7f15 Update bindata 2018-09-05 17:58:27 +02:00
Arturo Filastò
247d128b19 Add _is_beta flag to config file 2018-07-30 18:51:44 +02:00
Arturo Filastò
8fb5e397d7 Cleanup the output of the progress handler 2018-07-16 13:15:01 +02:00
Arturo Filastò
69ec294ad4 Go for a much more minimal progress update 2018-07-14 17:19:06 +02:00
Arturo Filastò
45aea93e6b Fix default config and version 2018-07-14 16:58:08 +02:00
Arturo Filastò
83ed5fa767 Fix bug in version info 2018-07-11 18:06:13 +02:00
Arturo Filastò
d8cbfd1b90 One color package to rule them all. 2018-06-29 16:50:05 +02:00
Arturo Filastò
c4c13cb279 Properly compute the padding by fixing the ansi escape regexp 2018-06-29 16:38:13 +02:00
Arturo Filastò
d88764aa34 Add support for crash reporting via sentry and change the send_crash_reports key 2018-06-29 15:29:05 +02:00
Arturo Filastò
cf588c8466 Move summary related code into it's own package 2018-06-28 13:51:43 +02:00
Arturo Filastò
d23f30d159 Update bindata 2018-06-27 15:45:27 +02:00
Arturo Filastò
a6b95f50c9 Move onboard into a separate package 2018-06-25 17:14:29 +02:00
Arturo Filastò
aae2805786 Write the config file when onboarding is run 2018-06-25 17:09:10 +02:00
Arturo Filastò
7951ee6bb5 Add onboard command 2018-06-25 16:31:44 +02:00
Arturo Filastò
38a5637cf5 Write to output when a function is not implemented 2018-06-25 13:19:54 +02:00
Arturo Filastò
030ecacf80 Improve the help output of run 2018-06-22 14:55:00 +02:00
Arturo Filastò
65b5feef0d Make the geoip lookup output prettier 2018-06-22 14:25:30 +02:00
Arturo Filastò
5b31403061 Implement progressbar for web_connectivity test 2018-06-22 13:56:42 +02:00
Arturo Filastò
eb4e6988b3 Implement quick and dirty measurement listing 2018-06-22 12:12:35 +02:00
Arturo Filastò
04eb07624c Add zero state 2018-06-22 11:57:25 +02:00
Arturo Filastò
6ff00eeed1 Rename result_item to results 2018-06-22 11:53:30 +02:00
Arturo Filastò
703b260903 Implement missing bits in result listing 2018-06-22 11:53:10 +02:00
Arturo Filastò
15c901ed68 Make the download of geoip data files conditional 2018-06-22 11:17:51 +02:00
Arturo Filastò
1bba0c7899 Add basic unittests for the config related functionality 2018-06-22 11:01:15 +02:00
Arturo Filastò
a0be45e323 Fix paths to be windows friendly 2018-05-31 12:33:08 +02:00