diff --git a/src/etc/onionrvalues.py b/src/etc/onionrvalues.py index 26f08951..10a90307 100755 --- a/src/etc/onionrvalues.py +++ b/src/etc/onionrvalues.py @@ -23,7 +23,7 @@ import filepaths DENIABLE_PEER_ADDRESS = "OVPCZLOXD6DC5JHX4EQ3PSOGAZ3T24F75HQLIUZSDSMYPEOXCPFA" PASSWORD_LENGTH = 25 ONIONR_TAGLINE = 'Private P2P Communication - GPLv3 - https://Onionr.net' -ONIONR_VERSION = '3.0.0' +ONIONR_VERSION = '3.1.0' ONIONR_VERSION_CODENAME = 'Genesis' 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. diff --git a/src/netcontroller/torcontrol/__init__.py b/src/netcontroller/torcontrol/__init__.py index 6fca8809..2a31bc92 100644 --- a/src/netcontroller/torcontrol/__init__.py +++ b/src/netcontroller/torcontrol/__init__.py @@ -21,6 +21,7 @@ from . import gentorrc from . import addbridges from . import torbinary from utils import identifyhome +from utils import box_print """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,9 +42,7 @@ addbridges = addbridges.add_bridges class NetController: - """ - This class handles hidden service setup on Tor - """ + """Handle Tor daemon and onion service setup on Tor.""" def __init__(self, hsPort, apiServerIP='127.0.0.1'): # set data dir @@ -90,6 +89,12 @@ class NetController: # wait for tor to get to 100% bootstrap try: for line in iter(tor.stdout.readline, b''): + for word in ('bootstrapped', '%'): + if word not in line.decode().lower(): + break + else: + if '100' not in line.decode(): + logger.info(line.decode().strip(), terminal=True) if 'bootstrapped 100' in line.decode().lower(): logger.info(line.decode()) break @@ -110,6 +115,7 @@ class NetController: return False logger.info('Finished starting Tor.', terminal=True) + logger.info('Connecting to Onionr soon', terminal=True) self.readyState = True diff --git a/src/utils/__init__.py b/src/utils/__init__.py index e69de29b..359a6c24 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -0,0 +1 @@ +from .boxprint import bordered as box_print \ No newline at end of file diff --git a/src/utils/boxprint.py b/src/utils/boxprint.py new file mode 100644 index 00000000..9f37426e --- /dev/null +++ b/src/utils/boxprint.py @@ -0,0 +1,8 @@ +def bordered(text): + lines = text.splitlines() + width = max(len(s) for s in lines) + res = ['┌' + '─' * width + '┐'] + for s in lines: + res.append('│' + (s + ' ' * width)[:width] + '│') + res.append('└' + '─' * width + '┘') + return '\n'.join(res) \ No newline at end of file