Move users to use phrase system for sites as well

master
Kevin Froman 2020-09-15 18:12:39 +00:00
parent c0ebfec034
commit 5b3d76067a
1 changed files with 4 additions and 8 deletions

View File

@ -6,6 +6,8 @@ import sys
import os import os
import getpass import getpass
from niceware import generate_passphrase
from httpapi import onionrsitesapi from httpapi import onionrsitesapi
import logger import logger
from etc import onionrvalues from etc import onionrvalues
@ -42,14 +44,8 @@ def create_multipage_site():
If you want to update your site later you must remember the passphrase.''', If you want to update your site later you must remember the passphrase.''',
terminal=True) terminal=True)
passphrase = getpass.getpass( passphrase = "-".join(generate_passphrase(32))
'Please enter a site passphrase of at least ' + print("Site restore phrase:", passphrase)
str(onionrvalues.PASSWORD_LENGTH) + ' characters.')
confirm = getpass.getpass('Confirm passphrase:')
if passphrase != confirm:
logger.error('Passphrases do not match', terminal=True)
error_encountered = True
if len(passphrase) < onionrvalues.PASSWORD_LENGTH: if len(passphrase) < onionrvalues.PASSWORD_LENGTH:
error_encountered = True error_encountered = True