aboutsummaryrefslogtreecommitdiff
path: root/desktop/src/onionshare
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2021-11-24 17:55:47 +1100
committerMiguel Jacq <mig@mig5.net>2021-11-24 17:55:47 +1100
commit06a3599fe185902ce8f3c704f8ea652504a1fab7 (patch)
treee816208720367c206aff51bd7ef081de813a2b2e /desktop/src/onionshare
parentf8dd9547cd691b643592b7dc0d9b507086a22154 (diff)
downloadonionshare-06a3599fe185902ce8f3c704f8ea652504a1fab7.tar.gz
onionshare-06a3599fe185902ce8f3c704f8ea652504a1fab7.zip
Built-in bridge refactoring.
Store the built-in bridges in OnionShare settings as a dict, and try writing those into the torrc if present. If they aren't present in OnionShare settings, use the hardcoded templates instead. Fetch the latest built-in bridges over Tor, once connected to Tor. If we can't fetch the bridges over Tor, fall back to Meek (domain-fronting) and try again. Then write those as the dict to the OnionShare settings, to take precedence next time.
Diffstat (limited to 'desktop/src/onionshare')
-rw-r--r--desktop/src/onionshare/gui_common.py4
-rw-r--r--desktop/src/onionshare/resources/locale/en.json1
-rw-r--r--desktop/src/onionshare/threads.py2
-rw-r--r--desktop/src/onionshare/tor_connection.py2
4 files changed, 0 insertions, 9 deletions
diff --git a/desktop/src/onionshare/gui_common.py b/desktop/src/onionshare/gui_common.py
index 486a3578..2a0bae4d 100644
--- a/desktop/src/onionshare/gui_common.py
+++ b/desktop/src/onionshare/gui_common.py
@@ -38,7 +38,6 @@ from onionshare_cli.onion import (
TorTooOldEphemeral,
TorTooOldStealth,
PortNotAvailable,
- TorErrorGettingBridges,
)
@@ -508,7 +507,4 @@ class GuiCommon:
return strings._("error_stealth_not_supported")
elif type(e) is PortNotAvailable:
return strings._("error_port_not_available")
- elif type(e) is TorErrorGettingBridges:
- return strings._("error_getting_bridges")
-
return None
diff --git a/desktop/src/onionshare/resources/locale/en.json b/desktop/src/onionshare/resources/locale/en.json
index 73b35b2e..5a44cbb2 100644
--- a/desktop/src/onionshare/resources/locale/en.json
+++ b/desktop/src/onionshare/resources/locale/en.json
@@ -223,7 +223,6 @@
"error_port_not_available": "OnionShare port not available",
"history_receive_read_message_button": "Read Message",
"error_tor_protocol_error": "There was an error with Tor: {}",
- "error_getting_bridges": "Could not obtain bridges from the Tor API",
"moat_contact_label": "Contacting BridgeDB...",
"moat_captcha_label": "Solve the CAPTCHA to request a bridge.",
"moat_captcha_placeholder": "Enter the characters from the image",
diff --git a/desktop/src/onionshare/threads.py b/desktop/src/onionshare/threads.py
index c5f24017..b02c6f21 100644
--- a/desktop/src/onionshare/threads.py
+++ b/desktop/src/onionshare/threads.py
@@ -37,7 +37,6 @@ from onionshare_cli.onion import (
TorTooOldEphemeral,
TorTooOldStealth,
PortNotAvailable,
- TorErrorGettingBridges,
)
from . import strings
@@ -105,7 +104,6 @@ class OnionThread(QtCore.QThread):
TorTooOldEphemeral,
TorTooOldStealth,
PortNotAvailable,
- TorErrorGettingBridges,
) as e:
message = self.mode.common.gui.get_translated_tor_error(e)
self.error.emit(message)
diff --git a/desktop/src/onionshare/tor_connection.py b/desktop/src/onionshare/tor_connection.py
index 77218c1a..2cc599c4 100644
--- a/desktop/src/onionshare/tor_connection.py
+++ b/desktop/src/onionshare/tor_connection.py
@@ -36,7 +36,6 @@ from onionshare_cli.onion import (
TorTooOldEphemeral,
TorTooOldStealth,
PortNotAvailable,
- TorErrorGettingBridges,
)
from . import strings
@@ -311,7 +310,6 @@ class TorConnectionThread(QtCore.QThread):
TorTooOldEphemeral,
TorTooOldStealth,
PortNotAvailable,
- TorErrorGettingBridges,
) as e:
message = self.common.gui.get_translated_tor_error(e)
self.common.log(