Ver código fonte

Backup and restore password store

Bob Mottram 8 anos atrás
pai
commit
818282650c

+ 1
- 0
src/freedombone-backup-local Ver arquivo

204
         "/var/spool/mlmmj,                      mailinglist"
204
         "/var/spool/mlmmj,                      mailinglist"
205
         "/etc/nginx/sites-available,            web"
205
         "/etc/nginx/sites-available,            web"
206
         "/var/lib/tor,                          tor"
206
         "/var/lib/tor,                          tor"
207
+        "/root/.passwords,                      passwordstore"
207
     )
208
     )
208
 
209
 
209
     for dr in "${backup_dirs[@]}"
210
     for dr in "${backup_dirs[@]}"

+ 8
- 0
src/freedombone-backup-remote Ver arquivo

249
     fi
249
     fi
250
 }
250
 }
251
 
251
 
252
+function backup_passwordstore {
253
+    if [ -d /root/.passwords ]; then
254
+        echo $"Backing up password store"
255
+        backup_directory_to_friend /root/.passwords passwordstore
256
+    fi
257
+}
258
+
252
 function backup_tor {
259
 function backup_tor {
253
     if [ -d /etc/letsencrypt ]; then
260
     if [ -d /etc/letsencrypt ]; then
254
         echo $"Backing up Tor settings"
261
         echo $"Backing up Tor settings"
376
 if [[ $TEST_MODE == "no" ]]; then
383
 if [[ $TEST_MODE == "no" ]]; then
377
     backup_users
384
     backup_users
378
     backup_letsencrypt
385
     backup_letsencrypt
386
+    backup_passwordstore
379
     backup_tor
387
     backup_tor
380
     backup_web_server
388
     backup_web_server
381
     backup_admin_readme
389
     backup_admin_readme

+ 1
- 0
src/freedombone-controlpanel Ver arquivo

887
     utils_installed=(configfiles
887
     utils_installed=(configfiles
888
                      mariadb
888
                      mariadb
889
                      letsencrypt
889
                      letsencrypt
890
+                     passwords
890
                      mutt
891
                      mutt
891
                      gpg
892
                      gpg
892
                      procmail
893
                      procmail

+ 13
- 0
src/freedombone-restore-local Ver arquivo

227
     fi
227
     fi
228
 }
228
 }
229
 
229
 
230
+function restore_passwordstore {
231
+    if [[ $RESTORE_APP != 'all' ]]; then
232
+        if [[ $RESTORE_APP != 'passwords' ]]; then
233
+            return
234
+        fi
235
+    fi
236
+    if [ -d $USB_MOUNT/backup/passwordstore ]; then
237
+        echo $"Restoring password store"
238
+        restore_directory_from_usb / passwordstore
239
+    fi
240
+}
241
+
230
 function restore_tor {
242
 function restore_tor {
231
     if [[ $RESTORE_APP != 'all' ]]; then
243
     if [[ $RESTORE_APP != 'all' ]]; then
232
         if [[ $RESTORE_APP != 'tor' ]]; then
244
         if [[ $RESTORE_APP != 'tor' ]]; then
713
 same_admin_user
725
 same_admin_user
714
 restore_mariadb
726
 restore_mariadb
715
 restore_letsencrypt
727
 restore_letsencrypt
728
+restore_passwordstore
716
 restore_tor
729
 restore_tor
717
 restore_mutt_settings
730
 restore_mutt_settings
718
 restore_gpg
731
 restore_gpg

+ 13
- 0
src/freedombone-restore-remote Ver arquivo

219
     fi
219
     fi
220
 }
220
 }
221
 
221
 
222
+function restore_passwordstore {
223
+    if [[ $RESTORE_APP != 'all' ]]; then
224
+        if [[ $RESTORE_APP != 'passwords' ]]; then
225
+            return
226
+        fi
227
+    fi
228
+    if [ -d $SERVER_DIRECTORY/backup/passwordstore ]; then
229
+        echo $"Restoring password store"
230
+        restore_directory_from_friend / passwordstore
231
+    fi
232
+}
233
+
222
 function restore_tor {
234
 function restore_tor {
223
     if [[ $RESTORE_APP != 'all' ]]; then
235
     if [[ $RESTORE_APP != 'all' ]]; then
224
         if [[ $RESTORE_APP != 'tor' ]]; then
236
         if [[ $RESTORE_APP != 'tor' ]]; then
649
 restore_configfiles
661
 restore_configfiles
650
 restore_mariadb
662
 restore_mariadb
651
 restore_letsencrypt
663
 restore_letsencrypt
664
+restore_passwordstore
652
 restore_mutt_settings
665
 restore_mutt_settings
653
 restore_gpg
666
 restore_gpg
654
 restore_procmail
667
 restore_procmail