mirror of
https://github.com/luzifer-docker/argo-crypt.git
synced 2024-12-20 22:31:17 +00:00
Set homedirs to circumvent bugs caused by missing homedir
This commit is contained in:
parent
f7bfd28714
commit
c27295e089
1 changed files with 3 additions and 3 deletions
|
@ -7,11 +7,11 @@ EC=$?
|
||||||
|
|
||||||
if [ "$1" = "checkout" -a -f ".git-crypt-key" -a ! "$GIT_CRYPT_RUNNING" = "true" ]; then
|
if [ "$1" = "checkout" -a -f ".git-crypt-key" -a ! "$GIT_CRYPT_RUNNING" = "true" ]; then
|
||||||
export GIT_CRYPT_RUNNING=true
|
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)
|
tmpfile=$(mktemp)
|
||||||
vault read -field=key "secret/git-crypt/$(<.git-crypt-key)" | base64 -d >${tmpfile}
|
HOME=/tmp/githome vault read -field=key "secret/git-crypt/$(<.git-crypt-key)" | base64 -d >${tmpfile}
|
||||||
git-crypt unlock ${tmpfile}
|
HOME=/tmp/githome git-crypt unlock ${tmpfile}
|
||||||
rm ${tmpfile}
|
rm ${tmpfile}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue