mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 00:09:50 -05:00
Allow setting a 'fake' ClientAuth in local-only mode - which will help with tests
This commit is contained in:
parent
ea4466262d
commit
cde46b676e
@ -74,6 +74,8 @@ class OnionShare(object):
|
|||||||
|
|
||||||
if self.local_only:
|
if self.local_only:
|
||||||
self.onion_host = f"127.0.0.1:{self.port}"
|
self.onion_host = f"127.0.0.1:{self.port}"
|
||||||
|
if mode_settings.get("general", "client_auth"):
|
||||||
|
self.auth_string = "E2GOT5LTUTP3OAMRCRXO4GSH6VKJEUOXZQUC336SRKAHTTT5OVSA"
|
||||||
return
|
return
|
||||||
|
|
||||||
self.onion_host = self.onion.start_onion_service(
|
self.onion_host = self.onion.start_onion_service(
|
||||||
|
@ -241,12 +241,15 @@ class Mode(QtWidgets.QWidget):
|
|||||||
def start_onion_thread(self, obtain_onion_early=False):
|
def start_onion_thread(self, obtain_onion_early=False):
|
||||||
# If we tried to start with Client Auth and our Tor is too old to support it,
|
# If we tried to start with Client Auth and our Tor is too old to support it,
|
||||||
# bail out early
|
# bail out early
|
||||||
if not self.app.onion.supports_stealth and self.settings.get("general", "client_auth"):
|
can_start = True
|
||||||
self.stop_server()
|
if (
|
||||||
self.start_server_error(
|
not self.server_status.local_only
|
||||||
strings._("gui_server_doesnt_support_stealth")
|
and not self.app.onion.supports_stealth
|
||||||
)
|
and self.settings.get("general", "client_auth")
|
||||||
else:
|
):
|
||||||
|
can_start = False
|
||||||
|
|
||||||
|
if can_start:
|
||||||
self.common.log("Mode", "start_server", "Starting an onion thread")
|
self.common.log("Mode", "start_server", "Starting an onion thread")
|
||||||
self.obtain_onion_early = obtain_onion_early
|
self.obtain_onion_early = obtain_onion_early
|
||||||
self.onion_thread = OnionThread(self)
|
self.onion_thread = OnionThread(self)
|
||||||
@ -255,6 +258,12 @@ class Mode(QtWidgets.QWidget):
|
|||||||
self.onion_thread.error.connect(self.starting_server_error.emit)
|
self.onion_thread.error.connect(self.starting_server_error.emit)
|
||||||
self.onion_thread.start()
|
self.onion_thread.start()
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.stop_server()
|
||||||
|
self.start_server_error(
|
||||||
|
strings._("gui_server_doesnt_support_stealth")
|
||||||
|
)
|
||||||
|
|
||||||
def start_scheduled_service(self, obtain_onion_early=False):
|
def start_scheduled_service(self, obtain_onion_early=False):
|
||||||
# We start a new OnionThread with the saved scheduled key from settings
|
# We start a new OnionThread with the saved scheduled key from settings
|
||||||
self.common.settings.load()
|
self.common.settings.load()
|
||||||
|
Loading…
Reference in New Issue
Block a user