Add QR code for private key, update tests

This commit is contained in:
Miguel Jacq 2023-10-09 15:54:19 +11:00
parent 400460f7c9
commit 9b859b9d08
4 changed files with 65 additions and 83 deletions

View file

@ -394,7 +394,13 @@ def main(cwd=None):
if mode_settings.get("general", "qr"):
qr = QRCode()
qr.add_data(url)
print("Onion address as QR code:")
qr.print_ascii()
if not mode_settings.get("general", "public"):
qr.clear()
qr.add_data(app.auth_string)
print("Private key as QR code:")
qr.print_ascii()
print("")
print("Waiting for the scheduled time before starting...")
app.onion.cleanup(False)
@ -481,7 +487,13 @@ def main(cwd=None):
if mode_settings.get("general", "qr"):
qr = QRCode()
qr.add_data(url)
print("Onion address as QR code:")
qr.print_ascii()
if not mode_settings.get("general", "public"):
qr.clear()
qr.add_data(app.auth_string)
print("Private key as QR code:")
qr.print_ascii()
print("")
print("Press Ctrl+C to stop the server")