From 4d0d9a8dfd557ac88f50bd73c786c7216bb01395 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 7 Nov 2025 21:34:05 +0100 Subject: Fix gpg forwarding on .local machines --- .bash_profile | 9 ++++++--- .gnupg/gpg-agent.conf | 3 ++- .gnupg/pinentry-wrapper | 4 ++-- .stow-local-ignore | 2 -- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.bash_profile b/.bash_profile index ef9f275..3e575aa 100644 --- a/.bash_profile +++ b/.bash_profile @@ -18,6 +18,7 @@ fi export CLICOLOR=1 # Mac OS custorm colors (not LS_COLORS as unix) defaultscheme "exfxcxdxbxegedabagacad" export LSCOLORS=gxfxcxdxbxegedabagacad +export BASH_SILENCE_DEPRECATION_WARNING=1 # Silence new macOS warning about bash # Unix/Bash Readline custom colors (created by dircolors in bashrc) export LS_COLORS="$LS_COLORS:di=00;36:ln=00;35:ex=00;31" @@ -36,9 +37,11 @@ export LANG=en_US.UTF-8 GPG_TTY=$(tty) export GPG_TTY unset SSH_AGENT_PID -SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -export SSH_AUTH_SOCK -export BASH_SILENCE_DEPRECATION_WARNING=1 # Silence new macOS warning about bash +# If SSH_AUTH_SOCK is empty, then set it, otherwise it's already set by ForwardAgent +if [ -z "$SSH_AUTH_SOCK" ]; then + SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + export SSH_AUTH_SOCK +fi # ==== Shell Opts shopt -s checkwinsize # check the window size after each command and, if necessary, update LINES/COLUMNS diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf index 93d7907..a6158b7 100644 --- a/.gnupg/gpg-agent.conf +++ b/.gnupg/gpg-agent.conf @@ -1,4 +1,5 @@ -pinentry-program /usr/local/bin/pinentry-wrapper +pinentry-program ~/.gnupg/pinentry-wrapper + default-cache-ttl 3600 default-cache-ttl-ssh 3600 max-cache-ttl 3600 diff --git a/.gnupg/pinentry-wrapper b/.gnupg/pinentry-wrapper index b160cc0..9964241 100755 --- a/.gnupg/pinentry-wrapper +++ b/.gnupg/pinentry-wrapper @@ -8,9 +8,9 @@ case $PINENTRY_USER_DATA in curses) - exec $(brew --prefix)/bin/pinentry-curses "$@" + exec pinentry-curses "$@" ;; *) - exec $(brew --prefix)/bin/pinentry-tty "$@" + exec pinentry-tty "$@" ;; esac diff --git a/.stow-local-ignore b/.stow-local-ignore index e62c1b1..55f3975 100644 --- a/.stow-local-ignore +++ b/.stow-local-ignore @@ -4,5 +4,3 @@ ^/Brewfile .*.md - -/.gnupg -- cgit v1.2.3