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
This commit is contained in:
@@ -333,6 +333,10 @@ func MainWithConfiguration(experimentName string, currentOptions Options) {
|
||||
kvstore, err := engine.NewFileSystemKVStore(kvstore2dir)
|
||||
fatalOnError(err, "cannot create kvstore2 directory")
|
||||
|
||||
tunnelDir := filepath.Join(miniooniDir, "tunnel")
|
||||
err = os.MkdirAll(tunnelDir, 0700)
|
||||
fatalOnError(err, "cannot create tunnelDir")
|
||||
|
||||
config := engine.SessionConfig{
|
||||
KVStore: kvstore,
|
||||
Logger: logger,
|
||||
@@ -341,6 +345,7 @@ func MainWithConfiguration(experimentName string, currentOptions Options) {
|
||||
SoftwareVersion: softwareVersion,
|
||||
TorArgs: currentOptions.TorArgs,
|
||||
TorBinary: currentOptions.TorBinary,
|
||||
TunnelDir: tunnelDir,
|
||||
}
|
||||
if currentOptions.ProbeServicesURL != "" {
|
||||
config.AvailableProbeServices = []model.Service{{
|
||||
|
||||
Reference in New Issue
Block a user