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

View File

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