mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-02 09:35:33 -05:00
If no country-specific settings are found, try automatically using obfs4 bridge instead of prompting user to go to Tor Settings
This commit is contained in:
parent
a676551821
commit
4f3313fd20
@ -95,7 +95,6 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||||||
# Use bridge widget
|
# Use bridge widget
|
||||||
self.use_bridge_widget = AutoConnectUseBridgeWidget(self.common)
|
self.use_bridge_widget = AutoConnectUseBridgeWidget(self.common)
|
||||||
self.use_bridge_widget.connect_clicked.connect(self.use_bridge_connect_clicked)
|
self.use_bridge_widget.connect_clicked.connect(self.use_bridge_connect_clicked)
|
||||||
self.use_bridge_widget.back_clicked.connect(self.back_clicked)
|
|
||||||
self.use_bridge_widget.open_tor_settings.connect(self.open_tor_settings)
|
self.use_bridge_widget.open_tor_settings.connect(self.open_tor_settings)
|
||||||
self.use_bridge_widget.hide()
|
self.use_bridge_widget.hide()
|
||||||
|
|
||||||
@ -169,21 +168,13 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||||||
self.tor_con.start(self.curr_settings)
|
self.tor_con.start(self.curr_settings)
|
||||||
|
|
||||||
def _got_no_bridges(self):
|
def _got_no_bridges(self):
|
||||||
self.use_bridge_widget.progress.hide()
|
# If we got no bridges, try connecting again using built-in obfs4 bridges
|
||||||
self.use_bridge_widget.progress_label.hide()
|
self.curr_settings.set("bridges_type", "built-in")
|
||||||
|
self.curr_settings.set("bridges_builtin_pt", "obfs4")
|
||||||
|
self.curr_settings.set("bridges_enabled", True)
|
||||||
|
self.curr_settings.save()
|
||||||
|
|
||||||
Alert(
|
self._got_bridges()
|
||||||
self.common,
|
|
||||||
strings._("gui_autoconnect_circumventing_censorship_no_bridges"),
|
|
||||||
QtWidgets.QMessageBox.Critical,
|
|
||||||
)
|
|
||||||
self.common.log(
|
|
||||||
"AutoConnectTab",
|
|
||||||
"_got_no_bridges",
|
|
||||||
"Could not get bridges for this country. Raising TorSettingsTab",
|
|
||||||
)
|
|
||||||
self.open_tor_settings()
|
|
||||||
self.close_this_tab.emit()
|
|
||||||
|
|
||||||
def _censorship_progress_update(self, progress, summary):
|
def _censorship_progress_update(self, progress, summary):
|
||||||
self.use_bridge_widget.progress.setValue(int(progress))
|
self.use_bridge_widget.progress.setValue(int(progress))
|
||||||
@ -235,10 +226,6 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||||||
)
|
)
|
||||||
self._got_bridges()
|
self._got_bridges()
|
||||||
else:
|
else:
|
||||||
self._censorship_progress_update(
|
|
||||||
100,
|
|
||||||
strings._("gui_autoconnect_circumventing_censorship_no_bridges"),
|
|
||||||
)
|
|
||||||
self._got_no_bridges()
|
self._got_no_bridges()
|
||||||
except (
|
except (
|
||||||
MeekNotRunning,
|
MeekNotRunning,
|
||||||
@ -246,13 +233,6 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||||||
) as e:
|
) as e:
|
||||||
self._got_no_bridges()
|
self._got_no_bridges()
|
||||||
|
|
||||||
def back_clicked(self):
|
|
||||||
"""
|
|
||||||
Switch from use bridge widget back to first launch widget
|
|
||||||
"""
|
|
||||||
self.use_bridge_widget.hide()
|
|
||||||
self.first_launch_widget.show()
|
|
||||||
|
|
||||||
def check_for_updates(self):
|
def check_for_updates(self):
|
||||||
"""
|
"""
|
||||||
Check for OnionShare updates in a new thread, if enabled.
|
Check for OnionShare updates in a new thread, if enabled.
|
||||||
@ -394,7 +374,6 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
connect_clicked = QtCore.Signal()
|
connect_clicked = QtCore.Signal()
|
||||||
back_clicked = QtCore.Signal()
|
|
||||||
open_tor_settings = QtCore.Signal()
|
open_tor_settings = QtCore.Signal()
|
||||||
|
|
||||||
def __init__(self, common):
|
def __init__(self, common):
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
"gui_autoconnect_circumventing_censorship_starting_meek": "Starting Meek for domain-fronting",
|
"gui_autoconnect_circumventing_censorship_starting_meek": "Starting Meek for domain-fronting",
|
||||||
"gui_autoconnect_circumventing_censorship_requesting_bridges": "Requesting bridges from the Tor Censorship Circumvention API",
|
"gui_autoconnect_circumventing_censorship_requesting_bridges": "Requesting bridges from the Tor Censorship Circumvention API",
|
||||||
"gui_autoconnect_circumventing_censorship_got_bridges": "Got bridges! Trying to reconnect to Tor",
|
"gui_autoconnect_circumventing_censorship_got_bridges": "Got bridges! Trying to reconnect to Tor",
|
||||||
"gui_autoconnect_circumventing_censorship_no_bridges": "OnionShare still couldn't connect to Tor, even after trying to find bridges.<br><br>Please try configuring the Tor Network settings manually.",
|
|
||||||
"gui_settings_window_title": "Settings",
|
"gui_settings_window_title": "Settings",
|
||||||
"gui_settings_autoupdate_label": "Check for new version",
|
"gui_settings_autoupdate_label": "Check for new version",
|
||||||
"gui_settings_autoupdate_option": "Notify me when a new version is available",
|
"gui_settings_autoupdate_option": "Notify me when a new version is available",
|
||||||
@ -248,4 +247,4 @@
|
|||||||
"moat_captcha_error": "The solution is not correct. Please try again.",
|
"moat_captcha_error": "The solution is not correct. Please try again.",
|
||||||
"moat_solution_empty_error": "You must enter the characters from the image",
|
"moat_solution_empty_error": "You must enter the characters from the image",
|
||||||
"mode_tor_not_connected_label": "OnionShare is not connected to the Tor network"
|
"mode_tor_not_connected_label": "OnionShare is not connected to the Tor network"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user