-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Milestone
Description
Object
- We want the CLI to be able to backup a darknode from its current status to a single file with password encryption.
- We want the CLI to be able to restore a darknode from the backup file by providing the correct password.
These will give us the ability to migrate darknode to another VPS.
Design
We'll introduce a new command backup to backup the current status of a darknode.
It should take a string parameter which is the darknode name and
- SSH into the darknode and stop the darknode service.
- Create a copy for the database and config file
- Compress the files into a tarball and encrypt it using
openssl enccommand - Clean up those temporary files.
- Download the encrypted file to the provided location.
Reason we don't use zip is that it's not pre-installed in ubuntu. Source for using openssl
When restoring the backup, we can
- Integrate it with current
upcommand.
Or
- have a new
restorecommand.
We'll introduce a new flag which takes a backup file.
It should
- Check existence of the backup file and try to decrypt it with given password.
- Deploy the instance as normal
- Copy backup file to the instance.
- Extract files from the tarball.
- Setup service and start darknode as normal.
- Clean up
We should also let the user know the darknode will be stopped by running the backup command.
Discussion
- Do we want to have a new command when restoring the darknode?
- Do we want to restart the darknode service after finishing backup?
- Do we want to support batch operation for the
backupcommand? (i.e. allow--tagsoption)