Remove keychain for gpg-agent
This commit is contained in:
parent
8841520957
commit
d3a5ff8349
12
zlogin
12
zlogin
|
@ -77,16 +77,6 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ssh-agent with fix socket path {{{
|
# ssh-agent with fix socket path
|
||||||
## See load-ssh-agent function in ~/.zsh/zshrc
|
## See load-ssh-agent function in ~/.zsh/zshrc
|
||||||
load-ssh-agent
|
load-ssh-agent
|
||||||
# }}}
|
|
||||||
|
|
||||||
# GPG Agent {{{
|
|
||||||
if [ -f $HOME/.gnupg/secring.gpg ]; then
|
|
||||||
# Keychain
|
|
||||||
## Don't ask for gpg password, it will be asked at the first usage
|
|
||||||
keychain --noask --agents gpg
|
|
||||||
. $HOME/.keychain/$HOST-sh-gpg
|
|
||||||
fi
|
|
||||||
# }}}
|
|
||||||
|
|
4
zshenv
4
zshenv
|
@ -108,3 +108,7 @@ SSH_AGENT_ENV="${HOME}/.ssh/socks/ssh_agent_env"
|
||||||
## ssh-keys path
|
## ssh-keys path
|
||||||
SSH_ED25519_KEY="${HOME}/.ssh/id_ed25519"
|
SSH_ED25519_KEY="${HOME}/.ssh/id_ed25519"
|
||||||
SSH_RSA_KEY="${HOME}/.ssh/id_rsa"
|
SSH_RSA_KEY="${HOME}/.ssh/id_rsa"
|
||||||
|
|
||||||
|
# GPG
|
||||||
|
GPG_PRIV_KEY="${HOME}/.gnupg/secring.gpg"
|
||||||
|
GPG_TEST_FILE="${HOME}/.password-store/test"
|
||||||
|
|
25
zshrc
25
zshrc
|
@ -373,19 +373,24 @@ alias scpdev='scp -o UserKnownHostsFile=/dev/null'
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
## Keychain for GPG {{{
|
# GPG {{{
|
||||||
function gpg() {
|
#########
|
||||||
## If keychain exists, run gpg from default $PATH as usual
|
|
||||||
if [ -f ~/.keychain/"${HOST}"-sh-gpg ]; then
|
# Load gpg-agent {{{
|
||||||
command -p gpg ${*}
|
## This function can be used :
|
||||||
else ## Otherwise, reload keychain and run gpg
|
## 1. with aliases (git commit,…)
|
||||||
keychain --agents gpg
|
function load-gpg-agent() {
|
||||||
source ~/.keychain/"${HOST}"-sh-gpg
|
## If a gpg key is available
|
||||||
command -p gpg ${*}
|
if [ -f "${GPG_PRIV_KEY}" ]; then
|
||||||
|
## Remove any previous test file
|
||||||
|
rm --force -- "${GPG_TEST_FILE}"
|
||||||
|
## Run a gpg command on the test file
|
||||||
|
gpg --quiet --for-your-eyes-only --decrypt "${GPG_TEST_FILE}.gpg" > /dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
## }}}
|
# }}}
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
# Taskwarrior {{{
|
# Taskwarrior {{{
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
Loading…
Reference in New Issue