at 22.05-pre 41 lines 2.0 kB view raw
1--- a/onionshare_cli/common.py 2+++ b/onionshare_cli/common.py 3@@ -308,33 +308,10 @@ class Common: 4 return path 5 6 def get_tor_paths(self): 7- if self.platform == "Linux": 8- tor_path = shutil.which("tor") 9- if not tor_path: 10- raise CannotFindTor() 11- obfs4proxy_file_path = shutil.which("obfs4proxy") 12- prefix = os.path.dirname(os.path.dirname(tor_path)) 13- tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip") 14- tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6") 15- elif self.platform == "Windows": 16- base_path = self.get_resource_path("tor") 17- tor_path = os.path.join(base_path, "Tor", "tor.exe") 18- obfs4proxy_file_path = os.path.join(base_path, "Tor", "obfs4proxy.exe") 19- tor_geo_ip_file_path = os.path.join(base_path, "Data", "Tor", "geoip") 20- tor_geo_ipv6_file_path = os.path.join(base_path, "Data", "Tor", "geoip6") 21- elif self.platform == "Darwin": 22- tor_path = shutil.which("tor") 23- if not tor_path: 24- raise CannotFindTor() 25- obfs4proxy_file_path = shutil.which("obfs4proxy") 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- elif self.platform == "BSD": 30- tor_path = "/usr/local/bin/tor" 31- tor_geo_ip_file_path = "/usr/local/share/tor/geoip" 32- tor_geo_ipv6_file_path = "/usr/local/share/tor/geoip6" 33- obfs4proxy_file_path = "/usr/local/bin/obfs4proxy" 34+ tor_path = "@tor@/bin/tor" 35+ tor_geo_ip_file_path = "@geoip@/share/tor/geoip" 36+ tor_geo_ipv6_file_path = "@geoip@/share/tor/geoip6" 37+ obfs4proxy_file_path = "@obfs4@/bin/obfs4proxy" 38 39 return ( 40 tor_path, 41