Sync from Nostr on profile selection

This commit is contained in:
thePR0M3TH3AN
2025-07-06 17:56:42 -04:00
parent f85968afa9
commit a1b44105e4
2 changed files with 6 additions and 5 deletions

View File

@@ -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 The script now determines the fingerprint from the generated seed and stores the
vault under `~/.seedpass/<fingerprint>`. It also prints the fingerprint after vault under `~/.seedpass/<fingerprint>`. It also prints the fingerprint after
creation and publishes the encrypted index to Nostr. Use that same seed phrase 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 ### Automatically Updating the Script Checksum

View File

@@ -302,7 +302,7 @@ class PasswordManager:
# Initialize BIP85 and other managers # Initialize BIP85 and other managers
self.initialize_bip85() self.initialize_bip85()
self.initialize_managers() self.initialize_managers()
self.sync_index_from_nostr_if_missing() self.sync_index_from_nostr()
print( print(
colored( colored(
f"Seed profile {fingerprint} selected and managers initialized.", f"Seed profile {fingerprint} selected and managers initialized.",
@@ -432,7 +432,7 @@ class PasswordManager:
# Initialize BIP85 and other managers # Initialize BIP85 and other managers
self.initialize_bip85() self.initialize_bip85()
self.initialize_managers() 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")) print(colored(f"Switched to seed profile {selected_fingerprint}.", "green"))
# Re-initialize NostrClient with the new fingerprint # Re-initialize NostrClient with the new fingerprint
@@ -616,7 +616,7 @@ class PasswordManager:
self.initialize_bip85() self.initialize_bip85()
self.initialize_managers() self.initialize_managers()
self.sync_index_from_nostr_if_missing() self.sync_index_from_nostr()
return fingerprint # Return the generated or added fingerprint return fingerprint # Return the generated or added fingerprint
else: else:
logging.error("Invalid BIP-85 seed phrase. Exiting.") logging.error("Invalid BIP-85 seed phrase. Exiting.")
@@ -757,7 +757,7 @@ class PasswordManager:
self.initialize_bip85() self.initialize_bip85()
self.initialize_managers() self.initialize_managers()
self.sync_index_from_nostr_if_missing() self.sync_index_from_nostr()
except Exception as e: except Exception as e:
logging.error(f"Failed to encrypt and save parent seed: {e}", exc_info=True) 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")) print(colored(f"Error: Failed to encrypt and save parent seed: {e}", "red"))