ensure bootstrap is always added if enabled, work on site creator

master
Kevin Froman 2019-11-05 05:29:15 -06:00
parent 9fa05d6e1f
commit bc37fc0e95
4 changed files with 9 additions and 6 deletions

View File

@ -12,3 +12,4 @@
* make node "speed" setting such as when ui is open to reduce bandwidth usage
* localization support
* add BCC support to mail
* prevent local insertion success of duplicate block content

View File

@ -177,6 +177,9 @@ class OnionrCommunicatorDaemon:
lookup_blocks_timer = (lookup_blocks_timer.frequency - 2)
shared_state.add(self)
if config.get('general.use_bootstrap', True):
bootstrappeers.add_bootstrap_list_to_peer_list(self, [], db_only=True)
# Main daemon loop, mainly for calling timers, don't do any complex operations here to avoid locking
try:

View File

@ -20,11 +20,12 @@
from utils import readstatic, gettransports
from coredb import keydb
bootstrap_peers = readstatic.read_static('bootstrap-nodes.txt').split(',')
def add_bootstrap_list_to_peer_list(comm_inst, peerList):
def add_bootstrap_list_to_peer_list(comm_inst, peerList, db_only=False):
'''
Add the bootstrap list to the peer list (no duplicates)
'''
for i in bootstrap_peers:
if i not in peerList and i not in comm_inst.offlinePeers and not i in gettransports.get() and len(str(i).strip()) > 0:
peerList.append(i)
if not db_only: peerList.append(i)
keydb.addkeys.add_address(i)

View File

@ -17,10 +17,8 @@ def create_multipage_site():
except IndexError:
logger.warn('''It is critical that this passphrase is long.
If you want to update your site later you must remember the passphrase.''', terminal=True)
logger.info(f'Please enter a site passphrase of at least {onionrvalues.PASSWORD_LENGTH} characters.', terminal=True)
passphrase = getpass.getpass()
logger.info('Confirm:', terminal=True)
confirm = getpass.getpass()
passphrase = getpass.getpass(f'Please enter a site passphrase of at least {onionrvalues.PASSWORD_LENGTH} characters.')
confirm = getpass.getpass('Confirm passphrase:')
if passphrase != confirm:
logger.error('Passphrases do not match', terminal=True)
error_encountered = True