Passdora: Implement Restore Routine

Words
318
Reading
2 min
Listen
Play
9y

We implemented a new feature for our PASSDORA Box. Passdora is a Raspberry Pi based system which hosts the Sequry password-manager.

Passdora

New Features

What feature(s) did you add?

The Passdora system offers a function to create backups, so the users' data isn't lost if the system drive fails or some other fault causes data loss. So far the files saved in a backup had to be copied back onto a new system manually. Since the backup is encrypted, compressed, contains a lot of files and even a database dump, the manual restore is too complex for a regular user. In order to simplify that process, a feature should be added that only requires a backup file and the key used for encryption to restore the system back to the state of that backup.

Reasons
  • system needs a function to restore backups
  • manually restoring a backup is too complex
    • automation required

How did you implement it/them?

  • add a dialog that asks for a backup file and it's restore-key:

    • bin/js/controls/RestoreDialog.css [link]
    • bin/js/controls/RestoreDialog.html [link]
    • bin/js/controls/RestoreDialog.js [link]
  • upload the backup to the system

  • try to decrypt the backup with the given restore-key

    • ajax/processRestoreFile.php [link]
  • copy the files in the backup-archive to their correct location

    • in repository sequry/passdora: Build_Image/files/passdora_scripts/lib/autostart/RestoreListener.py [link]
  • restore the database

    • in repository sequry/passdora: Build_Image/files/passdora_scripts/lib/autostart/RestoreListener.py [link]
  • restart the system

    • in repository sequry/passdora: Build_Image/files/passdora_scripts/lib/autostart/RestoreListener.py [link]

Since the commits unfortunately overlap, a nice log cannot be created :(.
I tried to specify the files that were affected, you can find a link behind every file name.

A complete commit log can you find [here]

Preview

as always, a picture says more than 1000 words

Asking for backup-file:

Asking for backup-file's restore-key:

System-Restore successfully initialized:

Allow the user to abort the system-restore:

Thanks for reading,
Jan, for PCSG Developers



Posted on Utopian.io - Rewarding Open Source Contributors

Passdora: Implement Restore Routine | Ecency