feature: use go-libtor on mobile, OONI_TOR_BINARY env on desktop (#614)

This branch adds support for running:

1. `go-libtor` on mobile.

2. the tor provided by the desktop app via the `OONI_TOR_BINARY` environment variable.

See https://github.com/ooni/ooni.org/issues/761.

Co-authored-by: Simone Basso <bassosimone@gmail.com>
This commit is contained in:
Arturo Filastò 2021-12-15 14:16:22 +01:00 committed by GitHub
commit 41cf4a8671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 170 additions and 28 deletions

View file

@ -0,0 +1,21 @@
//go:build ios || android
package tunnel
// This file implements our strategy for running tor on mobile.
import (
"github.com/cretz/bine/tor"
"github.com/ooni/go-libtor"
)
// getTorStartConf in this configuration uses github.com/ooni/go-libtor.
func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.StartConf, error) {
config.logger().Info("tunnel: tor: using ooni/go-libtor")
return &tor.StartConf{
ProcessCreator: libtor.Creator,
DataDir: dataDir,
ExtraArgs: extraArgs,
NoHush: true,
}, nil
}