From 9b46d175da137989ef8765d0d61e1ae4f6cac5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 16 Oct 2016 12:52:05 +0200 Subject: [PATCH] Use LUKS for vault --- tools/mount-vault | 11 +++-------- tools/umount-vault | 12 +----------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/tools/mount-vault b/tools/mount-vault index 2dd5183e..c67f0d4c 100755 --- a/tools/mount-vault +++ b/tools/mount-vault @@ -1,12 +1,7 @@ #!/bin/bash set -e -echo "decrypting..." -cp -v ~/Nextcloud/vault.zip.gpg ~/.vault.zip.gpg -cp -v ~/Nextcloud/vault.zip.gpg.sha512 ~/.vault.zip.gpg.sha512 -sha512sum -c ~/.vault.zip.gpg.sha512 -gpg2 -d ~/.vault.zip.gpg > ~/.vault.zip -echo "mounting..." mkdir -p ~/.vault -archivemount -o nobackup ~/.vault.zip ~/.vault - +sudo cryptsetup luksOpen ~/Nextcloud/vault.img vault +sudo mount /dev/mapper/vault ~/.vault +sudo chown $USER ~/.vault diff --git a/tools/umount-vault b/tools/umount-vault index 5f6a9212..fb71d594 100755 --- a/tools/umount-vault +++ b/tools/umount-vault @@ -1,16 +1,6 @@ #!/bin/bash set -e -echo "Unmounting vault.." sudo umount ~/.vault -echo "Encrypting archive..." -gpg2 -c ~/.vault.zip -echo "Calculating checksum..." -sha512sum ~/.vault.zip.gpg > ~/.vault.zip.gpg.sha512 -sha512sum -c ~/.vault.zip.gpg.sha512 -cat ~/.vault.zip.gpg.sha512 -echo "Moving vault to storage..." -mv ~/.vault.zip.gpg ~/Nextcloud/vault.zip.gpg -mv ~/.vault.zip.gpg.sha512 ~/Nextcloud/vault.zip.gpg.sha512 -rm -vfr ~/.vault* +sudo cryptsetup luksClose vault