Includes 2 python scripts: - Encrypt mongodump + files - Download encrypted files and verify signature These scripts are meant to be used with cron
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
niko 692a1fa88f updated README 4 years ago
README.txt updated README 4 years ago
backup-files.sh initial commit 4 years ago
backup-mongo.sh initial commit 4 years ago
download.py initial commit 4 years ago
encrypt.py initial commit 4 years ago

README.txt





#
# INSTALLATION SERVERSIDE
#

- copy encrypt.py, backup-mongo.sh and backup-files.sh to server in /root folder
- edit files so they are configured correctly (dont commit sensitive data)
- set up root crontab using command `crontab -e` (as root) - add following lines:

0 4 * * * /root/backup-mongo.sh
30 4 * * * /root/backup-files.sh





#
# INSTALLTION CLIENTSIDE
#

- download any time (add cronjob ?) with following syntax:

python3 ./src/download.py \
--server <ip/domain> \
--username <ssh user> \
--key-filename <ssh private key> \
--server-path <path to download from> \
--local-path <local target path> \
--report-to <http url for reporting> \
--report-token <secret to verify authority> \
--gpg-recipient <gpg id to verify>






#
# DECRYPT LOCALLY
# (tested on debian 9)
#

- disable internet connection
- get private gpg key

- import gpg key
gpg --import private.key
gpg --import public.key

- find key id (40 length hex string)
gpg --list-keys

- trust key (do you trust key storage/transport medium?)
gpg --edit-key <key-id>
trust
5
y

- install recursive-decrypt package
sudo apt install signing-party

- add imported key as default key
insert <key-id> in appropriate place in ~/.gpgdirrc

- decrypt recursively with `gpgdir` (if it fails for a file, the file is probably corrupt anyways - delete it and rin decrypt command again)
gpgdir -d ./path/to/downloads

- delete gpg keys (very important!)
gpg --delete-secret-key <key id>
gpg --delete-key <key id>
delete public and private key files







#
# if something does not work, please contact n@nikobojs.com
#