Skip to content

Commit

Permalink
Set homedirs to circumvent bugs caused by missing homedir
Browse files Browse the repository at this point in the history
  • Loading branch information
Luzifer committed Sep 16, 2024
1 parent f7bfd28 commit c27295e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ EC=$?

if [ "$1" = "checkout" -a -f ".git-crypt-key" -a ! "$GIT_CRYPT_RUNNING" = "true" ]; then
export GIT_CRYPT_RUNNING=true
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="${VAULT_ROLE_ID:-}")
export VAULT_TOKEN=$(HOME=/tmp/githome vault write -field=token auth/approle/login role_id="${VAULT_ROLE_ID}")

tmpfile=$(mktemp)
vault read -field=key "secret/git-crypt/$(<.git-crypt-key)" | base64 -d >${tmpfile}
git-crypt unlock ${tmpfile}
HOME=/tmp/githome vault read -field=key "secret/git-crypt/$(<.git-crypt-key)" | base64 -d >${tmpfile}
HOME=/tmp/githome git-crypt unlock ${tmpfile}
rm ${tmpfile}
fi

Expand Down

0 comments on commit c27295e

Please sign in to comment.