Added an automatic migration system for notes before the #1 redesign.
Ths system works as follows:
1. Checks the password system used.
2. If it's the old system, the migration is started.
3. The data directory is backed up.
4. The notes are decrypted using the old password.
5. The notes are encrypted and saved using the `KDF(password)`
This commit also adds documentation related to future migrations of the "password system" and which migrations will be supported by each future version.
This documents also showcases that when v1 is released, support for `PasswordSystem::V0` will be completely removed.
Closes#1.
The password is hashed using Argon2, with the salt being `SHA256(password)`. The output hash is then encoded using hex.
The password-checking function checks if the "note database" is encrypted using the plain password (and returns it) or if it is encrypted using the hashed+salted password (and returns the value). This allows older databases to work properly.
A migration path may be added in the future.
* implemented "hide notes"
* implemented "show notes" (internally "unhide")
* improved the title and metadata renderer to use enums and return values instead of callbacks
* added system to retry on password fails (adds `native-dialog` dep for convenience)
This adds a weird callback-based system to properly update the state once a note is removed.
This system isn't very nice, and it can be quite messy, but I'll improve it in the future
This is an initial release, I'm aware that this doesn't have the best structure and that there's lots of copying, but performance isn't relevant right now