mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 18:52:58 -03:00
Merge branch 'fred-a-kemp-feature/tor-control-port-from-env'
This commit is contained in:
commit
d8b0a4e152
1 changed files with 5 additions and 1 deletions
|
@ -57,7 +57,11 @@ class Onion(object):
|
||||||
# connect to the tor controlport
|
# connect to the tor controlport
|
||||||
found_tor = False
|
found_tor = False
|
||||||
self.c = None
|
self.c = None
|
||||||
ports = [9151, 9153, 9051]
|
env_port = os.environ.get('TOR_CONTROL_PORT')
|
||||||
|
if env_port:
|
||||||
|
ports = [int(env_port)]
|
||||||
|
else:
|
||||||
|
ports = [9151, 9153, 9051]
|
||||||
for port in ports:
|
for port in ports:
|
||||||
try:
|
try:
|
||||||
self.c = Controller.from_port(port=port)
|
self.c = Controller.from_port(port=port)
|
||||||
|
|
Loading…
Add table
Reference in a new issue