ooni-probe-cli/internal/engine
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
..
atomicx chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
experiment feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
geolocate refactor: redesign how we import assets (#260) 2021-04-01 16:57:31 +02:00
httpheader Release: update user-agent, bundled CA, version number (#281) 2021-04-01 18:40:30 +02:00
httpx refactor: move more commands to internal/cmd (#207) 2021-02-03 12:23:15 +01:00
humanizex refactor: miniooni should be outside of the engine (#206) 2021-02-03 11:21:10 +01:00
internal refactor: merge psiphonx and torx into tunnel (#287) 2021-04-03 19:57:21 +02:00
kvstore refactor: move more commands to internal/cmd (#207) 2021-02-03 12:23:15 +01:00
legacy refactor: redesign how we import assets (#260) 2021-04-01 16:57:31 +02:00
model refactor: remove model.ExperimentOrchestraClient (#284) 2021-04-02 12:03:18 +02:00
netx refactor: remove model.ExperimentOrchestraClient (#284) 2021-04-02 12:03:18 +02:00
ooapi Release: update user-agent, bundled CA, version number (#281) 2021-04-01 18:40:30 +02:00
probeservices fix: apply staticcheck suggestions (#262) 2021-03-24 12:35:53 +01:00
runtimex refactor: start building an Android package (#205) 2021-02-03 10:51:14 +01:00
shellx fix: use golang.org/x/sys/execabs (#224) 2021-02-10 07:40:48 +01:00
testdata fix: add missing files causing tests to fail (#202) 2021-02-02 14:18:22 +01:00
tunnel feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
.gitignore feat: support embedding encrypted psiphon config (#285) 2021-04-02 17:36:06 +02:00
allexperiments.go refactor(inputloader): better docs and naming (#265) 2021-03-26 09:34:27 +01:00
experiment_integration_test.go refactor(inputloader): better docs and naming (#265) 2021-03-26 09:34:27 +01:00
experiment_internal_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
experiment_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
experiment.go refactor: redesign how we import assets (#260) 2021-04-01 16:57:31 +02:00
experimentbuilder_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
experimentbuilder.go refactor(inputloader): better docs and naming (#265) 2021-03-26 09:34:27 +01:00
inputloader_network_test.go feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
inputloader_test.go feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
inputloader.go release 3.9.0 process: reduce warnings (#279) 2021-03-31 15:59:19 +02:00
inputprocessor_test.go fix(miniooni): replace --limit with --max-runtime (#272) 2021-03-29 20:38:23 +02:00
inputprocessor.go fix(miniooni): replace --limit with --max-runtime (#272) 2021-03-29 20:38:23 +02:00
kvstore_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
kvstore.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
saver_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
saver.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
session_integration_test.go feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
session_internal_test.go refactor: remove model.ExperimentOrchestraClient (#284) 2021-04-02 12:03:18 +02:00
session_nopsiphon.go fix(engine): break circular dep betwen session and tunnel (#295) 2021-04-05 12:02:35 +02:00
session_psiphon_test.go feat: support embedding encrypted psiphon config (#285) 2021-04-02 17:36:06 +02:00
session_psiphon.go fix(engine): break circular dep betwen session and tunnel (#295) 2021-04-05 12:02:35 +02:00
session.go feat: create tunnel inside NewSession (#286) 2021-04-05 15:28:13 +02:00
submitter_test.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
submitter.go chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00