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:
parent
09e300ed26
commit
41cf4a8671
8 changed files with 170 additions and 28 deletions
23
internal/tunnel/tordesktop.go
Normal file
23
internal/tunnel/tordesktop.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
//go:build !android && !ios
|
||||
|
||||
package tunnel
|
||||
|
||||
// This file implements our strategy for running tor on desktop.
|
||||
|
||||
import "github.com/cretz/bine/tor"
|
||||
|
||||
// getTorStartConf in this configuration uses torExePath to get a
|
||||
// suitable tor binary and then executes it.
|
||||
func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.StartConf, error) {
|
||||
exePath, err := config.torBinary()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config.logger().Infof("tunnel: tor: exec binary: %s", exePath)
|
||||
return &tor.StartConf{
|
||||
ExePath: exePath,
|
||||
DataDir: dataDir,
|
||||
ExtraArgs: extraArgs,
|
||||
NoHush: true,
|
||||
}, nil
|
||||
}
|
||||
Loading…
Reference in a new issue