Allow selecting a snowflake bridge, and make it try to use the snowflake bridge

This commit is contained in:
Micah Lee 2021-10-13 21:11:56 -07:00
parent 1244f56d26
commit 3ea92d6bad
7 changed files with 98 additions and 32 deletions

View file

@ -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()