nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1--- a/onionshare/gui_common.py
2+++ b/onionshare/gui_common.py
3@@ -482,52 +482,12 @@ class GuiCommon:
4 }
5
6 def get_tor_paths(self):
7- if self.common.platform == "Linux":
8- base_path = self.get_resource_path("tor")
9- if base_path and os.path.isdir(base_path):
10- self.common.log(
11- "GuiCommon", "get_tor_paths", "using paths in resources"
12- )
13- tor_path = os.path.join(base_path, "tor")
14- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
15- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
16- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
17- snowflake_file_path = os.path.join(base_path, "snowflake-client")
18- meek_client_file_path = os.path.join(base_path, "meek-client")
19- else:
20- # Fallback to looking in the path
21- self.common.log("GuiCommon", "get_tor_paths", "using paths from PATH")
22- tor_path = shutil.which("tor")
23- obfs4proxy_file_path = shutil.which("obfs4proxy")
24- snowflake_file_path = shutil.which("snowflake-client")
25- meek_client_file_path = shutil.which("meek-client")
26- prefix = os.path.dirname(os.path.dirname(tor_path))
27- tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip")
28- tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6")
29-
30- if self.common.platform == "Windows":
31- base_path = self.get_resource_path("tor")
32- tor_path = os.path.join(base_path, "tor.exe")
33- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy.exe")
34- snowflake_file_path = os.path.join(base_path, "snowflake-client.exe")
35- meek_client_file_path = os.path.join(base_path, "meek-client.exe")
36- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
37- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
38- elif self.common.platform == "Darwin":
39- base_path = self.get_resource_path("tor")
40- tor_path = os.path.join(base_path, "tor")
41- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
42- snowflake_file_path = os.path.join(base_path, "snowflake-client")
43- meek_client_file_path = os.path.join(base_path, "meek-client")
44- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
45- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
46- elif self.common.platform == "BSD":
47- tor_path = "/usr/local/bin/tor"
48- tor_geo_ip_file_path = "/usr/local/share/tor/geoip"
49- tor_geo_ipv6_file_path = "/usr/local/share/tor/geoip6"
50- obfs4proxy_file_path = "/usr/local/bin/obfs4proxy"
51- meek_client_file_path = "/usr/local/bin/meek-client"
52- snowflake_file_path = "/usr/local/bin/snowflake-client"
53+ tor_path = "@tor@/bin/tor"
54+ tor_geo_ip_file_path = "@geoip@/share/tor/geoip"
55+ tor_geo_ipv6_file_path = "@geoip@/share/tor/geoip6"
56+ obfs4proxy_file_path = "@obfs4@/bin/obfs4proxy"
57+ meek_client_file_path = "@meek@/bin/meek-client"
58+ snowflake_file_path = "@snowflake@/bin/snowflake-client"
59
60 return (
61 tor_path,