commit 9b25111586a79db47cb880586dbe368ba6327376 Author: aagbsn aagbsn@extc.org Date: Thu May 23 00:54:50 2013 -0400
Add bridge and obfsproxy support to director when starting Tor --- ooni/director.py | 16 ++++++++++++++++ ooniprobe.conf.sample | 1 + 2 files changed, 17 insertions(+)
diff --git a/ooni/director.py b/ooni/director.py index 809eae4..9538fe4 100644 --- a/ooni/director.py +++ b/ooni/director.py @@ -298,6 +298,22 @@ class Director(object): os.makedirs(data_dir) tor_config.DataDirectory = data_dir
+ if config.tor.bridges: + tor_config.UseBridges = 1 + if config.advanced.obfsproxy_binary: + tor_config.ClientTransportPlugin = \ + 'obfs2,obfs3 exec %s managed' % \ + config.advanced.obfsproxy_binary + bridges = [] + with open(config.tor.bridges) as f: + for bridge in f: + if 'obfs' in bridge: + if config.advanced.obfsproxy_binary: + bridges.append(bridge.strip()) + else: + bridges.append(bridge.strip()) + tor_config.Bridge = bridges + tor_config.save()
log.debug("Setting control port as %s" % tor_config.ControlPort) diff --git a/ooniprobe.conf.sample b/ooniprobe.conf.sample index bed9da6..174bb91 100644 --- a/ooniprobe.conf.sample +++ b/ooniprobe.conf.sample @@ -26,6 +26,7 @@ advanced: geoip_data_dir: /usr/share/GeoIP/ debug: true # tor_binary: '/usr/sbin/tor' + # obfsproxy_binary: '/usr/bin/obfsproxy' # For auto detection interface: auto # Of specify a specific interface