add gpg agent config fot tty passphrase entry

This commit is contained in:
Philip Henning 2023-11-01 19:23:48 +01:00
parent f05cc4561e
commit ef7339743e
3 changed files with 19 additions and 6 deletions

View file

@ -131,6 +131,9 @@ dotfiles:
f_commonfunc:
dst: ~/.commonfunc
src: commonfunc
f_gpgagent:
dst: ~/.gnupg/gpg-agent.conf
src: gnupg/gpg-agent.conf
profiles:
AINCRAD:
dotfiles:
@ -252,6 +255,7 @@ profiles:
- f_wslenablehypervforwarding
- f_wslshowhypervforwarding
- f_commonfunc
- f_gpgagent
workspace:
dotfiles:
- d_fonts

View file

@ -0,0 +1,5 @@
#
# {{@@ header() @@}}
#
pinentry-program /usr/bin/pinentry-tty

View file

@ -30,14 +30,18 @@ if [ $? -ne 0 ]; then
(setsid nohup socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe >/dev/null 2>&1 &)
fi
# Currently not used
# Connect to windows gpg agent
# https://github.com/BlackReloaded/wsl2-ssh-pageant
export GPG_AGENT_SOCK={{@@ env['HOME'] @@}}/.gnupg/S.gpg-agent
ss -a | grep -q $GPG_AGENT_SOCK
if [ $? -ne 0 ]; then
rm -rf $GPG_AGENT_SOCK
(setsid nohup socat UNIX-LISTEN:$GPG_AGENT_SOCK,fork EXEC:"{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe --gpg S.gpg-agent" >/dev/null 2>&1 &)
fi
# export GPG_AGENT_SOCK={{@@ env['HOME'] @@}}/.gnupg/S.gpg-agent
# ss -a | grep -q $GPG_AGENT_SOCK
# if [ $? -ne 0 ]; then
# rm -rf $GPG_AGENT_SOCK
# (setsid nohup socat UNIX-LISTEN:$GPG_AGENT_SOCK,fork EXEC:"{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe --gpg S.gpg-agent" >/dev/null 2>&1 &)
# fi
# Set GPG_TTY to enable passphrase entry via tty
export GPG_TTY=$(tty)
# X410 (Windows X11 Server)
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0