Backup index to Nostr after password change

This commit is contained in:
thePR0M3TH3AN
2025-06-29 22:16:36 -04:00
parent 2e84d478b6
commit ec1bda7ef5
2 changed files with 59 additions and 0 deletions

View File

@@ -1202,6 +1202,19 @@ class PasswordManager:
)
print(colored("Master password changed successfully.", "green"))
# Automatically push the newly re-encrypted index to Nostr so the
# latest state is backed up remotely after a password change.
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 password change."
)
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"Failed to change password: {e}")
logging.error(traceback.format_exc())