-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3423c7
commit c4acb74
Showing
14 changed files
with
51 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !ooni_libtor | ||
//go:build !android && !ios && !ooni_libtor | ||
|
||
package tunnel | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build ooni_libtor | ||
//go:build ooni_libtor && android | ||
|
||
package tunnel | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//go:build ios || (android && !ooni_libtor) | ||
|
||
package tunnel | ||
|
||
// | ||
// This file implements our old strategy for running tor on mobile, which | ||
// is based on integrating github.com/ooni/go-libtor. We currently only use | ||
// this stategy on iOS. See https://github.com/ooni/probe/issues/2365. | ||
// | ||
|
||
import ( | ||
"strings" | ||
|
||
"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().Infof("tunnel: tor: exec: <ooni/go-libtor> %s %s", | ||
dataDir, strings.Join(extraArgs, " ")) | ||
return &tor.StartConf{ | ||
// Implementation note: go-libtor leaks a file descriptor when you set | ||
// UseEmbeddedControlConn, as documented by | ||
// | ||
// https://github.com/ooni/probe/issues/2405 | ||
// | ||
// This is why we're not using this field for now. The above mentioned | ||
// issue also refers to what a possible fix would look like. | ||
ProcessCreator: libtor.Creator, | ||
DataDir: dataDir, | ||
ExtraArgs: extraArgs, | ||
NoHush: true, | ||
}, nil | ||
} |