Browse Source

Backup and restore nginx password hashes

Bob Mottram 9 years ago
parent
commit
b54314d4b0

+ 1
- 0
src/freedombone View File

9266
 
9266
 
9267
     # an unprivileged user to run as
9267
     # an unprivileged user to run as
9268
     useradd -d ${SEARCH_ENGINE_PATH}/searx/ -s /bin/false searx
9268
     useradd -d ${SEARCH_ENGINE_PATH}/searx/ -s /bin/false searx
9269
+    adduser searx debian-tor
9269
 
9270
 
9270
     # daemon
9271
     # daemon
9271
     echo '[Unit]' > /etc/systemd/system/searx.service
9272
     echo '[Unit]' > /etc/systemd/system/searx.service

+ 4
- 0
src/freedombone-backup-local View File

451
     if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
451
     if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
452
         cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
452
         cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
453
     fi
453
     fi
454
+    # nginx password hashes
455
+    if [ -f /etc/nginx/.htpasswd ]; then
456
+        cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
457
+    fi
454
     backup_directory_to_usb /root/tempbackupconfig config
458
     backup_directory_to_usb /root/tempbackupconfig config
455
 }
459
 }
456
 
460
 

+ 4
- 0
src/freedombone-backup-remote View File

172
     if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
172
     if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
173
         cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
173
         cp -f $BACKUP_EXTRA_DIRECTORIES /root/tempbackupconfig
174
     fi
174
     fi
175
+    # nginx password hashes
176
+    if [ -f /etc/nginx/.htpasswd ]; then
177
+        cp -f /etc/nginx/.htpasswd /root/tempbackupconfig/htpasswd
178
+    fi
175
     backup_directory_to_friend /root/tempbackupconfig config
179
     backup_directory_to_friend /root/tempbackupconfig config
176
 }
180
 }
177
 
181
 

+ 5
- 0
src/freedombone-restore-local View File

295
             fi
295
             fi
296
         fi
296
         fi
297
 
297
 
298
+        # restore nginx password hashes
299
+        if [ -f /root/tempconfig/root/htpasswd ]; then
300
+            cp -f /root/tempconfig/root/htpasswd /etc/nginx/.htpasswd
301
+        fi
302
+
298
         rm -rf /root/tempconfig
303
         rm -rf /root/tempconfig
299
     fi
304
     fi
300
 }
305
 }

+ 5
- 0
src/freedombone-restore-remote View File

205
             fi
205
             fi
206
         fi
206
         fi
207
 
207
 
208
+        # restore nginx password hashes
209
+        if [ -f /root/tempconfig/root/htpasswd ]; then
210
+            cp -f /root/tempconfig/root/htpasswd /etc/nginx/.htpasswd
211
+        fi
212
+
208
         rm -rf /root/tempconfig
213
         rm -rf /root/tempconfig
209
     fi
214
     fi
210
 }
215
 }