do not start lan on qubes
parent
feb8004c95
commit
87b8655b83
|
@ -78,4 +78,3 @@ def daemon_event_handlers(shared_state: 'TooMany'):
|
||||||
events_api.register_listener(print_test)
|
events_api.register_listener(print_test)
|
||||||
events_api.register_listener(upload_event)
|
events_api.register_listener(upload_event)
|
||||||
events_api.register_listener(test_runtime)
|
events_api.register_listener(test_runtime)
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,8 @@ class UploadQueue:
|
||||||
self.communicator = communicator
|
self.communicator = communicator
|
||||||
cache: deadsimplekv.DeadSimpleKV = deadsimplekv.DeadSimpleKV(
|
cache: deadsimplekv.DeadSimpleKV = deadsimplekv.DeadSimpleKV(
|
||||||
UPLOAD_MEMORY_FILE)
|
UPLOAD_MEMORY_FILE)
|
||||||
self.kv: "DeadSimpleKV" = communicator.shared_state.get_by_string("DeadSimpleKV")
|
self.kv: "DeadSimpleKV" = \
|
||||||
|
communicator.shared_state.get_by_string("DeadSimpleKV")
|
||||||
self.store_obj = cache
|
self.store_obj = cache
|
||||||
cache = cache.get('uploads')
|
cache = cache.get('uploads')
|
||||||
if cache is None:
|
if cache is None:
|
||||||
|
|
|
@ -29,6 +29,7 @@ ONIONR_VERSION_TUPLE = tuple(ONIONR_VERSION.split('.')) # (MAJOR, MINOR, VERSION
|
||||||
API_VERSION = '1' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you.
|
API_VERSION = '1' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you.
|
||||||
MIN_PY_VERSION = 7 # min version of 7 so we can take advantage of non-cyclic type hints
|
MIN_PY_VERSION = 7 # min version of 7 so we can take advantage of non-cyclic type hints
|
||||||
DEVELOPMENT_MODE = False
|
DEVELOPMENT_MODE = False
|
||||||
|
IS_QUBES = False
|
||||||
"""limit type length for a block (soft enforced, ignored if invalid but block still stored)."""
|
"""limit type length for a block (soft enforced, ignored if invalid but block still stored)."""
|
||||||
MAX_BLOCK_TYPE_LENGTH = 15
|
MAX_BLOCK_TYPE_LENGTH = 15
|
||||||
"""limit clock timestamp for new blocks to be skewed in the future in seconds,
|
"""limit clock timestamp for new blocks to be skewed in the future in seconds,
|
||||||
|
@ -74,3 +75,5 @@ else:
|
||||||
SCRIPT_NAME = 'start-daemon.sh'
|
SCRIPT_NAME = 'start-daemon.sh'
|
||||||
else:
|
else:
|
||||||
SCRIPT_NAME = 'onionr.sh'
|
SCRIPT_NAME = 'onionr.sh'
|
||||||
|
if 'qubes' in platform.release().lower():
|
||||||
|
IS_QUBES = True
|
||||||
|
|
|
@ -160,3 +160,11 @@ class PrivateEndpoints:
|
||||||
'generating_blocks'
|
'generating_blocks'
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@private_endpoints_bp.route('/getblockstoupload')
|
||||||
|
def get_blocks_to_upload() -> Response:
|
||||||
|
return Response(
|
||||||
|
','.join(
|
||||||
|
g.too_many.get_by_string('DeadSimpleKV').get('blocksToUpload')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
|
@ -101,8 +101,8 @@ def insert_block(data: Union[str, bytes], header: str = 'txt',
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
# record nonce
|
# record nonce
|
||||||
with open(filepaths.data_nonce_file, 'a') as nonceFile:
|
with open(filepaths.data_nonce_file, 'a') as nonce_file:
|
||||||
nonceFile.write(dataNonce + '\n')
|
nonce_file.write(dataNonce + '\n')
|
||||||
|
|
||||||
plaintext = data
|
plaintext = data
|
||||||
plaintextMeta = {}
|
plaintextMeta = {}
|
||||||
|
@ -263,7 +263,8 @@ def insert_block(data: Union[str, bytes], header: str = 'txt',
|
||||||
'/daemon-event/remove_from_insert_queue_wrapper',
|
'/daemon-event/remove_from_insert_queue_wrapper',
|
||||||
post=True,
|
post=True,
|
||||||
post_data={'block_hash':
|
post_data={'block_hash':
|
||||||
bytesconverter.bytes_to_str(crypto.hashers.sha3_hash(data))},
|
bytesconverter.bytes_to_str(
|
||||||
|
crypto.hashers.sha3_hash(data))},
|
||||||
is_json=True
|
is_json=True
|
||||||
).get(timeout=5)
|
).get(timeout=5)
|
||||||
return retData
|
return retData
|
||||||
|
|
|
@ -184,13 +184,17 @@ def daemon():
|
||||||
events.event('init', threaded=False)
|
events.event('init', threaded=False)
|
||||||
events.event('daemon_start')
|
events.event('daemon_start')
|
||||||
if config.get('transports.lan', True):
|
if config.get('transports.lan', True):
|
||||||
|
if not onionrvalues.IS_QUBES:
|
||||||
Thread(target=LANServer(shared_state).start_server,
|
Thread(target=LANServer(shared_state).start_server,
|
||||||
daemon=True).start()
|
daemon=True).start()
|
||||||
LANManager(shared_state).start()
|
LANManager(shared_state).start()
|
||||||
|
else:
|
||||||
|
logger.warn('LAN not supported on Qubes', terminal=True)
|
||||||
if config.get('transports.sneakernet', True):
|
if config.get('transports.sneakernet', True):
|
||||||
Thread(target=sneakernet_import_thread, daemon=True).start()
|
Thread(target=sneakernet_import_thread, daemon=True).start()
|
||||||
|
|
||||||
Thread(target=statistics_reporter, args=[shared_state], daemon=True).start()
|
Thread(target=statistics_reporter,
|
||||||
|
args=[shared_state], daemon=True).start()
|
||||||
|
|
||||||
shared_state.get(DeadSimpleKV).put(
|
shared_state.get(DeadSimpleKV).put(
|
||||||
'proxyPort', net.socksPort)
|
'proxyPort', net.socksPort)
|
||||||
|
|
Loading…
Reference in New Issue