Skip to content
Snippets Groups Projects
Commit 81828265 authored by Bob Mottram's avatar Bob Mottram
Browse files

Backup and restore password store

parent 4f778545
No related branches found
No related tags found
No related merge requests found
...@@ -204,6 +204,7 @@ function backup_directories { ...@@ -204,6 +204,7 @@ function backup_directories {
"/var/spool/mlmmj, mailinglist" "/var/spool/mlmmj, mailinglist"
"/etc/nginx/sites-available, web" "/etc/nginx/sites-available, web"
"/var/lib/tor, tor" "/var/lib/tor, tor"
"/root/.passwords, passwordstore"
) )
for dr in "${backup_dirs[@]}" for dr in "${backup_dirs[@]}"
......
...@@ -249,6 +249,13 @@ function backup_letsencrypt { ...@@ -249,6 +249,13 @@ function backup_letsencrypt {
fi fi
} }
function backup_passwordstore {
if [ -d /root/.passwords ]; then
echo $"Backing up password store"
backup_directory_to_friend /root/.passwords passwordstore
fi
}
function backup_tor { function backup_tor {
if [ -d /etc/letsencrypt ]; then if [ -d /etc/letsencrypt ]; then
echo $"Backing up Tor settings" echo $"Backing up Tor settings"
...@@ -376,6 +383,7 @@ backup_configfiles ...@@ -376,6 +383,7 @@ backup_configfiles
if [[ $TEST_MODE == "no" ]]; then if [[ $TEST_MODE == "no" ]]; then
backup_users backup_users
backup_letsencrypt backup_letsencrypt
backup_passwordstore
backup_tor backup_tor
backup_web_server backup_web_server
backup_admin_readme backup_admin_readme
......
...@@ -887,6 +887,7 @@ function restore_data_from_storage { ...@@ -887,6 +887,7 @@ function restore_data_from_storage {
utils_installed=(configfiles utils_installed=(configfiles
mariadb mariadb
letsencrypt letsencrypt
passwords
mutt mutt
gpg gpg
procmail procmail
......
...@@ -227,6 +227,18 @@ function restore_letsencrypt { ...@@ -227,6 +227,18 @@ function restore_letsencrypt {
fi fi
} }
function restore_passwordstore {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'passwords' ]]; then
return
fi
fi
if [ -d $USB_MOUNT/backup/passwordstore ]; then
echo $"Restoring password store"
restore_directory_from_usb / passwordstore
fi
}
function restore_tor { function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then if [[ $RESTORE_APP != 'tor' ]]; then
...@@ -713,6 +725,7 @@ restore_configfiles ...@@ -713,6 +725,7 @@ restore_configfiles
same_admin_user same_admin_user
restore_mariadb restore_mariadb
restore_letsencrypt restore_letsencrypt
restore_passwordstore
restore_tor restore_tor
restore_mutt_settings restore_mutt_settings
restore_gpg restore_gpg
......
...@@ -219,6 +219,18 @@ function restore_letsencrypt { ...@@ -219,6 +219,18 @@ function restore_letsencrypt {
fi fi
} }
function restore_passwordstore {
if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'passwords' ]]; then
return
fi
fi
if [ -d $SERVER_DIRECTORY/backup/passwordstore ]; then
echo $"Restoring password store"
restore_directory_from_friend / passwordstore
fi
}
function restore_tor { function restore_tor {
if [[ $RESTORE_APP != 'all' ]]; then if [[ $RESTORE_APP != 'all' ]]; then
if [[ $RESTORE_APP != 'tor' ]]; then if [[ $RESTORE_APP != 'tor' ]]; then
...@@ -649,6 +661,7 @@ copy_gpg_keys ...@@ -649,6 +661,7 @@ copy_gpg_keys
restore_configfiles restore_configfiles
restore_mariadb restore_mariadb
restore_letsencrypt restore_letsencrypt
restore_passwordstore
restore_mutt_settings restore_mutt_settings
restore_gpg restore_gpg
restore_procmail restore_procmail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment