[Pkg-privacy-commits] [torbrowser-launcher] 233/476: remove use_system_tor setting. fixes #100
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.
commit a1ce543a7790be262b9f40f60e60e681356db070
Author: Micah Lee <micah at micahflee.com>
Date: Tue Jul 8 13:00:02 2014 -0700
remove use_system_tor setting. fixes #100
---
stdeb.cfg | 3 +--
torbrowser-launcher | 56 ++++++++++++++---------------------------------------
2 files changed, 15 insertions(+), 44 deletions(-)
diff --git a/stdeb.cfg b/stdeb.cfg
index 8ca02ef..1bcd291 100644
--- a/stdeb.cfg
+++ b/stdeb.cfg
@@ -1,5 +1,4 @@
[DEFAULT]
Package: torbrowser-launcher
Depends: python-gtk2, python-psutil, python-twisted, python-lzma, gnupg, wmctrl
-Recommends: python-txsocksx
-Suite: trusty
+Recommends: python-txsocksx tor python-pygame
diff --git a/torbrowser-launcher b/torbrowser-launcher
index 4ca33fa..1dc28ba 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -249,15 +249,11 @@ class TBLCommon:
},
'update_over_tor': True,
'check_for_updates': False,
- 'use_system_tor': False,
'modem_sound': False,
'last_update_check_timestamp': 0,
'mirror': self.default_mirror
}
- if os.getenv("TOR_SKIP_LAUNCH") == "1":
- default_settings['use_system_tor'] = True
-
if os.path.isfile(self.paths['settings_file']):
settings = pickle.load(open(self.paths['settings_file']))
resave = False
@@ -395,22 +391,12 @@ class TBLSettings:
self.preferred_box.pack_start(self.preferred, True, True, 0)
self.preferred.show()
- # use system tor
- self.system_tor_checkbox = gtk.CheckButton(_("Use the system's Tor installation"))
- self.settings_box.pack_start(self.system_tor_checkbox, True, True, 0)
- if self.common.settings['use_system_tor']:
- self.system_tor_checkbox.set_active(True)
- else:
- self.system_tor_checkbox.set_active(False)
- self.system_tor_checkbox.show()
-
+ # download over tor
try:
import txsocksx
self.txsocks_found = True
except ImportError:
self.txsocks_found = False
-
- # download over tor
self.tor_update_checkbox = gtk.CheckButton(_("Download updates over Tor (recommended)"))
if self.txsocks_found:
self.tor_update_checkbox.set_tooltip_text(_("This option is only available when using a system wide Tor installation."))
@@ -428,10 +414,6 @@ class TBLSettings:
self.tor_update_checkbox.show()
- # Set callback for system tor and update over tor
- self.system_tor_checkbox.connect('clicked', self.on_system_tor_clicked)
- self.on_system_tor_clicked(None)
-
# check for updates
self.update_checkbox = gtk.CheckButton(_("Check for updates next launch"))
self.settings_box.pack_start(self.update_checkbox, True, True, 0)
@@ -566,7 +548,6 @@ class TBLSettings:
self.common.settings['preferred'] = preferred
# checkbox options
- self.common.settings['use_system_tor'] = self.system_tor_checkbox.get_active()
self.common.settings['update_over_tor'] = self.tor_update_checkbox.get_active()
self.common.settings['check_for_updates'] = self.update_checkbox.get_active()
self.common.settings['modem_sound'] = self.modem_checkbox.get_active()
@@ -595,26 +576,16 @@ class TBLLauncher:
self.launch_gui = True
self.common.build_paths(self.common.settings['latest_version'][self.common.settings['preferred']])
- if self.common.settings['use_system_tor']:
- os.putenv("TOR_SKIP_LAUNCH", "1")
- os.putenv("TOR_SOCKS_HOST", "127.0.0.1")
- os.putenv("TOR_SOCKS_PORT", "9050")
- # need to manually set os.environ because os.putenv doesn't update it
- # https://docs.python.org/2/library/os.html#os.putenv
- os.environ["TOR_SKIP_LAUNCH"] = "1"
- os.environ["TOR_SOCKS_HOST"] = "127.0.0.1"
- os.environ["TOR_SOCKS_PORT"] = "9050"
-
- try:
- import txsocksx
-
- self.common.settings['update_over_tor'] = True
- except ImportError:
- md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The python-txsocksx package is missing, downloads will not happen over tor"))
- md.set_position(gtk.WIN_POS_CENTER)
- md.run()
- md.destroy()
- self.common.settings['update_over_tor'] = False
+ if self.common.settings['update_over_tor']:
+ try:
+ import txsocksx
+ except ImportError:
+ md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The python-txsocksx package is missing, downloads will not happen over tor"))
+ md.set_position(gtk.WIN_POS_CENTER)
+ md.run()
+ md.destroy()
+ self.common.settings['update_over_tor'] = False
+ self.common.save_settings()
# is firefox already running?
if self.common.settings['installed_version']:
@@ -979,11 +950,12 @@ class TBLLauncher:
self.progressbar.show()
self.refresh_gtk()
- if self.common.settings['use_system_tor'] and self.common.settings['update_over_tor']:
+ if self.common.settings['update_over_tor']:
+ print _('Updating over Tor')
from twisted.internet.endpoints import TCP4ClientEndpoint
from txsocksx.http import SOCKS5Agent
- torEndpoint = TCP4ClientEndpoint(reactor, os.getenv("TOR_SOCKS_HOST"), int(os.getenv("TOR_SOCKS_PORT")))
+ torEndpoint = TCP4ClientEndpoint(reactor, '127.0.0.1', 9050)
# default mirror gets certificate pinning, only for requests that use the mirror
if self.common.settings['mirror'] == self.common.default_mirror and '{0}' in url:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git
More information about the Pkg-privacy-commits
mailing list