mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-01 02:46:22 -04:00
try and fix tests
This commit is contained in:
parent
dfac27fe84
commit
90807727c8
3 changed files with 6 additions and 3 deletions
|
@ -414,13 +414,13 @@ class Onion(object):
|
||||||
|
|
||||||
self.service_id = res.content()[0][2].split('=')[1]
|
self.service_id = res.content()[0][2].split('=')[1]
|
||||||
onion_host = self.service_id + '.onion'
|
onion_host = self.service_id + '.onion'
|
||||||
private_key = res.private_key
|
self.private_key = res.private_key
|
||||||
|
|
||||||
if self.stealth:
|
if self.stealth:
|
||||||
auth_cookie = res.content()[2][2].split('=')[1].split(':')[1]
|
auth_cookie = res.content()[2][2].split('=')[1].split(':')[1]
|
||||||
self.auth_string = 'HidServAuth {} {}'.format(onion_host, auth_cookie)
|
self.auth_string = 'HidServAuth {} {}'.format(onion_host, auth_cookie)
|
||||||
|
|
||||||
return (onion_host, private_key)
|
return onion_host
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -76,7 +76,9 @@ class OnionShare(object):
|
||||||
if self.shutdown_timeout > 0:
|
if self.shutdown_timeout > 0:
|
||||||
self.shutdown_timer = common.close_after_seconds(self.shutdown_timeout)
|
self.shutdown_timer = common.close_after_seconds(self.shutdown_timeout)
|
||||||
|
|
||||||
self.onion_host, self.private_key = self.onion.start_onion_service(self.port)
|
self.onion_host = self.onion.start_onion_service(self.port)
|
||||||
|
|
||||||
|
self.private_key = self.onion.private_key
|
||||||
|
|
||||||
if self.stealth:
|
if self.stealth:
|
||||||
self.auth_string = self.onion.auth_string
|
self.auth_string = self.onion.auth_string
|
||||||
|
|
|
@ -27,6 +27,7 @@ from onionshare import OnionShare
|
||||||
class MyOnion:
|
class MyOnion:
|
||||||
def __init__(self, stealth=False):
|
def __init__(self, stealth=False):
|
||||||
self.auth_string = 'TestHidServAuth'
|
self.auth_string = 'TestHidServAuth'
|
||||||
|
self.private_key = ''
|
||||||
self.stealth = stealth
|
self.stealth = stealth
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue