Merge pull request #25 from PR0M3TH3AN/codex/push-backup-to-nostr-after-adding-entry

Backup to nostr after entry
This commit is contained in:
thePR0M3TH3AN
2025-06-29 15:12:13 -04:00
committed by GitHub

View File

@@ -736,11 +736,25 @@ class PasswordManager:
# Provide user feedback
print(
colored(
f"\n[+] Password generated and indexed with ID {index}.\n", "green"
f"\n[+] Password generated and indexed with ID {index}.\n",
"green",
)
)
print(colored(f"Password for {website_name}: {password}\n", "yellow"))
# Automatically push the updated encrypted index to Nostr so the
# latest changes are backed up remotely.
try:
encrypted_data = self.get_encrypted_data()
if encrypted_data:
self.nostr_client.publish_json_to_nostr(encrypted_data)
logging.info(
"Encrypted index posted to Nostr after entry addition."
)
except Exception as nostr_error:
logging.error(f"Failed to post updated index to Nostr: {nostr_error}")
logging.error(traceback.format_exc())
except Exception as e:
logging.error(f"Error during password generation: {e}")
logging.error(traceback.format_exc())