Commit 181ac3f7 authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Move & rename Tor socks port options

parent 635276e8
......@@ -26,9 +26,6 @@ num_rtts = 10
num_downloads = 5
# The number of bytes to initially request from the server
initial_read_request = 16384
# Where to connect to Tor for proxying our measurement connections
tor_socks_host = 127.0.0.1
tor_socks_port = 9050
# How many measurements to make in parallel
measurement_threads = 3
# Whether or not to measure authorities
......@@ -45,6 +42,10 @@ control_type = port
control_location = 9051
#control_type = socket
#control_location = /var/run/tor/control
# Where to connect to Tor for proxying our measurement connections and
# reachability tests
socks_host = 127.0.0.1
socks_port = 9050
[cleanup]
# After this many days, compress data files
......
......@@ -138,8 +138,8 @@ def measure_relay(args, conf, helpers, cb, rl, relay):
# circuit when we connect()
stem_utils.add_event_listener(
cb.controller, listener, EventType.STREAM)
s = make_socket(conf['scanner']['tor_socks_host'],
conf.getint('scanner', 'tor_socks_port'))
s = make_socket(conf['tor']['socks_host'],
conf.getint('tor', 'socks_port'))
# This call blocks until we are connected (or give up). We get attched
# to the right circuit in the background.
connected = socket_connect(s, helper.server_host, helper.server_port)
......
......@@ -160,24 +160,15 @@ def _validate_scanner(conf):
'download_target': {'minimum': 0.001, 'maximum': None},
'download_max': {'minimum': 0.001, 'maximum': None},
}
hosts = {
'tor_socks_host': {},
}
ports = {
'tor_socks_port': {},
}
bools = {
'measure_authorities': {},
}
all_valid_keys = list(ints.keys()) + list(floats.keys()) + \
list(hosts.keys()) + list(ports.keys()) + list(bools.keys()) + \
['nickname']
list(bools.keys()) + ['nickname']
errors.extend(_validate_section_keys(conf, sec, all_valid_keys, err_tmpl))
errors.extend(_validate_section_ints(conf, sec, ints, err_tmpl))
errors.extend(_validate_section_floats(conf, sec, floats, err_tmpl))
# XXX: validate hosts func doesn't do anything currently
errors.extend(_validate_section_hosts(conf, sec, hosts, err_tmpl))
errors.extend(_validate_section_ports(conf, sec, ports, err_tmpl))
errors.extend(_validate_section_bools(conf, sec, bools, err_tmpl))
valid, error_msg = _validate_nickname(conf[sec], 'nickname')
if not valid:
......@@ -229,10 +220,19 @@ def _validate_tor(conf):
enums = {
'control_type': {'valid': ['port', 'socket']},
}
hosts = {
'socks_host': {},
}
ports = {
'socks_port': {},
}
unvalidated_keys = ['control_location']
all_valid_keys = list(enums.keys()) + unvalidated_keys
all_valid_keys = list(enums.keys()) + list(hosts.keys()) + \
list(ports.keys()) + unvalidated_keys
errors.extend(_validate_section_keys(conf, sec, all_valid_keys, err_tmpl))
errors.extend(_validate_section_enums(conf, sec, enums, err_tmpl))
errors.extend(_validate_section_hosts(conf, sec, hosts, err_tmpl))
errors.extend(_validate_section_ports(conf, sec, ports, err_tmpl))
return errors
......
......@@ -151,11 +151,11 @@ sbws_home = $(pwd)
[tor]
control_type = socket
control_location = \${paths:sbws_home}/$scanner_tor_socks_proxy_nick/control_socket
socks_host = $scanner_tor_socks_proxy_ip
socks_port = $socksport
[scanner]
nickname = SbwsTestnetScanner
tor_socks_host = $scanner_tor_socks_proxy_ip
tor_socks_port = $socksport
measurement_threads = 4
download_toofast = 0.1
download_min = 1
......
......@@ -151,11 +151,11 @@ sbws_home = $(pwd)
[tor]
control_type = socket
control_location = \${paths:sbws_home}/$scanner_tor_socks_proxy_nick/control_socket
socks_host = $scanner_tor_socks_proxy_ip
socks_port = $socksport
[scanner]
nickname = SbwsTestnetScanner
tor_socks_host = $scanner_tor_socks_proxy_ip
tor_socks_port = $socksport
measurement_threads = 4
download_toofast = 0.1
download_min = 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment