From b905e90b851acb36110aa390b388f4c4235493ac Mon Sep 17 00:00:00 2001 From: Damien Tardy-Panis Date: Fri, 12 May 2023 11:03:48 +0200 Subject: [PATCH] Remove script and config related to yubikey opengpg requiring touch We disabled the touch again. It was annoying but manageable so far even with the following issues: - required a touch for each mail sending in aerc (could have been patched there though) - not all cases for pass commands were covered - made it quite impossible to use `pass grep` However it will make it impossible to run some regular background command for mail fetching via mbsync. We'll just keep the touch for the OATH part. --- files/docs/shell/Makefile | 1 - files/docs/shell/pass.scd | 42 ------------------- files/scripts/i3blocks/i3blocks-yubikey | 15 +------ files/scripts/shell/Makefile | 1 - files/scripts/shell/pass | 55 ------------------------- 5 files changed, 2 insertions(+), 112 deletions(-) delete mode 100644 files/docs/shell/pass.scd delete mode 100755 files/scripts/shell/pass diff --git a/files/docs/shell/Makefile b/files/docs/shell/Makefile index 6f6b51e6..26267044 100644 --- a/files/docs/shell/Makefile +++ b/files/docs/shell/Makefile @@ -31,7 +31,6 @@ shell-docs: setup/setup-doc shell/night-mode setup/setup-doc shell/notify setup/setup-doc shell/open-document - setup/setup-doc shell/pass setup/setup-doc shell/pick-task setup/setup-doc shell/play-somafm setup/setup-doc shell/pomodoro diff --git a/files/docs/shell/pass.scd b/files/docs/shell/pass.scd deleted file mode 100644 index 8cdee26b..00000000 --- a/files/docs/shell/pass.scd +++ /dev/null @@ -1,42 +0,0 @@ -PASS(1perso) - -# NAME - -pass - Wrapper for *pass*(1) - -# SYNOPSIS - -see *pass*(1) - -# DESCRIPTION - -Pass wrapper for Yubikey PGP touch notifications. - -Only supports the exact commands used internally using the "show" subcommand. - -# OPTIONS - -No change - -# OPERANDS - -*touch* - Display pass names waiting for a touch if any++ -_WARNING_: the names are in the order they were added but this does not mean -they would be decrypted in that same order after the touch. - -# ENVIRONMENT VARIABLES - -_XDG_RUNTIME_DIR_ - Path to user-specific base directory to store runtime files++ -If unset, defaults to /tmp - -# FILES - -_$XDG_RUNTIME_DIR/yubikey_gpg_ - Contains information about the pass names waiting for a touch - -# DEPENDENCIES - -- mktemp -- pkill diff --git a/files/scripts/i3blocks/i3blocks-yubikey b/files/scripts/i3blocks/i3blocks-yubikey index 4c24b162..139f43c0 100755 --- a/files/scripts/i3blocks/i3blocks-yubikey +++ b/files/scripts/i3blocks/i3blocks-yubikey @@ -1,27 +1,16 @@ #!/bin/sh # commands used: # - i3blocks-mode -# - pass (wrapper) # - ykman (wrapper) MODE="$( i3blocks-mode )" OATH_TOUCH_STATUS="$( ykman oath touch )" -PGP_TOUCH_STATUS="$( pass touch )" -# it's currently not possible for both OATH and PGP to be waiting for touch -if [ "${OATH_TOUCH_STATUS}" = 'not waiting' ]; then - if [ "${PGP_TOUCH_STATUS}" = 'not waiting' ]; then - exit 0 - else - TOUCH_STATUS="PGP: $( echo "${PGP_TOUCH_STATUS}" | paste -sd, )" - fi -else - TOUCH_STATUS="OATH: ${OATH_TOUCH_STATUS}" -fi +[ "${OATH_TOUCH_STATUS}" = 'not waiting' ] && exit 0 if [ "${MODE}" = 'full' ]; then - TEXT=" ${TOUCH_STATUS}" + TEXT=" ${OATH_TOUCH_STATUS}" else TEXT='' fi diff --git a/files/scripts/shell/Makefile b/files/scripts/shell/Makefile index 66076355..9bf357d9 100644 --- a/files/scripts/shell/Makefile +++ b/files/scripts/shell/Makefile @@ -31,7 +31,6 @@ shell-scripts: setup/setup-script shell/night-mode setup/setup-script shell/notify setup/setup-script shell/open-document - setup/setup-script shell/pass setup/setup-script shell/pick-task setup/setup-script shell/play-somafm setup/setup-script shell/pomodoro diff --git a/files/scripts/shell/pass b/files/scripts/shell/pass deleted file mode 100755 index c636a035..00000000 --- a/files/scripts/shell/pass +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -PGP_FILE_PATH="${XDG_RUNTIME_DIR:-/tmp}/yubikey_pgp" - -TMP_FILE="$( mktemp )" -trap 'rm -f "${TMP_FILE}"' EXIT - -PGP_CODE_NAME= - -start_pgp_touch() { - echo "${PGP_CODE_NAME}" >> "${PGP_FILE_PATH}" \ - && update_i3blocks -} - -end_pgp_touch() { - # remove only one occurence of the pass name - PGP_CODE_NAME_ESC="$( echo "${PGP_CODE_NAME}" | sed 's#/#\\/#g' )" - awk "!/${PGP_CODE_NAME_ESC}/ || f++" "${PGP_FILE_PATH}" > "${TMP_FILE}" \ - && cp "${TMP_FILE}" "${PGP_FILE_PATH}" \ - && update_i3blocks -} - -status_pgp_touch() { - if ! [ -f "${PGP_FILE_PATH}" ] || ! [ -s "${PGP_FILE_PATH}" ] ; then - echo 'not waiting' - else - cat "${PGP_FILE_PATH}" - fi -} - -update_i3blocks() { - pkill -x -RTMIN+10 i3blocks -} - -case "$@" in - touch) - status_pgp_touch - exit - ;; - show\ -c\ *) - PGP_CODE_NAME="$3" - ;; - show\ *) - PGP_CODE_NAME="$2" - ;; - edit\ *) - PGP_CODE_NAME="$2" - ;; -esac - -[ -n "${PGP_CODE_NAME}" ] && start_pgp_touch - -/usr/bin/pass "$@" - -[ -n "${PGP_CODE_NAME}" ] && end_pgp_touch -- 2.45.2