mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Update patch as per the suggestion by @mig5 on
https://github.com/micahflee/onionshare/pull/585 Tested on current snapshot, both gui and cli work
This commit is contained in:
parent
ae494c8e33
commit
bc8f233db9
@ -131,7 +131,7 @@ class Onion(object):
|
|||||||
self.stealth = False
|
self.stealth = False
|
||||||
self.service_id = None
|
self.service_id = None
|
||||||
|
|
||||||
self.system = platform.system()
|
self.system = common.get_platform()
|
||||||
|
|
||||||
# Is bundled tor supported?
|
# Is bundled tor supported?
|
||||||
if (self.system == 'Windows' or self.system == 'Darwin') and getattr(sys, 'onionshare_dev_mode', False):
|
if (self.system == 'Windows' or self.system == 'Darwin') and getattr(sys, 'onionshare_dev_mode', False):
|
||||||
@ -183,7 +183,7 @@ class Onion(object):
|
|||||||
raise OSError(strings._('no_available_port'))
|
raise OSError(strings._('no_available_port'))
|
||||||
self.tor_torrc = os.path.join(self.tor_data_directory.name, 'torrc')
|
self.tor_torrc = os.path.join(self.tor_data_directory.name, 'torrc')
|
||||||
else:
|
else:
|
||||||
# Linux and Mac can use unix sockets
|
# Linux, Mac and BSD can use unix sockets
|
||||||
with open(common.get_resource_path('torrc_template')) as f:
|
with open(common.get_resource_path('torrc_template')) as f:
|
||||||
torrc_template = f.read()
|
torrc_template = f.read()
|
||||||
self.tor_control_port = None
|
self.tor_control_port = None
|
||||||
@ -316,8 +316,7 @@ class Onion(object):
|
|||||||
# guessing the socket file name next
|
# guessing the socket file name next
|
||||||
if not found_tor:
|
if not found_tor:
|
||||||
try:
|
try:
|
||||||
plat = common.get_platform()
|
if self.system == 'Linux' or self.system == 'BSD':
|
||||||
if plat == 'Linux' or plat == 'BSD':
|
|
||||||
socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())
|
socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())
|
||||||
elif self.system == 'Darwin':
|
elif self.system == 'Darwin':
|
||||||
socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())
|
socket_file_path = '/run/user/{}/Tor/control.socket'.format(os.geteuid())
|
||||||
|
Loading…
Reference in New Issue
Block a user