diff --git a/README.md b/README.md index 13d158e..900e7e0 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ The setup wizard provides options for users to configure the package. These valu - `PUSHGATEWAY_USERNAME`: A username for the push gateway from above. - `PUSHGATEWAY_PASSWORD`: A password for the push gateway from above. +### Backup and Restore + +For information on backing up and restoring your Shutter API package data, see the [Backup and Restore Guide](backup_restore.md). + ### Developer notes Building the package requires docker and a vpn connection to a dappnode. It can be run with: diff --git a/backup_and_restore.md b/backup_and_restore.md new file mode 100644 index 0000000..56545c6 --- /dev/null +++ b/backup_and_restore.md @@ -0,0 +1,83 @@ +# Backup and Restore Guide + +This guide explains how to backup and restore your Shutter API DAppNode package data. + +## Backup Creation + +DAppNode provides a built-in backup functionality through the DAppNode UI. Users can create backup archives directly from the interface, which generates a compressed tar file that should be downloaded for safekeeping. + +### What Gets Backed Up + +The package automatically backs up the following critical data: + +- **Keyper Configuration** (`/keyper/config`): Contains your Shutter Keyper settings and configuration files +- **Chain Configuration** (`/chain/config`): Contains your Shutter Chain node configuration +- **Database Data** (`/var/lib/postgresql/data`): Contains the PostgreSQL database with your Keyper's state +- **Metrics Configuration** (`/config/user`): Contains your metrics service configuration + +### Creating a Backup + +1. Navigate to your DAppNode UI +2. Go to the Shutter API package +3. Click on the "Backup" option +4. Wait for the backup process to complete +5. Download the generated backup file to a secure location + +## Restore Process + +The restore process requires a two-step approach: + +### Step 1: Package Installation +The DAppNode package must be installed first through the DAppNode UI. This creates a fresh installation with default configuration. + +### Step 2: Backup Restoration +Once installation is complete, the previously downloaded backup file can be restored to the newly installed package. This will restore all your previous data. + +## Environment Variables + +After restoration, the environment variables in the restored deployment will match those configured during the package installation of restore process. This includes: + +- `KEYPER_NAME`: Your unique keyper identifier +- `SHUTTER_API_NODE_PRIVATEKEY`: Your Ethereum private key +- `ETHEREUM_WS`: Your Ethereum WebSocket RPC endpoint +- `SHUTTER_PUSH_METRICS_ENABLED`: Metrics push configuration +- `PUSHGATEWAY_URL`: Metrics push gateway URL +- `PUSHGATEWAY_USERNAME`: Push gateway authentication +- `PUSHGATEWAY_PASSWORD`: Push gateway authentication + +## ⚠️ Manual Configuration Restoration Required + +**Warning**: In order to add the values of the backed up installation, these should be added manually and can be found in two separate locations: + +- **`/metrics-config/settings.env`** will contain: + - `KEYPER_NAME` + - `PUSHGATEWAY_URL` + - `PUSHGATEWAY_USERNAME` + - `PUSHGATEWAY_PASSWORD` (if any) + +- **`/keyper-config/keyper.toml`** will contain: + - `SHUTTER_API_NODE_PRIVATEKEY` + - `ETHEREUM_WS` + - `SHUTTER_PUSH_METRICS_ENABLED` + - `HTTPEnabled` + +**Note**: At the moment, whether logs were enabled is not backed up. + +## Security Considerations + +⚠️ **Important Security Notes:** + +- The backup archive contains previous configuration files that will include sensitive data +- Your private keys and configuration are stored in the backup +- Store backup files in a secure, encrypted location +- Never share backup files with untrusted parties + +## Troubleshooting + +If you encounter issues during backup or restore: + +1. Ensure you have sufficient disk space for backup creation +2. Verify that all services are running before creating a backup +3. Check that the backup file was downloaded completely +4. Ensure the package is fully installed before attempting restore +5. Contact DAppNode support if restore fails