diff options
author | Micah Lee <micah@micahflee.com> | 2016-09-27 14:09:39 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2016-09-27 14:09:39 -0700 |
commit | d8b0a4e152d59ada9dc737045f6343a8c9900f55 (patch) | |
tree | 5ccce9e618176ee94b36521aa36d51b981398b35 | |
parent | 373f24e64b52aea6ad9dc5caeb9073e728abec2f (diff) | |
parent | c74d8929681f1e6555d8c54ad9831b725e5fea47 (diff) | |
download | onionshare-d8b0a4e152d59ada9dc737045f6343a8c9900f55.tar.gz onionshare-d8b0a4e152d59ada9dc737045f6343a8c9900f55.zip |
Merge branch 'fred-a-kemp-feature/tor-control-port-from-env'
-rw-r--r-- | onionshare/onion.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/onionshare/onion.py b/onionshare/onion.py index 5370fe2d..2bfd4888 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -57,7 +57,11 @@ class Onion(object): # connect to the tor controlport found_tor = False 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: try: self.c = Controller.from_port(port=port) |