From f11ca4b602f4784792c3f64b090acd16a18fa049 Mon Sep 17 00:00:00 2001 From: Przemek Kaminski Date: Sun, 3 Feb 2019 16:06:59 +0100 Subject: [PATCH 1/4] pass-show.sh and pinentry.sh as in #14 --- pass-show.sh | 16 ++++++++-------- pinentry.sh | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) create mode 100755 pinentry.sh diff --git a/pass-show.sh b/pass-show.sh index af31213..0c58ec9 100755 --- a/pass-show.sh +++ b/pass-show.sh @@ -6,14 +6,14 @@ QUERY=$1 PATH=/usr/local/bin:$PATH # GPG agent -envfile="$HOME/.gnupg/gpg-agent.env" -if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then - eval "$(cat "$envfile"); export GPG_AGENT_INFO" -else - eval "$(gpg-agent --daemon --write-env-file "$envfile")" -fi +#envfile="$HOME/.gnupg/gpg-agent.env" +#if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then +# eval "$(cat "$envfile"); export GPG_AGENT_INFO" +#else +# eval "$(gpg-agent --daemon --write-env-file "$envfile")" +#fi # PASS -#pass show "$QUERY" | awk 'BEGIN{ORS=""} {print; exit}' | pbcopy -pass show -c "$QUERY" +PINENTRY_USER_DATA=gui pass show "$QUERY" | awk 'BEGIN{ORS=""} {print; exit}' +#pass show -c "$QUERY" osascript -e 'display notification "Copied password to clipboard" with title "Unix pass"' diff --git a/pinentry.sh b/pinentry.sh new file mode 100755 index 0000000..5b9827b --- /dev/null +++ b/pinentry.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# choose pinentry depending on PINENTRY_USER_DATA +# requires pinentry-curses and pinentry-mac +# this *only works* with gpg 2 +# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802020 + +case $PINENTRY_USER_DATA in +gui) + exec pinentry-mac "$@" + ;; +*) + exec pinentry "$@" +esac + From 4211bb38f37ac61141cd0928f52283c3384c158c Mon Sep 17 00:00:00 2001 From: aneta Date: Mon, 4 Feb 2019 06:36:08 +0100 Subject: [PATCH 2/4] info.plist -- added "copy to clipboard" to the workflow --- info.plist | 133 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 49 deletions(-) diff --git a/info.plist b/info.plist index a1860a3..f6f2f8d 100644 --- a/info.plist +++ b/info.plist @@ -4,15 +4,13 @@ bundleid pl.intrepidus.pass - category - Tools connections - 7DD3BDE5-A157-42E5-9376-F681FB50A4EE + 06C9C4A9-38CE-441A-8D06-E2F2D8B39B60 destinationuid - 06C9C4A9-38CE-441A-8D06-E2F2D8B39B60 + C7B97C94-3D0B-471E-96EE-A441A1FAB184 modifiers 0 modifiersubtext @@ -21,11 +19,11 @@ - 97122574-1811-40EE-8FA3-CA5A7E8CB809 + 7DD3BDE5-A157-42E5-9376-F681FB50A4EE destinationuid - 0D9D4DE6-36FF-459E-9457-B3CAD298670C + 06C9C4A9-38CE-441A-8D06-E2F2D8B39B60 modifiers 0 modifiersubtext @@ -47,6 +45,19 @@ + 97122574-1811-40EE-8FA3-CA5A7E8CB809 + + + destinationuid + 0D9D4DE6-36FF-459E-9457-B3CAD298670C + modifiers + 0 + modifiersubtext + + vitoclose + + + createdby Przemek KamiƄski @@ -58,29 +69,6 @@ pass objects - - config - - concurrently - - escaping - 102 - script - bash pass-show.sh "{query}" - scriptargtype - 0 - scriptfile - - type - 0 - - type - alfred.workflow.action.script - uid - 06C9C4A9-38CE-441A-8D06-E2F2D8B39B60 - version - 2 - config @@ -136,7 +124,7 @@ escaping 102 script - bash pass-generate.sh "{query}" + bash pass-show.sh "{query}" scriptargtype 0 scriptfile @@ -147,30 +135,26 @@ type alfred.workflow.action.script uid - 0D9D4DE6-36FF-459E-9457-B3CAD298670C + 06C9C4A9-38CE-441A-8D06-E2F2D8B39B60 version 2 config - argumenttype - 0 - keyword - pg - subtext - - text - Generate password - withspace - + autopaste + + clipboardtext + {query} + transient + type - alfred.workflow.input.keyword + alfred.workflow.output.clipboard uid - 97122574-1811-40EE-8FA3-CA5A7E8CB809 + C7B97C94-3D0B-471E-96EE-A441A1FAB184 version - 1 + 2 config @@ -180,7 +164,7 @@ escaping 102 script - bash pass-otp.sh "{query}" + bash pass-generate.sh "{query}" scriptargtype 0 scriptfile @@ -191,10 +175,31 @@ type alfred.workflow.action.script uid - 118228AE-EF0F-48D4-AE63-F97A9290F4FA + 0D9D4DE6-36FF-459E-9457-B3CAD298670C version 2 + + config + + argumenttype + 0 + keyword + pg + subtext + + text + Generate password + withspace + + + type + alfred.workflow.input.keyword + uid + 97122574-1811-40EE-8FA3-CA5A7E8CB809 + version + 1 + config @@ -242,6 +247,29 @@ version 2 + + config + + concurrently + + escaping + 102 + script + bash pass-otp.sh "{query}" + scriptargtype + 0 + scriptfile + + type + 0 + + type + alfred.workflow.action.script + uid + 118228AE-EF0F-48D4-AE63-F97A9290F4FA + version + 2 + readme @@ -275,6 +303,13 @@ ypos 60 + 967E625E-D870-4298-9A7A-97C043740D99 + + xpos + 300 + ypos + 300 + 97122574-1811-40EE-8FA3-CA5A7E8CB809 xpos @@ -282,12 +317,12 @@ ypos 180 - 967E625E-D870-4298-9A7A-97C043740D99 + C7B97C94-3D0B-471E-96EE-A441A1FAB184 xpos - 300 + 680 ypos - 300 + 60 version From 71ce0ffb0caa28346543474d5ac8dca26660cbf8 Mon Sep 17 00:00:00 2001 From: Przemek Kaminski Date: Mon, 4 Feb 2019 06:50:58 +0100 Subject: [PATCH 3/4] Version 0.3.4, README, CHANGELOG updated --- CHANGELOG.md | 6 ++++++ README.md | 14 ++++++++++++++ info.plist | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa080b..df5bba5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). See [Keep a CHANGELOG](http://keepachangelog.com/) for more details. ## [Unreleased] + +## [0.3.4] - 2018-02-04 ### Added - pass-otp support +### Changed +- we now use Alfred's transient clipboard (for `pass`, not for `po` yet), kudos + to @bgshiller! +- recommended to use `pinentry.sh` instead of `pinentry-mac` ## [0.3.3] - 2018-06-18 ### Added diff --git a/README.md b/README.md index 6ee3133..884a31d 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,20 @@ Next configure `gpg-agent` to use `pinentry-mac` and not the bundled one, editin pinentry-program /usr/local/bin/pinentry-mac ``` +If you prefer to keep the terminal version of `pinentry` you can use the +`pinentry.sh` wrapper from this repository as the `pinentry-program`. This will +use the ncurses version when in console and the GUI version for Alfred etc. + +### GPG tweaking + +You can tweak some of the `gpg-agent` settings in `~/.gnupg/gpg-agent.conf`: + +``` +max-cache-ttl 7200 +``` + +After 7200 seconds, GPG will forget your master password. + ## Installation After your system is set up as described above, download the latest package from diff --git a/info.plist b/info.plist index f6f2f8d..1c3008e 100644 --- a/info.plist +++ b/info.plist @@ -326,7 +326,7 @@ version - 0.3.3 + 0.3.4 webaddress https://github.com/CGenie/alfred-pass From 81937b34db767e7700edd62a104dde6d2815e846 Mon Sep 17 00:00:00 2001 From: CGenie Date: Mon, 4 Feb 2019 06:53:31 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 884a31d..c0ee198 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ If you prefer to keep the terminal version of `pinentry` you can use the `pinentry.sh` wrapper from this repository as the `pinentry-program`. This will use the ncurses version when in console and the GUI version for Alfred etc. +You can also take a look at [this blog post from @bshiller](https://brianschiller.com/blog/2016/08/31/gnu-pass-alfred). + ### GPG tweaking You can tweak some of the `gpg-agent` settings in `~/.gnupg/gpg-agent.conf`: