From 147aceef40249fba0cea8f5dcdd597be164a71e8 Mon Sep 17 00:00:00 2001 From: kalmenn Date: Fri, 22 Dec 2023 00:02:25 +0100 Subject: [PATCH] git-crypt: created a script for unlocking the repo. Having a non functionning git config makes unlocking the repo impossible. However, since encrypting the git config itself probably wasn't expected by the git-crypt developers, this does happen in this setup. This implements a small workaround. --- .git-crypt/unlock.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 .git-crypt/unlock.sh diff --git a/.git-crypt/unlock.sh b/.git-crypt/unlock.sh new file mode 100755 index 0000000..214297e --- /dev/null +++ b/.git-crypt/unlock.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Use this script to decrypt the repo ~manually~. +# This is necessary because cloning it in ~/.config/git will leave your git +# config broken until the repo is decrypted. +# However, decrypting with git-crypt unlock is not possible without a working +# git config (it needs it to figure out which gpg key to use for decrypting) + +git_crypt_key="/tmp/git-crypt_key.tmp"; + +gpg --decrypt ~/.config/git/.git-crypt/keys/default/0/6413A51F72B1C87D07C161F4DFF253360BF8471F.gpg > "$git_crypt_key" +HOME= git crypt unlock "$git_crypt_key" +shred -u "$git_crypt_key"