added customization options

This commit is contained in:
tcsenpai 2024-03-31 15:24:38 +02:00
parent de20dbb529
commit 32f3c8d413
2 changed files with 5 additions and 6 deletions

View File

@ -17,7 +17,7 @@ publicRSAKey = None
publicRSAPEM = None
# INFO Common entry point to authentication
def ensure():
def ensure(savekeys=True):
if(
os.path.exists("private.key")
):
@ -25,9 +25,9 @@ def ensure():
load()
else:
print("[ED25519] Creating ed25519 private key...")
create()
create(savekeys)
def create():
def create(savekeys=True):
global privateKey
global privateBytes
# ED25519 Creation
@ -45,7 +45,8 @@ def create():
# RSA Creation
derive()
# Writing file
save()
if savekeys:
save()
def load(filepath="./"):
global privateBytes

View File

@ -59,7 +59,6 @@ def main():
print("[MAIN CYCLE] Starting watchdog...")
was_connected = False
cooldownHeader = False
loading.start("[ eMesh Main Cycle is Running ")
while not ((os.getenv("FORCE_QUIT") == "True") or forceQuit):
# This is just a way to check if we need to notify the gui
are_connected = emesh.connected
@ -104,7 +103,6 @@ def main():
# print("[MAIN CYCLE] Sleeping complete. Proceeding to the next cycle...")
print("[MAIN CYCLE] Exiting main cycle...")
print("[SYSTEM] Exiting...")
loading.stop()
print("[SYSTEM] Ready to start.")