[Pkg-privacy-commits] [onionshare] 02/16: Try to get the Tor ControlPort from the environment.
Ulrike Uhlig
ulrike at moszumanska.debian.org
Fri May 26 12:51:56 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch debian
in repository onionshare.
commit c74d8929681f1e6555d8c54ad9831b725e5fea47
Author: anonym <anonym at riseup.net>
Date: Thu Sep 22 11:25:42 2016 +0200
Try to get the Tor ControlPort from the environment.
... via the TOR_CONTROL_PORT variable. If set, onionshare will only
try this port.
---
onionshare/onion.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/onionshare/onion.py b/onionshare/onion.py
index 5370fe2..2bfd488 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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list