mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 14:36:15 -04:00
Find the proper tor binary in onionshare-cli for macOS
This commit is contained in:
parent
2fecbc5745
commit
61db0b6eae
2 changed files with 24 additions and 11 deletions
|
@ -93,17 +93,26 @@ class Common:
|
|||
tor_geo_ip_file_path = os.path.join(base_path, "Data", "Tor", "geoip")
|
||||
tor_geo_ipv6_file_path = os.path.join(base_path, "Data", "Tor", "geoip6")
|
||||
elif self.platform == "Darwin":
|
||||
base_path = os.path.dirname(
|
||||
os.path.dirname(os.path.dirname(self.get_resource_path("")))
|
||||
)
|
||||
tor_path = os.path.join(base_path, "Resources", "Tor", "tor")
|
||||
tor_geo_ip_file_path = os.path.join(base_path, "Resources", "Tor", "geoip")
|
||||
tor_geo_ipv6_file_path = os.path.join(
|
||||
base_path, "Resources", "Tor", "geoip6"
|
||||
)
|
||||
obfs4proxy_file_path = os.path.join(
|
||||
base_path, "Resources", "Tor", "obfs4proxy"
|
||||
)
|
||||
if os.path.basename(sys.argv[0]) == "onionshare-cli":
|
||||
tor_path = shutil.which("tor")
|
||||
obfs4proxy_file_path = shutil.which("obfs4proxy")
|
||||
prefix = os.path.dirname(os.path.dirname(tor_path))
|
||||
tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip")
|
||||
tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6")
|
||||
else:
|
||||
base_path = os.path.dirname(
|
||||
os.path.dirname(os.path.dirname(self.get_resource_path("")))
|
||||
)
|
||||
tor_path = os.path.join(base_path, "Resources", "Tor", "tor")
|
||||
tor_geo_ip_file_path = os.path.join(
|
||||
base_path, "Resources", "Tor", "geoip"
|
||||
)
|
||||
tor_geo_ipv6_file_path = os.path.join(
|
||||
base_path, "Resources", "Tor", "geoip6"
|
||||
)
|
||||
obfs4proxy_file_path = os.path.join(
|
||||
base_path, "Resources", "Tor", "obfs4proxy"
|
||||
)
|
||||
elif self.platform == "BSD":
|
||||
tor_path = "/usr/local/bin/tor"
|
||||
tor_geo_ip_file_path = "/usr/local/share/tor/geoip"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue