mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 22:45:03 -04:00
Allow selecting a snowflake bridge, and make it try to use the snowflake bridge
This commit is contained in:
parent
f2dbc97285
commit
39d624e923
7 changed files with 98 additions and 32 deletions
|
@ -312,6 +312,9 @@ class Common:
|
|||
# Look in resources first
|
||||
base_path = self.get_resource_path("tor")
|
||||
if os.path.exists(base_path):
|
||||
self.log(
|
||||
"Common", "get_tor_paths", f"using tor binaries in {base_path}"
|
||||
)
|
||||
tor_path = os.path.join(base_path, "tor")
|
||||
tor_geo_ip_file_path = os.path.join(base_path, "geoip")
|
||||
tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
|
||||
|
@ -319,6 +322,9 @@ class Common:
|
|||
snowflake_file_path = os.path.join(base_path, "snowflake-client")
|
||||
else:
|
||||
# Fallback to looking in the path
|
||||
self.log(
|
||||
"Common", "get_tor_paths", f"using tor binaries in system path"
|
||||
)
|
||||
tor_path = shutil.which("tor")
|
||||
if not tor_path:
|
||||
raise CannotFindTor()
|
||||
|
|
|
@ -326,6 +326,11 @@ class Onion(object):
|
|||
) as o:
|
||||
for line in o:
|
||||
f.write(line)
|
||||
elif self.settings.get("tor_bridges_use_snowflake"):
|
||||
# Taken from: tor-browser_en-US/Browser/TorBrowser/Data/Tor/torrc-defaults
|
||||
f.write(
|
||||
f"ClientTransportPlugin snowflake exec {self.snowflake_file_path} -url https://snowflake-broker.torproject.net.global.prod.fastly.net/ -front cdn.sstatic.net -ice stun:stun.l.google.com:19302,stun:stun.voip.blackberry.com:3478,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478\n"
|
||||
)
|
||||
|
||||
if self.settings.get("tor_bridges_use_custom_bridges"):
|
||||
if "obfs4" in self.settings.get("tor_bridges_use_custom_bridges"):
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
Bridge meek_lite 0.0.2.0:2 B9E7141C594AF25699E0079C1F0146F409495296 url=https://d2cly7j4zqgua7.cloudfront.net/ front=a0.awsstatic.com
|
||||
UseBridges 1
|
|
@ -108,6 +108,7 @@ class Settings(object):
|
|||
"no_bridges": True,
|
||||
"tor_bridges_use_obfs4": False,
|
||||
"tor_bridges_use_meek_lite_azure": False,
|
||||
"tor_bridges_use_snowflake": False,
|
||||
"tor_bridges_use_custom_bridges": "",
|
||||
"persistent_tabs": [],
|
||||
"locale": None, # this gets defined in fill_in_defaults()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue