Commit Graph

631 Commits

Author SHA1 Message Date
Simone Basso
80ef3e4b1b
fix(make): compose runner and dry runner directly (#324)
The previous composition strategy was such that it was difficult
to compose functions returning a value.

This new composition strategy is better because it allows us to
return values, which is definitely going to help us.

Part of https://github.com/ooni/probe/issues/1466.
2021-05-05 10:30:27 +02:00
Simone Basso
a9b3a3b3a5
fix(tunnel): pass /absolute/path/to/tor to cretz/bine (#323)
* fix(tunnel): pass /absolute/path/to/tor to cretz/bine

It seems cretz/bine is not aware of https://blog.golang.org/path-security
for now. I am planning to send over a diff for that later today.

In the meanwhile, do the right thing here, and make sure that we obtain
the absolute path to the tor binary before we continue.

This work is part of https://github.com/ooni/probe-engine/issues/283.

* fix tests when tor is not installed
2021-05-04 08:14:25 +02:00
Federico Ceratto
2539a17ff9
Switch .deb package publishing to S3 (#314)
This PR switches the` .deb` package publishing to s3 because Bintray has been shut down.
2021-05-03 16:50:27 +02:00
Arturo Filastò
ac7d7dc8a3
Add support for tracking the is_uploaded status in the results table (#312)
* Add support for tracking the is_uploaded status in the results table

* Add unit tests for measurement upload status

This implements: https://github.com/ooni/probe/issues/1457

* Update cmd/ooniprobe/internal/database/actions.go

Co-authored-by: Simone Basso <bassosimone@gmail.com>
2021-04-30 17:08:16 +02:00
Simone Basso
764293795e
feat(make): build miniooni (#322)
This change is useful to move forward with blessing a new
release (https://github.com/ooni/probe/issues/1439).
2021-04-29 19:24:25 +02:00
Simone Basso
9d5a3321af
chore: link new TODOs with the relevant issues (#321)
Part of https://github.com/ooni/probe/issues/985
2021-04-29 18:43:31 +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
de60fb0588
Release v3.10.0-beta.1 (#319)
* fix(make): correctly write oonimkall.podspec

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

* chore: set version number to v3.10.0-beta.1

* fix(ios): don't build a target that requires git
2021-04-29 11:55:30 +02:00
Simone Basso
958c3fec58
Merge pull request #318 from ooni/issue/1440c
cleanup: remove mobile-staging and legacy build scripts
2021-04-29 10:46:43 +02:00
Simone Basso
4f52794ab9 cleanup: remove all references to mobile-staging
Part of https://github.com/ooni/probe/issues/1440
2021-04-29 10:35:44 +02:00
Simone Basso
70499edabe Merge remote-tracking branch 'origin/mobile-staging' into issue/1440c
This commit merges the mobile-staging branch into the main history so that
we are not losing track of what it happened during its lifetime.

We're going to not need this branch anymore, because we're now going to
build releases on a special purpose build machine.

At the same time, we don't want to loose track of the history of such a
branch because it tells a story of how we build for mobile.

This work is part of https://github.com/ooni/probe/issues/1440.
2021-04-29 10:33:08 +02:00
Simone Basso
62fd07374f cleanup: remove legacy scripts and update readme
Part of https://github.com/ooni/probe/issues/1440
2021-04-29 10:32:25 +02:00
Simone Basso
77973301ac
feat(make): implement iOS build (#316)
Part of https://github.com/ooni/probe/issues/1440.

Basically, let us continue to update our build infrastructure so that we can release v3.10.0-beta.

Now, it's the turn of iOS.
2021-04-29 10:30:39 +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
514ad8d0f5
./make: script to create android builds (#315)
This PR introduces the `./make` script. For now, this script knows how to make Android releases. We have code in https://github.com/ooni/probe-cli/pull/311 that builds other artifacts in this repository.

Because our current concern is https://github.com/ooni/probe/issues/1444, in this PR, I have chosen to keep the Android code necessary to fix https://github.com/ooni/probe/issues/1444.

Additionally, this PR removes the script to publish to Bintray. This change part of the https://github.com/ooni/probe/issues/1440 cleanup effort.
2021-04-27 16:36:57 +02:00
Simone Basso
11087db51a
chore: we're now at 3.10.0-alpha.1 (#310)
Part of https://github.com/ooni/probe/issues/1440
2021-04-20 09:20:04 +02:00
Simone Basso
85755e35f5
feat(ios): adapt build to post bintray world (#309)
Part of https://github.com/ooni/probe/issues/1437
2021-04-08 17:00:51 +02:00
Simone Basso
f5d0a1fa1a
Merge pull request #308 from ooni/stable
Merge v3.9.2 back into master
2021-04-08 00:17:44 +02:00
Simone Basso
2fd277af22 ooni/probe-cli v3.9.2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEc4h3qmyCnyakMcX0gLaRJ3cz2VsFAmBuKF8ACgkQgLaRJ3cz
 2VuQ2w/+OCLSkAddq5IJ8mMieqY1/oDm3KlsVifXN4yrWNT9MGip0Fh5hns6tRir
 tGFOJ2FuG/3czAk60pkJW3n1m2pUU0pR6/55VtwBVyLrbYhtCWb0R9N2g46Ru2UN
 YN3Cl19XCmBdUByj30zFW1eyfdpO1eZzn+BOpU8oRL+xm2jm4iCGebxM/i2/rxRn
 Lq20Wj2ubJQYbi43i0Gos9gtaNM1JAZQHYrXUxD2B8B/raq2+toggV+NNkJzu8VM
 uh0126nUdEzR1mMs9nUav+wvyFrjpaHZ8EHzsCk91KtICVFFyCjZGkkNCOqG4dJb
 cz3DU4vI41CcWLVgs+urPQ66RstKKOev0VXDhUF4w9aKs88Ya40NJj4qeoJRZNnR
 nZY/aFRRl3dqwbCX7LpRLl8HSSb02e5hkiv2wtiEpvk6z1K/N7F3C0CxCTc5Wxwv
 +vTDM4zLi9WCT5kxkRJ/1lbYNUV/9jqsSOmsQOMf+dqmyA0bxSk/zXMxagLwMe5D
 hClM5/r+pFirc+/tKcECRyyw60YL19VzIY1hlq2YlFO3b/9zsZe0ssaRE1qQL0w8
 EjAe4nTiXIw28Js6R5lbnwK/LbyZIleRK3xYgDRA0RNDVvGMk+cxxUqJfP/ECdnD
 sSOFdJAVU5gEOU9smPa9Nx9746nigEK5JjCuR/7cNOcW1Jcit5o=
 =G2QR
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.2' into stable

ooni/probe-cli v3.9.2
2021-04-08 00:09:17 +02:00
Simone Basso
04ea3fca43
chore: adapt android scripts to use maven central (#307)
The main changes here are two. First, tweak some bits of the POM template
to make sure it's current, including referencing the correct repo. (We were
still referencing probe-engine in there, weirdly enough).

Second, change the android build script to create the same bundle that
mavan would build. What remains to do is uploading manually.

(Because it seems my PGP key is required, I guess this development rules
out automatically generating releases at GitHub. We will see about it
later on and possibly zap the publish-android.sh script.)

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

The release 2021.04.07-180801 has been created by me using this
diff from the v3.9.0 tag. I will update the release notes as soon
as this new release becomes available from Maven Central.
2021-04-07 20:46:11 +02:00
Simone Basso
54e590b776
fix(geolocate): do resolver lookup with proxy (#306)
The use cases for using a proxy become more clear over time. When I
originally wrote the proxy code the idea was to use the proxy to proxy
both the communication with the backend and measurements.

It become increasingly clear that we _only_ want to proxy the
communication with the backends. Therefore, there's no point in
skipping the resolver lookup step when we use a proxy.

Part of https://github.com/ooni/probe/issues/985
2021-04-07 18:48:02 +02:00
Simone Basso
c5f52d51e3 fix: disable maxRuntime with --input or --input-file (#305)
When this happens, the user is expressing the intention of
explicitly testing all the input they provided.

So, disable maxRuntime in these cases.

Part of https://github.com/ooni/probe/issues/1436.
2021-04-07 14:56:43 +02:00
Simone Basso
4578df0a2b
fix: disable maxRuntime with --input or --input-file (#305)
When this happens, the user is expressing the intention of
explicitly testing all the input they provided.

So, disable maxRuntime in these cases.

Part of https://github.com/ooni/probe/issues/1436.
2021-04-07 14:55:04 +02:00
Simone Basso
654441f5cd
fix: move preventMistakes in InputLoader (#304)
This fixes an issue where URLs provided with --input are not
accepted by the preventMistakes filter.

The filter itself needs to execute _only_ on URLs returned
by the checkIn API, rather than on URLs returned by the
InputLoader, which may instead be user provided.

Reference issue: https://github.com/ooni/probe/issues/1435
2021-04-07 14:14:25 +02:00
Simone Basso
f48115a2c9 chore: set version to v3.9.2 2021-04-07 13:57:28 +02:00
Simone Basso
818bf2cba5 fix: move preventMistakes in InputLoader
This fixes an issue where URLs provided with --input are not
accepted by the preventMistakes filter.

The filter itself needs to execute _only_ on URLs returned
by the checkIn API, rather than on URLs returned by the
InputLoader, which may instead be user provided.

Reference issue: https://github.com/ooni/probe/issues/1435
2021-04-07 13:54:56 +02:00
Simone Basso
46d19f47ec
fix: disable maxRuntime when not WebConnectivity (#302)
This commit cherry-picks 6306c09963

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

Conflicts:
	internal/version/version.go
2021-04-06 20:48:56 +02:00
Simone Basso
5d8cf60f55
fix(oonimkall): allow Android app to set proxy (#303)
Part of https://github.com/ooni/probe/issues/985
2021-04-06 14:53:58 +02:00
Simone Basso
6306c09963 fix: disable maxRuntime when not WebConnectivity
See https://github.com/ooni/probe/issues/1433
2021-04-06 13:03:50 +02:00
Simone Basso
7172e750dd
fix(session): make sure tunnel code is tested (#301)
* fix(session): make sure tunnel code is tested

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

* fix: add missing TunnelDir for correctness
2021-04-05 19:51:41 +02:00
Simone Basso
8b92037ae3
fix(tunnel/tor): keep tunneldir clean (#300)
* fix(tunnel/tor): keep tunneldir clean

This diff ensures that we don't keep the log file growing and
we also remove the temporary files created by the library we
are currently using for running tor from golang.

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

* fix(session.go): tell use we're using a tunnel
2021-04-05 19:18:00 +02:00
Simone Basso
6aa2551c43
urlgetter: fix tunnel test (#299)
* urlgetter: fix tunnel test

This diff fixes the urlgetter test suite to make sure we
are correctly testing for tunnel creation.

While there, improve the way in which we create a testing
directory and add a test for that.

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

* fix comment

* fix comment
2021-04-05 18:25:43 +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
76a50facc3
feat(tunnel): improve the test suite (#297)
Part of https://github.com/ooni/probe/issues/985
2021-04-05 16:38:25 +02:00
Simone Basso
2bafb179c3
refactor(tunnel): remove nil tunnels hack (#296)
* refactor(tunnel): remove nil tunnels hack

This code was originally introduced because a tunnel could be
nil in session.go. I have verified that every invocation of
tunnel.Start is careful to ensure that we have a tunnel name
and that we don't manipulate a nil tunnel.

For this reason, I'd rather remove this tricky bit of code and
further simplify the tunnel code.

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

* even better docs
2021-04-05 16:08:16 +02:00
Simone Basso
c5ad5eedeb
feat: create tunnel inside NewSession (#286)
* feat: create tunnel inside NewSession

We want to create the tunnel when we create the session. This change
allows us to nicely ignore the problem of creating a tunnel when we
already have a proxy, as well as the problem of locking. Everything is
happening, in fact, inside of the NewSession factory.

Modify miniooni such that --tunnel is just syntactic sugar for
--proxy, at least for now. We want, in the future, to teach the
tunnel to possibly use a socks5 proxy.

Because starting a tunnel is a slow operation, we need a context in
NewSession. This causes a bunch of places to change. Not really a big
deal except we need to propagate the changes.

Make sure that the mobile code can create a new session using a
proxy for all the APIs we support.

Make sure all tests are still green and we don't loose coverage of
the various ways in which this code could be used.

This change is part of https://github.com/ooni/probe/issues/985.

* changes after merge

* fix: only keep tests that can hopefully work

While there, identify other places where we should add more
tests or fix integration tests.

Part of https://github.com/ooni/probe/issues/985
2021-04-05 15:28:13 +02:00
Simone Basso
a849213b59
fix(engine): break circular dep betwen session and tunnel (#295)
This diff breaks the circular dependency between session and
tunnel, by introducing the concept of early session.

An early session is a session that is able to fetch the psiphon
configuration file _only_ if it's embedded in the binary.

This breaks `miniooni --tunnel=psiphon` for users who have
access to the OONI backend. They are not the users we are
writing this feature for, though, so I think this is reasonable.

At the same time, this opens up the possibility of creating
a psiphon tunnel when constructing a session, which is the
approach I was following in https://github.com/ooni/probe-cli/pull/286.

This work is part of https://github.com/ooni/probe/issues/985.

Once this diff is in, I can land https://github.com/ooni/probe-cli/pull/286.
2021-04-05 12:02:35 +02:00
Simone Basso
8fe4e5410d
feat(tunnel): introduce persistent tunnel state dir (#294)
* feat(tunnel): introduce persistent tunnel state dir

This diff introduces a persistent state directory for tunnels, so that
we can bootstrap them more quickly after the first time.

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

* fix: make tunnel dir optional

We have many tests where it does not make sense to explicitly
provide a tunnel dir because we're not using tunnels.

This should simplify setting up a session.

* fix(tunnel): repair tests

* final changes

* more cleanups
2021-04-05 11:27:41 +02:00
Simone Basso
47aa773731
refactor(tunnel): provide TorArgs and TorBinary directly (#293)
We're trying to remove a circular dependency between the measurement
Session and the tunnel package. To this end, continue to reduce the
dependency scope by providing TorArgs and TorBinary directly.

Part of https://github.com/ooni/probe/issues/985
2021-04-04 12:08:13 +02:00
Simone Basso
1eb63bc4b6
refactor(tunnel): remove dependecy from logger (#292)
Part of https://github.com/ooni/probe/issues/985
2021-04-04 11:23:03 +02:00
Simone Basso
dae53cb2a2
fix(tunnel/psiphon): don't overwrite config.WorkDir (#291)
Part of https://github.com/ooni/probe/issues/985
2021-04-03 21:34:19 +02:00
Simone Basso
d9aff19be5
refactor(tunnel): simplify tor implementation (#290)
Simplify interaction within the package by avoiding to have
a tor specific config. Use a Config instead.

Part of https://github.com/ooni/probe/issues/985.
2021-04-03 21:25:08 +02:00
Simone Basso
f739450370
refactor(tunnel): simplify psiphon implementation (#289)
Simplify interaction within the package by avoiding to have
a psiphon specific config. Use a Config instead.

Part of https://github.com/ooni/probe/issues/985.
2021-04-03 21:09:34 +02:00
Simone Basso
b53290cbfe
refactor(tunnel): pass the config as a pointer (#288)
Part of https://github.com/ooni/probe/issues/985
2021-04-03 20:12:56 +02:00
Simone Basso
ecb2aae1e8
refactor: merge psiphonx and torx into tunnel (#287)
* refactor: merge psiphonx and torx into tunnel

This is a case where it seems that merging these three packages into
a single package will enable us to better the implementation.

The goal is still https://github.com/ooni/probe/issues/985.

The roadblock I'm trying to overcome is
https://github.com/ooni/probe-cli/pull/286#pullrequestreview-627460104.

* avoid duplicating logger for now
2021-04-03 19:57:21 +02:00
Simone Basso
d7cd1ebcaf
refactor(riseupvpn): minor changes and annotations (#275) 2021-04-02 17:58:36 +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
79e8424677
refactor: remove model.ExperimentOrchestraClient (#284)
* ongoing

* while there, make sure we test everything

* reorganize previous commit

* ensure we have reasonable coverage in session

The code in here would be better with unit tests. We have too many
integration tests and the tests overall are too slow. But it's also
true that I should not write a giant diff as part of this PR.
2021-04-02 12:03:18 +02:00
Simone Basso
4700ba791d
chore: set version to 3.10.0-alpha (#283) 2021-04-02 10:16:25 +02:00
Simone Basso
d9486e3d67 ooni/probe-cli v3.9.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEc4h3qmyCnyakMcX0gLaRJ3cz2VsFAmBmEZgACgkQgLaRJ3cz
 2VvP/RAAgoyC5dahE1c6DBlcWi58mzXMhoIFvhwXynozo3f+BoX99E2iSX5FuMQl
 f7OaFjJP3VHTXosupIKAW2gMvBPDnWQaHWmTORrxO+3rc1sayTRfj/49z+vJFvUU
 CmNQPQig2MEri4ArjktH/UTFUv20kjRYUocmEwvKEaijAlVWpVIzjaH31sYHQi0K
 RnYjrbCqq3g3BghP5eQ7njBQmgMkKgdcsO6zMuH3Z9nwsxyT6fLIa5TA8YckAzJp
 I2CXcpEj9JNJ44jPqcC3wxafufc2QUlrSQMCc1+kt8EMxHObYtxqq4Z3mIwvC41W
 WPjf4/ihwAUkyQTdqHVnJ20ZlOPq0IQEJbj6sHLsDcyZ8CD7YxNVnjvoc1i77lrl
 LXjiMLd6ARAiJoi2NfmWwnAgF/f32YCnwO21xHX44s8ISZC2V6g0IRl4eMAr4kEm
 8ESvgjZ/LVW4hfiJREMaxZ0kzJQjT0ORrWyCUe6jJmRgFoTbbW3K40QLVHqPxuEW
 wfxTzLwU/NFDZGUFFAfWXgvbDdAcYQMf9JyrNRNgAIi2IY+7KhFEZ/zMN7zy9ugJ
 sz5ryj6mKmke49u25kX0dm0sKlzVNyIUDsqbc9XiJ18zPv2CvY67BlTiA+uVCYq2
 UoEB9dV7uAYyAsuIqNZORTNdqquPEACFMl7CJthB2Ei+eqY1B+M=
 =HvUU
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0' into mobile-staging

ooni/probe-cli v3.9.0
2021-04-01 20:33:46 +02:00