From a1b44105e491504d5904ed00edd48ed3b6f0a5b9 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 6 Jul 2025 17:56:42 -0400 Subject: [PATCH] Sync from Nostr on profile selection --- README.md | 3 ++- src/password_manager/manager.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8677c07..587381a 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,8 @@ python scripts/generate_test_profile.py --profile demo_profile --count 100 The script now determines the fingerprint from the generated seed and stores the vault under `~/.seedpass/`. It also prints the fingerprint after creation and publishes the encrypted index to Nostr. Use that same seed phrase -to load SeedPass so it can automatically retrieve the data from Nostr. +to load SeedPass. The app checks Nostr on startup and pulls any newer snapshot +so your vault stays in sync across machines. ### Automatically Updating the Script Checksum diff --git a/src/password_manager/manager.py b/src/password_manager/manager.py index 536cde7..cb76a02 100644 --- a/src/password_manager/manager.py +++ b/src/password_manager/manager.py @@ -302,7 +302,7 @@ class PasswordManager: # Initialize BIP85 and other managers self.initialize_bip85() self.initialize_managers() - self.sync_index_from_nostr_if_missing() + self.sync_index_from_nostr() print( colored( f"Seed profile {fingerprint} selected and managers initialized.", @@ -432,7 +432,7 @@ class PasswordManager: # Initialize BIP85 and other managers self.initialize_bip85() self.initialize_managers() - self.sync_index_from_nostr_if_missing() + self.sync_index_from_nostr() print(colored(f"Switched to seed profile {selected_fingerprint}.", "green")) # Re-initialize NostrClient with the new fingerprint @@ -616,7 +616,7 @@ class PasswordManager: self.initialize_bip85() self.initialize_managers() - self.sync_index_from_nostr_if_missing() + self.sync_index_from_nostr() return fingerprint # Return the generated or added fingerprint else: logging.error("Invalid BIP-85 seed phrase. Exiting.") @@ -757,7 +757,7 @@ class PasswordManager: self.initialize_bip85() self.initialize_managers() - self.sync_index_from_nostr_if_missing() + self.sync_index_from_nostr() except Exception as e: logging.error(f"Failed to encrypt and save parent seed: {e}", exc_info=True) print(colored(f"Error: Failed to encrypt and save parent seed: {e}", "red"))