From 96b8790728b2eec66f99c2e64d8a332abca41f6f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 22:14:59 -0200 Subject: ChangeLog update --- ChangeLog | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 9cc7bb2..2de87c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,20 @@ +2013-12-10 - Silvio Rhatto + + New actions: shell (#34), help, mkdir, teardown. + 2013-11-26 - 0.2.9 Silvio Rhatto - Added 'tree' action + Added 'tree' action - Added 'rm' alias to 'del' action + Added 'rm' alias to 'del' action - Set .gitignore during initialization and when using tmp inside the repository + Set .gitignore during initialization and when using tmp inside the repository - Pass options to git-rm at del action + Pass options to git-rm at del action - Simpler ramdisk/tmpfs check at keyringer_check_tmp + Simpler ramdisk/tmpfs check at keyringer_check_tmp - Better mode check on keyringer_check_tmp (closes #30) + Better mode check on keyringer_check_tmp (closes #30) Fixed minor typos -- cgit v1.2.3 From b95155761a1789557ea1569491d149e3c90d295b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 26 Dec 2013 21:56:04 -0200 Subject: Adding 'find' action --- ChangeLog | 4 ++++ lib/keyringer/actions/find | 19 +++++++++++++++++++ share/man/keyringer.1.mdwn | 3 +++ 3 files changed, 26 insertions(+) create mode 100755 lib/keyringer/actions/find (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 2de87c4..eb6b543 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-26 - Silvio Rhatto + + New action: find. + 2013-12-10 - Silvio Rhatto New actions: shell (#34), help, mkdir, teardown. diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find new file mode 100755 index 0000000..92bec25 --- /dev/null +++ b/lib/keyringer/actions/find @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Find secrets. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Aditional parameters +CWD="`pwd`" + +# Avoid leading slash +shift +ARGS="`echo "$*" | sed -e "s|^/*||"`" + +# Run find command +cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" +cd "$CWD" diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index ad9569b..c3a8a7c 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -37,6 +37,9 @@ Keyringer has three types of actions: # REPOSITORY LOOKUP AND MANIPULATION ACTIONS +find <*expression*> +: Find secrets in the repository. + init <*path*> [*remote*] : Initialize a new keyringer repository. If a *remote* URL is specified, keyringer will clone an existing repository. -- cgit v1.2.3 From 6e077ce5604f8de1eec8e953248674423254246d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 26 Dec 2013 23:56:30 -0200 Subject: Adding mv and rmdir actions --- ChangeLog | 6 ++++-- lib/keyringer/actions/mv | 28 ++++++++++++++++++++++++++++ lib/keyringer/actions/rmdir | 19 +++++++++++++++++++ share/man/keyringer.1.mdwn | 6 ++++++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 lib/keyringer/actions/mv create mode 100755 lib/keyringer/actions/rmdir (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index eb6b543..401fc64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,12 @@ 2013-12-26 - Silvio Rhatto - New action: find. + New actions: find, mv, rmdir + + Support for RELATIVE_FOLDER at git action 2013-12-10 - Silvio Rhatto - New actions: shell (#34), help, mkdir, teardown. + New actions: shell (#34), help, mkdir, teardown 2013-11-26 - 0.2.9 Silvio Rhatto diff --git a/lib/keyringer/actions/mv b/lib/keyringer/actions/mv new file mode 100755 index 0000000..aaf6772 --- /dev/null +++ b/lib/keyringer/actions/mv @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Move secrets. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Avoid leading slash +ORIG="$(keyringer_filename `echo "$2" | sed -e "s|^/*||"`)" +DEST="`echo "$3" | sed -e "s|^/*||"`" + +# Set destination +if [ ! -d "$KEYDIR/$RELATIVE_PATH/$DEST" ]; then + keyringer_get_new_file $DEST +else + FILE="$DEST" +fi + +# Check if secret exists +if ! echo "$ORIG" | grep -q '*' && [ ! -e "$KEYDIR/$RELATIVE_PATH/$ORIG" ]; then + echo "Secret not found: $ORIG" + exit 1 +fi + +# Run move command +keyringer_exec git "$BASEDIR" mv $ORIG $FILE diff --git a/lib/keyringer/actions/rmdir b/lib/keyringer/actions/rmdir new file mode 100755 index 0000000..398cf11 --- /dev/null +++ b/lib/keyringer/actions/rmdir @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Remove folders. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Aditional parameters +CWD="`pwd`" + +# Avoid leading slash +shift +ARGS="`echo "$*" | sed -e "s|^/*||"`" + +# Run rmdir command +cd "$KEYDIR/$RELATIVE_PATH" && rmdir $ARGS +cd "$CWD" diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index c3a8a7c..1cd7a45 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -62,6 +62,9 @@ ls <*path*> mkdir <*path*> : Create a directory inside the repository *keys* folder. +:rmdir <*path*> +: Remove an empty folder inside the repository *keys* folder. + tree <*path*> : List contents from the toplevel repository *keys* folder or from relative paths if *path* is specified using a tree-like format. Like the ls wrapper, this is a @@ -116,6 +119,9 @@ del <*secret*> rm <*secret*> : Alias for *del* action. +mv <*secret*> <*dest*> +: Rename a secret. + edit <*secret*> : Edit a secret by temporarily decrypting it, opening the decrypted copy into the text editor defined by the *$EDITOR* environment variable and then re-encrypting it. -- cgit v1.2.3 From 8f6d44786eda47e945feb209a48afea59939b597 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 12 Feb 2014 13:49:03 -0200 Subject: ChangeLog update --- ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 401fc64..17f343e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2013-12-26 - Silvio Rhatto +2014-02-12 - Silvio Rhatto + + Check key expirations (#37) + + Proper error handling at edit action New actions: find, mv, rmdir -- cgit v1.2.3 From 9b26f57a726ccb582f41c19c7c3bbcef3225c12d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 19 Feb 2014 23:38:36 -0300 Subject: Adding xclip action thanks to password-store --- ChangeLog | 4 +++- lib/keyringer/actions/clip | 1 + lib/keyringer/actions/xclip | 53 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 120000 lib/keyringer/actions/clip create mode 100755 lib/keyringer/actions/xclip (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 17f343e..f94fb74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -2014-02-12 - Silvio Rhatto +2014-02-19 - Silvio Rhatto + + Added xclip action (#33) Check key expirations (#37) diff --git a/lib/keyringer/actions/clip b/lib/keyringer/actions/clip new file mode 120000 index 0000000..8b8c16c --- /dev/null +++ b/lib/keyringer/actions/clip @@ -0,0 +1 @@ +xclip \ No newline at end of file diff --git a/lib/keyringer/actions/xclip b/lib/keyringer/actions/xclip new file mode 100755 index 0000000..414013b --- /dev/null +++ b/lib/keyringer/actions/xclip @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Decrypt secret header to clipboard. +# + +# Copy contents to clipboard. +# Function thanks to Password Store by Jason A. Donenfeld +# distributed under GPLv2+: http://www.zx2c4.com/projects/password-store/ +clip() { + # This base64 business is a disgusting hack to deal with newline inconsistancies + # in shell. There must be a better way to deal with this, but because I'm a dolt, + # we're going with this for now. + + before="$(xclip -o -selection clipboard | base64)" + echo -n "$1" | xclip -selection clipboard + ( + sleep 45 + now="$(xclip -o -selection clipboard | base64)" + if [[ $now != $(echo -n "$1" | base64) ]]; then + before="$now" + fi + + # It might be nice to programatically check to see if klipper exists, + # as well as checking for other common clipboard managers. But for now, + # this works fine -- if qdbus isn't there or if klipper isn't running, + # this essentially becomes a no-op. + # + # Clipboard managers frequently write their history out in plaintext, + # so we axe it here: + qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null + + echo "$before" | base64 -d | xclip -selection clipboard + ) & disown + echo "Copied $2 to clipboard. Will clear in 45 seconds." +} + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Get file +keyringer_get_file "$2" + +# Decrypt +pass="$($GPG --use-agent -d "$KEYDIR/$FILE" | head -n 1)" + +# Copy to clipboard +if [ ! -z "$pass" ]; then + clip "$pass" "$2" +fi + +# Exit +exit "$?" -- cgit v1.2.3 From 261ab10ad467b0ec0f69ef6c1423c1b7609fc0c5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 20 Feb 2014 00:22:30 -0300 Subject: ChangeLog update --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index f94fb74..16617c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-02-19 - Silvio Rhatto + Try to find a similar file at keyringer_get_file + Added xclip action (#33) Check key expirations (#37) -- cgit v1.2.3 From 013726598e074399344c0bf435e057bc8049959a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 20 Feb 2014 11:09:18 -0300 Subject: Keyringer 0.3 --- ChangeLog | 4 +--- keyringer | 2 +- share/man/keyringer.1 | 55 ++++++++++++++++++++++++++++++++++++++++++++++ share/man/keyringer.1.mdwn | 5 ++++- 4 files changed, 61 insertions(+), 5 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 16617c9..e7f7cf7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2014-02-19 - Silvio Rhatto +2014-02-20 - 0.3 - Silvio Rhatto Try to find a similar file at keyringer_get_file @@ -12,8 +12,6 @@ Support for RELATIVE_FOLDER at git action -2013-12-10 - Silvio Rhatto - New actions: shell (#34), help, mkdir, teardown 2013-11-26 - 0.2.9 Silvio Rhatto diff --git a/keyringer b/keyringer index cc8378f..0930637 100755 --- a/keyringer +++ b/keyringer @@ -122,7 +122,7 @@ function keyringer_dispatch { # Config NAME="keyringer" -KEYRINGER_VERSION="0.2.9" +KEYRINGER_VERSION="0.3" CONFIG_VERSION="0.1" CONFIG_BASE="$HOME/.$NAME" CONFIG="$CONFIG_BASE/config" diff --git a/share/man/keyringer.1 b/share/man/keyringer.1 index c0fed1c..8402b9c 100644 --- a/share/man/keyringer.1 +++ b/share/man/keyringer.1 @@ -31,6 +31,11 @@ and other read/write operations on secrets. Configuration actions, handling repository metadata. .SH REPOSITORY LOOKUP AND MANIPULATION ACTIONS .TP +.B find <\f[I]expression\f[]> +Find secrets in the repository. +.RS +.RE +.TP .B init <\f[I]path\f[]> [\f[I]remote\f[]] Initialize a new keyringer repository. If a \f[I]remote\f[] URL is specified, keyringer will clone an existing @@ -60,6 +65,16 @@ command. .RS .RE .TP +.B mkdir <\f[I]path\f[]> +Create a directory inside the repository \f[I]keys\f[] folder. +.RS +.RE +.TP +.B :rmdir <\f[I]path\f[]> +Remove an empty folder inside the repository \f[I]keys\f[] folder. +.RS +.RE +.TP .B tree <\f[I]path\f[]> List contents from the toplevel repository \f[I]keys\f[] folder or from relative paths if \f[I]path\f[] is specified using a tree-like format. @@ -67,6 +82,25 @@ Like the ls wrapper, this is a wrapper around the \f[I]TREE(1)\f[] command. .RS .RE +.TP +.B shell +Run keyringer on interactive mode from a built-in command-line prompt +where all other actions can be called and are operated from the current +selected keyring. +.RS +.PP +An additional "cd" internal command is available for directory +navigation. +.PP +All <\f[I]secret\f[]> parameters from actions invoked from the shell are +called relatively from the current selected directory. +.RE +.TP +.B teardown +Remove permanently a local copy of a repository, very dangerous if you +have just a single copy. +.RS +.RE .SH SECRET MANIPULATION ACTIONS .PP All secret manipulation actions operate upon a \f[I]secret\f[] which is @@ -115,6 +149,11 @@ Alias for \f[I]del\f[] action. .RS .RE .TP +.B mv <\f[I]secret\f[]> <\f[I]dest\f[]> +Rename a secret. +.RS +.RE +.TP .B edit <\f[I]secret\f[]> Edit a secret by temporarily decrypting it, opening the decrypted copy into the text editor defined by the \f[I]$EDITOR\f[] environment @@ -162,6 +201,17 @@ If no \f[I]secret\f[] is given, all secrets in the repository are re-encrypted. .RS .RE +.TP +.B clip <\f[I]secret\f[]> +Copy the first line of a secret to the clipboard, following +password-store convention. +.RS +.RE +.TP +.B xclip <\f[I]secret\f[]> +Alis to clip action. +.RS +.RE .SH CONFIGURATION ACTIONS .TP .B commands @@ -200,6 +250,11 @@ Show keyringer usage information. .RS .RE .TP +.B help +Alias for usage action. +.RS +.RE +.TP .B recipients <\f[I]ls\f[]|\f[I]edit\f[]> <\f[I]recipients-file\f[]> List, create or edit recipients configuration. .RS diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index ccaabdf..e8df829 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -150,9 +150,12 @@ recrypt <*secret*> into the recipient configuration. If no *secret* is given, all secrets in the repository are re-encrypted. -clip <*secret*>, xclip <*secret*> +clip <*secret*> : Copy the first line of a secret to the clipboard, following password-store convention. +xclip <*secret*> +: Alis to clip action. + # CONFIGURATION ACTIONS commands -- cgit v1.2.3