From b513c59542f55b07aa439170014f3f141590447e Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 26 Feb 2018 13:48:28 +1100 Subject: [PATCH 1/3] Hide the meek_lite options on macOS and Windows, as the obfs4proxy binary in TorBrowser is too old to support it --- onionshare_gui/settings_dialog.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 5666400c..9952c06f 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -184,6 +184,11 @@ class SettingsDialog(QtWidgets.QDialog): self.tor_bridges_use_meek_lite_azure_radio = QtWidgets.QRadioButton(strings._('gui_settings_tor_bridges_meek_lite_azure_radio_option', True)) self.tor_bridges_use_meek_lite_azure_radio.toggled.connect(self.tor_bridges_use_meek_lite_azure_radio_toggled) + # meek_lite currently not supported on the version of obfs4proxy bundled with TorBrowser + if system == 'Windows' or system == 'Darwin': + self.tor_bridges_use_meek_lite_amazon_radio.hide() + self.tor_bridges_use_meek_lite_azure_radio.hide() + # Custom bridges radio and textbox self.tor_bridges_use_custom_radio = QtWidgets.QRadioButton(strings._('gui_settings_tor_bridges_custom_radio_option', True)) self.tor_bridges_use_custom_radio.toggled.connect(self.tor_bridges_use_custom_radio_toggled) @@ -830,10 +835,13 @@ class SettingsDialog(QtWidgets.QDialog): ipv6_pattern = re.compile("(obfs4\s+)?\[(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\]:[0-9]+\s+[A-Z0-9]+(.+)$") meek_lite_pattern = re.compile("(meek_lite)(\s)+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+)(\s)+([0-9A-Z]+)(\s)+url=(.+)(\s)+front=(.+)") if ipv4_pattern.match(bridge) or \ - ipv6_pattern.match(bridge) or \ - meek_lite_pattern.match(bridge): + ipv6_pattern.match(bridge): new_bridges.append(''.join(['Bridge ', bridge, '\n'])) bridges_valid = True + if system != 'Windows' and system != 'Darwin' and meek_lite_pattern.match(bridge): + new_bridges.append(''.join(['Bridge ', bridge, '\n'])) + bridges_valid = True + if bridges_valid: new_bridges = ''.join(new_bridges) settings.set('tor_bridges_use_custom_bridges', new_bridges) From 56d3090fa65fc765518694b88803b9ffa113b0c6 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 26 Feb 2018 13:52:30 +1100 Subject: [PATCH 2/3] Update changelog to note that meek_lite not supported on MacOS or Windows --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6169840b..4a03a151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ * Major UI redesign, introducing many UX improvements * Client-side web interfact redesigned -* New feature: Support for meek_lite pluggable transports (Amazon and Azure) -* New feature: Support for custom obfs4 and meek-lite bridges +* New feature: Support for meek_lite pluggable transports (Amazon and Azure) - not yet ready for Windows or Mac, sorry +* New feature: Support for custom obfs4 and meek_lite bridges (again, meek_lite not available on Windows/Mac yet) * New feature: ability to cancel share before it starts * Bug fix: the UpdateChecker no longer blocks the UI when checking * Bug fix: simultaneous downloads (broken in 1.2) From 022ed032872e598c0f2a456f2074b78a9bfcd67c Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 26 Feb 2018 14:02:15 +1100 Subject: [PATCH 3/3] Uninstantiated system variable --- onionshare_gui/settings_dialog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 9952c06f..7c81afc6 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -46,7 +46,7 @@ class SettingsDialog(QtWidgets.QDialog): self.setWindowTitle(strings._('gui_settings_window_title', True)) self.setWindowIcon(QtGui.QIcon(common.get_resource_path('images/logo.png'))) - system = platform.system() + self.system = platform.system() # Sharing options @@ -135,7 +135,7 @@ class SettingsDialog(QtWidgets.QDialog): autoupdate_group.setLayout(autoupdate_group_layout) # Autoupdate is only available for Windows and Mac (Linux updates using package manager) - if system != 'Windows' and system != 'Darwin': + if self.system != 'Windows' and self.system != 'Darwin': autoupdate_group.hide() # Connection type: either automatic, control port, or socket file @@ -145,7 +145,7 @@ class SettingsDialog(QtWidgets.QDialog): self.connection_type_bundled_radio.toggled.connect(self.connection_type_bundled_toggled) # Bundled Tor doesn't work on dev mode in Windows or Mac - if (system == 'Windows' or system == 'Darwin') and getattr(sys, 'onionshare_dev_mode', False): + if (self.system == 'Windows' or self.system == 'Darwin') and getattr(sys, 'onionshare_dev_mode', False): self.connection_type_bundled_radio.setEnabled(False) # Bridge options for bundled tor @@ -185,7 +185,7 @@ class SettingsDialog(QtWidgets.QDialog): self.tor_bridges_use_meek_lite_azure_radio.toggled.connect(self.tor_bridges_use_meek_lite_azure_radio_toggled) # meek_lite currently not supported on the version of obfs4proxy bundled with TorBrowser - if system == 'Windows' or system == 'Darwin': + if self.system == 'Windows' or self.system == 'Darwin': self.tor_bridges_use_meek_lite_amazon_radio.hide() self.tor_bridges_use_meek_lite_azure_radio.hide() @@ -838,7 +838,7 @@ class SettingsDialog(QtWidgets.QDialog): ipv6_pattern.match(bridge): new_bridges.append(''.join(['Bridge ', bridge, '\n'])) bridges_valid = True - if system != 'Windows' and system != 'Darwin' and meek_lite_pattern.match(bridge): + if self.system != 'Windows' and self.system != 'Darwin' and meek_lite_pattern.match(bridge): new_bridges.append(''.join(['Bridge ', bridge, '\n'])) bridges_valid = True