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: f_commonfunc:
dst: ~/.commonfunc dst: ~/.commonfunc
src: commonfunc src: commonfunc
f_gpgagent:
dst: ~/.gnupg/gpg-agent.conf
src: gnupg/gpg-agent.conf
profiles: profiles:
AINCRAD: AINCRAD:
dotfiles: dotfiles:
@ -252,6 +255,7 @@ profiles:
- f_wslenablehypervforwarding - f_wslenablehypervforwarding
- f_wslshowhypervforwarding - f_wslshowhypervforwarding
- f_commonfunc - f_commonfunc
- f_gpgagent
workspace: workspace:
dotfiles: dotfiles:
- d_fonts - 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 &) (setsid nohup socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:{{@@ env['HOME'] @@}}/.ssh/wsl2-ssh-pageant.exe >/dev/null 2>&1 &)
fi fi
# Currently not used
# Connect to windows gpg agent # Connect to windows gpg agent
# https://github.com/BlackReloaded/wsl2-ssh-pageant # https://github.com/BlackReloaded/wsl2-ssh-pageant
export GPG_AGENT_SOCK={{@@ env['HOME'] @@}}/.gnupg/S.gpg-agent # export GPG_AGENT_SOCK={{@@ env['HOME'] @@}}/.gnupg/S.gpg-agent
ss -a | grep -q $GPG_AGENT_SOCK # ss -a | grep -q $GPG_AGENT_SOCK
if [ $? -ne 0 ]; then # if [ $? -ne 0 ]; then
rm -rf $GPG_AGENT_SOCK # 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 &) # (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 # fi
# Set GPG_TTY to enable passphrase entry via tty
export GPG_TTY=$(tty)
# X410 (Windows X11 Server) # X410 (Windows X11 Server)
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0