From db173412aa7f2477957b9d6d18b01335a9a000d4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 26 Nov 2013 17:10:12 -0200 Subject: Makefile: release target with --use-agent support --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 360bd29..d6ef5a4 100644 --- a/Makefile +++ b/Makefile @@ -58,5 +58,5 @@ release: git commit -a -m "Keyringer $(VERSION)" git tag -s $(VERSION) -m "Keyringer $(VERSION)" @make tarball - gpg --armor --detach-sign --output ../tarballs/keyringer-$(VERSION).tar.bz2.asc ../tarballs/keyringer-$(VERSION).tar.bz2 + gpg --use-agent --armor --detach-sign --output ../tarballs/keyringer-$(VERSION).tar.bz2.asc ../tarballs/keyringer-$(VERSION).tar.bz2 scp ../tarballs/keyringer-$(VERSION).tar.bz2* keyringer:/var/sites/keyringer/releases/ -- cgit v1.2.3 From 6b9047ced36c0b68ed720e48e03c493959d92be7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 26 Nov 2013 17:39:42 -0200 Subject: Makefile: tag release after signing the tarball --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d6ef5a4..42f6d9b 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,9 @@ tarball: release: @make build_man git commit -a -m "Keyringer $(VERSION)" - git tag -s $(VERSION) -m "Keyringer $(VERSION)" @make tarball gpg --use-agent --armor --detach-sign --output ../tarballs/keyringer-$(VERSION).tar.bz2.asc ../tarballs/keyringer-$(VERSION).tar.bz2 scp ../tarballs/keyringer-$(VERSION).tar.bz2* keyringer:/var/sites/keyringer/releases/ + # We're doing tagging afterwards: + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568375 + git tag -s $(VERSION) -m "Keyringer $(VERSION)" -- cgit v1.2.3 From f2334e9e16bc2aa85a619e606cc2a38211544675 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 27 Nov 2013 11:27:20 -0200 Subject: Development: debian branch tagging --- development.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/development.mdwn b/development.mdwn index 3400643..1f475b6 100644 --- a/development.mdwn +++ b/development.mdwn @@ -60,6 +60,7 @@ Update the debian branch: git-import-orig --upstream-vcs-tag=$VERSION ../tarballs/keyringer-$VERSION.tar.bz2 dch -e # fine tune the changelog prepared by git-dch git commit -a -m "Updating debian/changelog" + git tag -s debian_keyringer_$VERSION-1 -m "Keyringer debian package $VERSION-1" Push everything: -- cgit v1.2.3 From 60603e9479414a67f96849f99851ef2749693f49 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 12:52:56 -0200 Subject: Initial implementation for keyringer shell (#34) --- keyringer | 1 + lib/keyringer/actions/shell | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 lib/keyringer/actions/shell diff --git a/keyringer b/keyringer index 11b8aa1..e65bef0 100755 --- a/keyringer +++ b/keyringer @@ -135,6 +135,7 @@ set -f export PREFERENCES="`dirname $CONFIG`/$KEYRING" export KEYRINGER_VERSION export CONFIG_VERSION +export KEYRING # Set functions location if [ -e "`dirname $(readlink -f $0)`/lib/$NAME/functions" ]; then diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell new file mode 100755 index 0000000..c70d6bb --- /dev/null +++ b/lib/keyringer/actions/shell @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Interactive shell. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# While a "quit" command isn't entered, read STDIN +while read -rep "keyringer:/> " STDIN; do + if [ "$STDIN" == "quit" ]; then + break + # If line is not empty or commented, process command + elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then + keyringer "$KEYRING" $STDIN + fi +done -- cgit v1.2.3 From cd69cba65cdb39135f44d83537869086ed2330b0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 13:23:06 -0200 Subject: Initial code for 'cd' shell command (#34) --- lib/keyringer/actions/shell | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index c70d6bb..d8a0ef7 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -7,12 +7,38 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Basic parameters +SHELLPATH="/" + # While a "quit" command isn't entered, read STDIN -while read -rep "keyringer:/> " STDIN; do +while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do if [ "$STDIN" == "quit" ]; then break - # If line is not empty or commented, process command + elif [[ "$STDIN" == "cd"* ]]; then + + # Update current path + OLDPATH="$SHELLPATH" + SHELLPATH="/`echo $STDIN | sed -e 's/^cd//' | cut -d ' ' -f 2`" + + # Fix current path + if [ "$SHELLPATH" == "/" ]; then + SHELLPATH="/" + elif [[ "$SHELLPATH" == "/.."* ]]; then + ARGS="$SHELLPATH" + SHELLPATH="$OLDPATH" + for colons in `echo $ARGS | sed -e 's|/| |g'`; do + SHELLPATH="`dirname $SHELLPATH`" + done + fi + + # Check if path exists + if [ ! -d "$KEYDIR/$SHELLPATH" ]; then + echo "No such folder $SHELLPATH" + SHELLPATH="$OLDPATH" + fi + elif [[ -n "$STDIN" && "$STDIN" != "#"* ]]; then - keyringer "$KEYRING" $STDIN + # If line is not empty or commented, process command + RELATIVE_PATH="$SHELLPATH" keyringer "$KEYRING" $STDIN fi done -- cgit v1.2.3 From f695f7810ac91d9cd3f576dcb58f41e75e720129 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 13:38:46 -0200 Subject: Enhanced 'cd' behavior (#34) --- lib/keyringer/actions/shell | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index d8a0ef7..d9a3e07 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -18,19 +18,27 @@ while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do # Update current path OLDPATH="$SHELLPATH" - SHELLPATH="/`echo $STDIN | sed -e 's/^cd//' | cut -d ' ' -f 2`" + SHELLPATH="`echo $STDIN | sed -e 's/^cd//' | cut -d ' ' -f 2`" # Fix current path - if [ "$SHELLPATH" == "/" ]; then + if [ "$SHELLPATH" == "/" ] || [ "$SHELLPATH" == "" ]; then SHELLPATH="/" - elif [[ "$SHELLPATH" == "/.."* ]]; then + elif [[ "$SHELLPATH" == ".."* ]]; then ARGS="$SHELLPATH" SHELLPATH="$OLDPATH" for colons in `echo $ARGS | sed -e 's|/| |g'`; do - SHELLPATH="`dirname $SHELLPATH`" + SHELLPATH="`dirname $SHELLPATH | sed -e 's|^\.||'`" done fi + # Ensure path is absolute + if echo "$SHELLPATH" | grep -v -q -e "^/"; then + SHELLPATH="/$OLDPATH/$SHELLPATH" + fi + + # Removing multiple slashes + SHELLPATH="`echo $SHELLPATH | sed -e 's/\/\+/\//g'`" + # Check if path exists if [ ! -d "$KEYDIR/$SHELLPATH" ]; then echo "No such folder $SHELLPATH" -- cgit v1.2.3 From a8c1608fee73578358c3c17f76b44f0857c38ac0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 14:15:51 -0200 Subject: Integrating shell with all commands (#34) --- keyringer | 3 ++- lib/keyringer/actions/append | 4 ++-- lib/keyringer/actions/decrypt | 2 +- lib/keyringer/actions/del | 2 +- lib/keyringer/actions/edit | 2 +- lib/keyringer/actions/encrypt | 4 ++-- lib/keyringer/actions/genpair | 2 +- lib/keyringer/actions/help | 1 + lib/keyringer/actions/ls | 2 +- lib/keyringer/actions/recrypt | 2 +- lib/keyringer/actions/shell | 4 +++- lib/keyringer/actions/tree | 2 +- lib/keyringer/actions/usage | 2 +- lib/keyringer/functions | 5 +++-- 14 files changed, 21 insertions(+), 16 deletions(-) create mode 120000 lib/keyringer/actions/help diff --git a/keyringer b/keyringer index e65bef0..33d19ff 100755 --- a/keyringer +++ b/keyringer @@ -131,11 +131,12 @@ ACTION="$2" # Turn off pathname expansion so expansion can work properly set -f -# Export preferences and version for other scripts +# Export globals for other scripts export PREFERENCES="`dirname $CONFIG`/$KEYRING" export KEYRINGER_VERSION export CONFIG_VERSION export KEYRING +export CONFIG # Set functions location if [ -e "`dirname $(readlink -f $0)`/lib/$NAME/functions" ]; then diff --git a/lib/keyringer/actions/append b/lib/keyringer/actions/append index e307056..818a7ac 100755 --- a/lib/keyringer/actions/append +++ b/lib/keyringer/actions/append @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$2" +keyringer_get_file "$RELATIVE_PATH/$2" # Only display directions if we're running append, not append-batch if [ "$BASENAME" == "append" ]; then @@ -17,4 +17,4 @@ fi # Append content to an existing secret ( keyringer_exec decrypt "$BASEDIR" "$FILE" && cat ) | \ - keyringer_exec encrypt-batch $BASEDIR $FILE + keyringer_exec encrypt-batch "$BASEDIR" "$FILE" diff --git a/lib/keyringer/actions/decrypt b/lib/keyringer/actions/decrypt index 2b1401c..aab7881 100755 --- a/lib/keyringer/actions/decrypt +++ b/lib/keyringer/actions/decrypt @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$2" +keyringer_get_file "$RELATIVE_PATH/$2" # Decrypt $GPG --quiet --use-agent -d "$KEYDIR/$FILE" diff --git a/lib/keyringer/actions/del b/lib/keyringer/actions/del index d160ac4..a2514d7 100755 --- a/lib/keyringer/actions/del +++ b/lib/keyringer/actions/del @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$2" +keyringer_get_file "$RELATIVE_PATH/$2" # Set options if [ ! -z "$3" ]; then diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 9a3e488..d303bd5 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$2" +keyringer_get_file "$RELATIVE_PATH/$2" # Set recipients file keyringer_set_recipients "$FILE" diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index 0a40bc1..526eaa1 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -65,7 +65,7 @@ if [ ! -z "$3" ]; then FILE="$BASEPATH" fi - keyringer_get_new_file $FILE + keyringer_get_new_file $RELATIVE_PATH/$FILE if [ ! -e "$UNENCRYPTED_FILE" ]; then echo "Error: cannot encrypt $UNENCRYPTED_FILE: path not found." @@ -74,7 +74,7 @@ if [ ! -z "$3" ]; then else UNENCRYPTED_FILE="-" shift - keyringer_get_new_file $* + keyringer_get_new_file $RELATIVE_PATH/$* fi # Set recipients file diff --git a/lib/keyringer/actions/genpair b/lib/keyringer/actions/genpair index f048bc7..6898b0f 100755 --- a/lib/keyringer/actions/genpair +++ b/lib/keyringer/actions/genpair @@ -184,7 +184,7 @@ source "$LIB" || exit 1 # Aditional parameters KEYTYPE="$2" -FILE="$3" +FILE="$RELATIVE_PATH/$3" NODE="$4" OUTFILE="$5" CWD="`pwd`" diff --git a/lib/keyringer/actions/help b/lib/keyringer/actions/help new file mode 120000 index 0000000..ae18295 --- /dev/null +++ b/lib/keyringer/actions/help @@ -0,0 +1 @@ +usage \ No newline at end of file diff --git a/lib/keyringer/actions/ls b/lib/keyringer/actions/ls index bb66263..93f5f75 100755 --- a/lib/keyringer/actions/ls +++ b/lib/keyringer/actions/ls @@ -15,5 +15,5 @@ shift ARGS="`echo "$*" | sed -e "s|^/*||"`" # Run list command -cd "$KEYDIR" && ls $ARGS +cd "$KEYDIR/$RELATIVE_PATH" && ls $ARGS cd "$CWD" diff --git a/lib/keyringer/actions/recrypt b/lib/keyringer/actions/recrypt index 014fef7..7d5c6ae 100755 --- a/lib/keyringer/actions/recrypt +++ b/lib/keyringer/actions/recrypt @@ -9,7 +9,7 @@ source "$LIB" || exit 1 function keyringer_recrypt { # Get file - keyringer_get_file "$1" + keyringer_get_file "$RELATIVE_PATH/$1" # Set recipients file keyringer_set_recipients "$FILE" diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index d9a3e07..955dfe8 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -12,8 +12,10 @@ SHELLPATH="/" # While a "quit" command isn't entered, read STDIN while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do - if [ "$STDIN" == "quit" ]; then + if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then break + elif [ "$STDIN" == "shell" ]; then + echo "Why you need nesting?" elif [[ "$STDIN" == "cd"* ]]; then # Update current path diff --git a/lib/keyringer/actions/tree b/lib/keyringer/actions/tree index 8e94cb0..a2e272d 100755 --- a/lib/keyringer/actions/tree +++ b/lib/keyringer/actions/tree @@ -27,5 +27,5 @@ else fi # Run list command -cd "$KEYDIR" && $TREE $ARGS +cd "$KEYDIR/$RELATIVE_PATH" && $TREE $ARGS cd "$CWD" diff --git a/lib/keyringer/actions/usage b/lib/keyringer/actions/usage index f4ac0fa..e3369cc 100755 --- a/lib/keyringer/actions/usage +++ b/lib/keyringer/actions/usage @@ -7,4 +7,4 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 -keyringer_usage +keyringer_usage $KEYRING diff --git a/lib/keyringer/functions b/lib/keyringer/functions index bef00d9..f387c46 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -474,9 +474,10 @@ function keyringer_usage { printf "Usage: %s [arguments]\n\n" "$BASENAME" printf "Available commands: \n\n" keyringer_show_actions | sed -e 's/^/\t/' - printf "\tinit [remote]\n\n" $BASENAME - if [ ! -z "$keyrings" ]; then + # Display only when not in a keyring context + if [ ! -z "$keyrings" ] && [ -z "$1" ]; then + printf "\tinit [remote]\n\n" $BASENAME printf "Available keyrings: %s \n" "$keyrings" fi } -- cgit v1.2.3 From 47ea7016dc8e5cd8dff3603243aa95fa5f31dbff Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 17:25:07 -0200 Subject: Using RELATIVE_PATH directly at keyringer_get_file and keyringer_get_new_file --- lib/keyringer/actions/append | 2 +- lib/keyringer/actions/decrypt | 2 +- lib/keyringer/actions/del | 2 +- lib/keyringer/actions/edit | 2 +- lib/keyringer/actions/encrypt | 4 ++-- lib/keyringer/actions/recrypt | 2 +- lib/keyringer/functions | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/keyringer/actions/append b/lib/keyringer/actions/append index 818a7ac..fbb6c1c 100755 --- a/lib/keyringer/actions/append +++ b/lib/keyringer/actions/append @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$RELATIVE_PATH/$2" +keyringer_get_file "$2" # Only display directions if we're running append, not append-batch if [ "$BASENAME" == "append" ]; then diff --git a/lib/keyringer/actions/decrypt b/lib/keyringer/actions/decrypt index aab7881..2b1401c 100755 --- a/lib/keyringer/actions/decrypt +++ b/lib/keyringer/actions/decrypt @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$RELATIVE_PATH/$2" +keyringer_get_file "$2" # Decrypt $GPG --quiet --use-agent -d "$KEYDIR/$FILE" diff --git a/lib/keyringer/actions/del b/lib/keyringer/actions/del index a2514d7..d160ac4 100755 --- a/lib/keyringer/actions/del +++ b/lib/keyringer/actions/del @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$RELATIVE_PATH/$2" +keyringer_get_file "$2" # Set options if [ ! -z "$3" ]; then diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index d303bd5..9a3e488 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -8,7 +8,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 # Get file -keyringer_get_file "$RELATIVE_PATH/$2" +keyringer_get_file "$2" # Set recipients file keyringer_set_recipients "$FILE" diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index 526eaa1..0a40bc1 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -65,7 +65,7 @@ if [ ! -z "$3" ]; then FILE="$BASEPATH" fi - keyringer_get_new_file $RELATIVE_PATH/$FILE + keyringer_get_new_file $FILE if [ ! -e "$UNENCRYPTED_FILE" ]; then echo "Error: cannot encrypt $UNENCRYPTED_FILE: path not found." @@ -74,7 +74,7 @@ if [ ! -z "$3" ]; then else UNENCRYPTED_FILE="-" shift - keyringer_get_new_file $RELATIVE_PATH/$* + keyringer_get_new_file $* fi # Set recipients file diff --git a/lib/keyringer/actions/recrypt b/lib/keyringer/actions/recrypt index 7d5c6ae..014fef7 100755 --- a/lib/keyringer/actions/recrypt +++ b/lib/keyringer/actions/recrypt @@ -9,7 +9,7 @@ source "$LIB" || exit 1 function keyringer_recrypt { # Get file - keyringer_get_file "$RELATIVE_PATH/$1" + keyringer_get_file "$1" # Set recipients file keyringer_set_recipients "$FILE" diff --git a/lib/keyringer/functions b/lib/keyringer/functions index f387c46..872dac9 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -398,7 +398,7 @@ function keyringer_upgrade { # Get a file argument function keyringer_get_file { - FILE="$(keyringer_filename "$1")" + FILE="$(keyringer_filename "$RELATIVE_PATH/$1")" if [ -z "$FILE" ]; then keyringer_action_usage @@ -427,7 +427,7 @@ function keyringer_get_new_file { fi # Complete file name - FILE="$(keyringer_filename "$FILE")" + FILE="$RELATIVE_PATH/$(keyringer_filename "$FILE")" if [ -z "$*" ]; then keyringer_action_usage -- cgit v1.2.3 From f58aac98a069c694d2a5791eb96a7554af6b798f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 17:36:04 -0200 Subject: Run shell by default (#34) --- keyringer | 10 ++++++---- lib/keyringer/actions/shell | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/keyringer b/keyringer index 33d19ff..9c45d97 100755 --- a/keyringer +++ b/keyringer @@ -162,12 +162,14 @@ source "$LIB" || exit 1 # Setup main configuration and load preferences keyringer_config_load -if [ -z "$ACTION" ]; then +# Dispatch +if [ -z "$KEYRING" ]; then keyringer_usage exit 1 -fi - -if [ "$ACTION" == "init" ]; then +elif [ -z "$ACTION" ]; then + # Run shell if no action were given + keyringer $KEYRING shell +elif [ "$ACTION" == "init" ]; then keyringer_init $* elif keyringer_has_action "$ACTION"; then keyringer_dispatch $* diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index 955dfe8..ab170b1 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -10,6 +10,9 @@ source "$LIB" || exit 1 # Basic parameters SHELLPATH="/" +# Show usage +keyringer_usage $KEYRING + # While a "quit" command isn't entered, read STDIN while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then -- cgit v1.2.3 From 2409a2c5bcdfd43c61072545e23148e9e9c6ca67 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 18:45:10 -0200 Subject: Adding 'shell' and 'help' to manpage (#34) --- share/man/keyringer.1.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index d4b71e3..b383507 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -61,6 +61,16 @@ tree <*path*> if *path* is specified using a tree-like format. Like the ls wrapper, this is a wrapper around the *TREE(1)* command. +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. + + An additional "cd" internal command is available for directory navigation. + + All <*secret*> parameters from actions invoked from the shell are called + relatively from the current selected directory. + # SECRET MANIPULATION ACTIONS All secret manipulation actions operate upon a *secret* which is the pathname @@ -151,6 +161,9 @@ preferences <*ls*|*edit*|*add*> usage : Show keyringer usage information. +help +: Alias for usage action. + recipients <*ls*|*edit*> <*recipients-file*> : List, create or edit recipients configuration. -- cgit v1.2.3 From d3c34db2f307d86209235832db8b9c04a2942405 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 18:48:53 -0200 Subject: Adding mkdir action (#34) --- lib/keyringer/actions/mkdir | 19 +++++++++++++++++++ share/man/keyringer.1.mdwn | 3 +++ 2 files changed, 22 insertions(+) create mode 100755 lib/keyringer/actions/mkdir diff --git a/lib/keyringer/actions/mkdir b/lib/keyringer/actions/mkdir new file mode 100755 index 0000000..b31eb0b --- /dev/null +++ b/lib/keyringer/actions/mkdir @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Create 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 mkdir command +cd "$KEYDIR/$RELATIVE_PATH" && mkdir -p $ARGS +cd "$CWD" diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index b383507..f8d243e 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -56,6 +56,9 @@ ls <*path*> if *path* is specified. Like the git wrapper, this is a wrapper around the *LS(1)* command. +mkdir <*path*> +: Create a directory 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 -- cgit v1.2.3 From b2b3a02e33c9efbbfce46a658360189ecc8dda2a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 18:51:38 -0200 Subject: Adding shell completions for 'mkdir' action (#34) --- lib/keyringer/completions/bash/keyringer | 2 +- lib/keyringer/completions/zsh/_keyringer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index eeda27f..5474c67 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -94,7 +94,7 @@ _keyringer() { recipients) opts="ls edit" ;; - ls|tree|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)" ;; diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer index 5717b00..0eba079 100644 --- a/lib/keyringer/completions/zsh/_keyringer +++ b/lib/keyringer/completions/zsh/_keyringer @@ -50,7 +50,7 @@ _keyringer() { recipients) compadd "$@" ls edit ;; - ls|tree|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash compadd "$@" $(KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null) ;; -- cgit v1.2.3 From 21e393464645c76c949d74180ce04b7507e0d738 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 22:13:25 -0200 Subject: Adding 'teardown' action --- development.mdwn | 4 +--- lib/keyringer/actions/teardown | 27 +++++++++++++++++++++++++++ lib/keyringer/functions | 13 ++++++++++--- share/man/keyringer.1.mdwn | 4 ++++ 4 files changed, 42 insertions(+), 6 deletions(-) create mode 100755 lib/keyringer/actions/teardown diff --git a/development.mdwn b/development.mdwn index 1f475b6..8366b59 100644 --- a/development.mdwn +++ b/development.mdwn @@ -102,9 +102,7 @@ Setup: Teardown: - rm -rf ~/code/tests/keyringer - rm ~/.keyringer/test - sed -i -e '/^test=/d' ~/.keyringer/config + keyringer test teardown -y Translation ----------- diff --git a/lib/keyringer/actions/teardown b/lib/keyringer/actions/teardown new file mode 100755 index 0000000..3d33da4 --- /dev/null +++ b/lib/keyringer/actions/teardown @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Remove a keyring. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Options +CONFIRM="$2" + +if [ -z "$CONFIRM" ] || [ "$CONFIRM" != "-y" ]; then + echo "WARNING: about to remove the LOCAL copy of $KEYRING" + echo "WARNING: This will irrevocably destroy $KEYDIR" + echo "WARNING: the action cannot be undone!" + + read -rep "Are you sure to WIPE keyring $KEYRING (type YES to confirm)? " key + if [ "$key" != "YES" ]; then + exit 1 + fi +fi + +# Teardown +keyringer_shred `dirname $KEYDIR` +keyringer_shred $HOME/.keyringer/$KEYRING +sed -i -e "/^$KEYRING=/d" $HOME/.keyringer/config diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 872dac9..0e795ee 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -206,10 +206,17 @@ function keyringer_shred { echo "$message $path using $tool..." if [ -d "$path" ]; then - find $path -exec $tool -f {} \; - rmdir $path + if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ]; then + $tool -rf $path + else + find $path -exec $tool -uf {} \; + fi else - $tool -f "$path" + if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ]; then + $tool -f "$path" + else + $tool -uf "$path" + fi fi } diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index f8d243e..ad9569b 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -74,6 +74,10 @@ shell All <*secret*> parameters from actions invoked from the shell are called relatively from the current selected directory. +teardown +: Remove permanently a local copy of a repository, very dangerous if you + have just a single copy. + # SECRET MANIPULATION ACTIONS All secret manipulation actions operate upon a *secret* which is the pathname -- cgit v1.2.3 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(-) 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 7aac0eea6ab0690e040ffe2ed2eab4adde8d5ead Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 22:32:59 -0200 Subject: Fix instance list at shell completions --- lib/keyringer/completions/bash/keyringer | 4 ++-- lib/keyringer/completions/zsh/_keyringer | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index 5474c67..eb8fabd 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -70,10 +70,10 @@ _keyringer() { # Process config source $config/config - keyrings="`ls --color=never $config | sed -e 's/config//' | xargs`" + keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`" # Available instances - instances="`echo $keyrings | sed -e 's/ /\\\|/g'`" + instances="`echo $keyrings | sed -e 's/ /$\\\|^/g' -e 's/^/^/' -e 's/$/$/'`" # The current instance instance="${COMP_WORDS[1]}" diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer index 0eba079..e889fd8 100644 --- a/lib/keyringer/completions/zsh/_keyringer +++ b/lib/keyringer/completions/zsh/_keyringer @@ -20,9 +20,9 @@ _keyringer() { # Process config source $config/config - local keyrings="`ls --color=never $config | sed -e 's/config//' | xargs`" + local keyrings="`ls --color=never $config | sed -e '/^config$/d' | xargs`" local keyring_path="`eval echo '$'$words[2]`" - local instances="`echo $keyrings | sed -e 's/ /\\\|/g'`" + local instances="`echo $keyrings | sed -e 's/ /$\\\|^/g' -e 's/^/^/' -e 's/$/$/'`" _arguments \ '1: :->keyring' \ -- cgit v1.2.3 From b4bdeafcf666b6f7a6f3f33e9f4cf1fb0a7cebbf Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 22:43:14 -0200 Subject: Comments --- lib/keyringer/actions/commands | 1 + lib/keyringer/actions/edit | 1 + lib/keyringer/actions/encrypt | 4 +++- lib/keyringer/actions/options | 1 + lib/keyringer/actions/preferences | 3 +++ lib/keyringer/actions/recipients | 1 + lib/keyringer/actions/recrypt | 2 ++ lib/keyringer/actions/teardown | 1 + lib/keyringer/actions/tree | 2 +- lib/keyringer/actions/usage | 1 + 10 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/keyringer/actions/commands b/lib/keyringer/actions/commands index 2605666..cb49c02 100755 --- a/lib/keyringer/actions/commands +++ b/lib/keyringer/actions/commands @@ -7,4 +7,5 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Dispatch keyringer_show_actions diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 9a3e488..5f31aa0 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -24,6 +24,7 @@ keyringer_set_tmpfile $BASENAME.$EXTENSION # Decrypt the information to the file $GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE" +# Action check if [ "$BASENAME" == "edit" ]; then APP="$EDITOR" elif [ "$BASENAME" == "open" ]; then diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index 0a40bc1..e9bf453 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -106,12 +106,13 @@ else keyringer_encrypt $FILE $UNENCRYPTED_FILE fi +# Check exit status err="$?" - if [ "$err" != "0" ]; then exit "$err" fi +# Wipe information if [ "$UNENCRYPTED_FILE" != "-" ]; then echo "Done. PLEASE WIPE the non-encrypted $UNENCRYPTED_FILE." fi @@ -121,4 +122,5 @@ if [ -d "$BASEDIR/.git" ]; then keyringer_exec git "$BASEDIR" add "keys/$FILE" fi +# Done exit "$?" diff --git a/lib/keyringer/actions/options b/lib/keyringer/actions/options index 8508aea..3bf0e43 100755 --- a/lib/keyringer/actions/options +++ b/lib/keyringer/actions/options @@ -17,6 +17,7 @@ if [ ! -e "$OPTIONS" ]; then keyringer_exec git "$BASEDIR" add config/options fi +# Dispatch if [ "$COMMAND" == "ls" ]; then cat "$OPTIONS" elif [ "$COMMAND" == "edit" ]; then diff --git a/lib/keyringer/actions/preferences b/lib/keyringer/actions/preferences index e82848d..f7507a7 100755 --- a/lib/keyringer/actions/preferences +++ b/lib/keyringer/actions/preferences @@ -7,8 +7,10 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Options COMMAND="$2" +# Syntax check if [ -z "$COMMAND" ]; then echo "Usage: keyringer preferences [arguments]" echo "Available commands:" @@ -24,6 +26,7 @@ if [ ! -e "$PREFERENCES" ]; then touch "$PREFERENCES" fi +# Dispatch if [ "$COMMAND" == "ls" ]; then cat "$PREFERENCES" elif [ "$COMMAND" == "edit" ]; then diff --git a/lib/keyringer/actions/recipients b/lib/keyringer/actions/recipients index 7093a6b..4149786 100755 --- a/lib/keyringer/actions/recipients +++ b/lib/keyringer/actions/recipients @@ -13,6 +13,7 @@ keyringer_get_command "$2" # Set recipients file keyringer_set_new_recipients "$3" +# Syntax check and dispatcher if [ "$COMMAND" == "ls" ]; then if [ ! -z "$3" ]; then if [ -e "$RECIPIENTS_FILE" ]; then diff --git a/lib/keyringer/actions/recrypt b/lib/keyringer/actions/recrypt index 014fef7..696399b 100755 --- a/lib/keyringer/actions/recrypt +++ b/lib/keyringer/actions/recrypt @@ -7,6 +7,7 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Recrypt a single secret function keyringer_recrypt { # Get file keyringer_get_file "$1" @@ -34,6 +35,7 @@ function keyringer_recrypt { echo "$recrypted" > "$KEYDIR/$FILE" } +# Syntax check and dispatcher if [ ! -z "$2" ]; then keyringer_recrypt $2 else diff --git a/lib/keyringer/actions/teardown b/lib/keyringer/actions/teardown index 3d33da4..64da740 100755 --- a/lib/keyringer/actions/teardown +++ b/lib/keyringer/actions/teardown @@ -10,6 +10,7 @@ source "$LIB" || exit 1 # Options CONFIRM="$2" +# Confirmation if [ -z "$CONFIRM" ] || [ "$CONFIRM" != "-y" ]; then echo "WARNING: about to remove the LOCAL copy of $KEYRING" echo "WARNING: This will irrevocably destroy $KEYDIR" diff --git a/lib/keyringer/actions/tree b/lib/keyringer/actions/tree index a2e272d..8f9d7cd 100755 --- a/lib/keyringer/actions/tree +++ b/lib/keyringer/actions/tree @@ -1,6 +1,6 @@ #!/bin/bash # -# List keys. +# List keys, tree version. # # Thanks http://www.centerkey.com/tree/ diff --git a/lib/keyringer/actions/usage b/lib/keyringer/actions/usage index e3369cc..2ca7639 100755 --- a/lib/keyringer/actions/usage +++ b/lib/keyringer/actions/usage @@ -7,4 +7,5 @@ LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Dispatch keyringer_usage $KEYRING -- cgit v1.2.3 From 457c714dfa4a533074e51f91e90aea6b5cac78f9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 15 Dec 2013 13:27:56 -0200 Subject: Simplifying debian branch tagging --- development.mdwn | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/development.mdwn b/development.mdwn index 8366b59..cf969fe 100644 --- a/development.mdwn +++ b/development.mdwn @@ -60,7 +60,7 @@ Update the debian branch: git-import-orig --upstream-vcs-tag=$VERSION ../tarballs/keyringer-$VERSION.tar.bz2 dch -e # fine tune the changelog prepared by git-dch git commit -a -m "Updating debian/changelog" - git tag -s debian_keyringer_$VERSION-1 -m "Keyringer debian package $VERSION-1" + git-buildpackage --git-tag-only --git-sign-tags Push everything: @@ -75,10 +75,6 @@ Run lintian (or [add it to your pbuilder hooks](http://askubuntu.com/questions/1 lintian --info --display-info --pedantic --color auto \ ../build-area/keyringer_$VERSION*.changes -Create a signed tag in the debian branch: - - git-buildpackage --git-tag-only --git-sign-tags - Notes: * `git-import-orig` takes care of running `pristine-tar commit`, of merging of the tag and orig tarball into the upstream branch, and then it merges the result into the debian branch. With the above configuration, it also runs git-dch to do the bulk of the work in `debian/changelog`. -- cgit v1.2.3 From 4a177cb39d0f601150e166d6e2d28789ff5d4ca9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 20 Dec 2013 17:59:02 -0200 Subject: Doc cleanup --- index.mdwn | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/index.mdwn b/index.mdwn index 148da07..1a3fe52 100644 --- a/index.mdwn +++ b/index.mdwn @@ -1,6 +1,6 @@ [[!meta title="Keyringer: encrypted and distributed secret sharing software"]] -Keyringer lets you manage and share secrets using GPG and git with custom +Keyringer lets you manage and share secrets using GnuPG and Git with custom commands to encrypt, decrypt, recrypt, create key pairs, etc. - Project page: [https://keyringer.pw](https://keyringer.pw) @@ -73,6 +73,9 @@ Fill it with your friends key IDs. Now encrypt a secret just for then: In other words, if keyringer finds a recipient file matching a given path, it will use it instead of the global recipients file. +Each recipient list is defined in a file placed at `config/recipients` in your +keyring repository. Take care to add just trustable recipients. + Managing secrets ---------------- @@ -111,17 +114,18 @@ Appending information to a secret Editing a secret -To edit a secret, use - - keyringer edit + keyringer edit Use this option with caution as it keeps temporary unencrypted data -into keyringer temp folder and at your editor's temp files. +into a temporary folder. Listing secrets keyringer ls [arguments] +Each `` is stored as a file inside the `keys/` folder of your keyring +directory. + Git wrapper ----------- @@ -155,18 +159,6 @@ Example: keyringer preferences add KEYID=0123456789ABCDEF0123456789ABCDE012345678 -Notes ------ - - 1. The `` is any file inside the `keys/` folder of your - keyring directory. - - 2. Never decrypt a key and write it to the disk, except - if you're adding it to your personall keyring. - - 3. Recipients are defined at file `config/recipients`. - Take care to add just trustable recipients. - Concepts -------- @@ -207,6 +199,9 @@ given key), but it's possible to: - Or to consider an integration with gpg's --hidden-recipient option. +Never decrypt a key and write it to the disk, except if you're adding it to +your personall keyring. + Requirements ------------ -- cgit v1.2.3 From 4a19a5a2db0e49846249bf4b7ce02a2c6e143626 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 22 Dec 2013 13:22:00 -0200 Subject: Add missing '/.' test at keyringer_set_recipients --- lib/keyringer/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 0e795ee..de7516f 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -554,7 +554,7 @@ function keyringer_set_recipients { candidate_no_extension="`echo $1 | sed -e 's/.asc$//'`" # Find the first matching recipient - while [ ! -z "$candidate" ] && [ "$candidate" != "." ] && [ "$candidate" != "/" ]; do + while [ ! -z "$candidate" ] && [ "$candidate" != "." ] && [ "$candidate" != "/" ] && [ "$candidate" != "/." ]; do if [ -e "$RECIPIENTS/$candidate" ]; then RECIPIENTS_FILE="$RECIPIENTS/$candidate" RECIPIENTS_FILE_BASE="$RECIPIENTS_BASE/$candidate" -- 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 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 7468b6ec0df6aa6c594640154eecb02b12cca5e5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 26 Dec 2013 23:20:09 -0200 Subject: Support for RELATIVE_FOLDER at git action --- lib/keyringer/actions/git | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/keyringer/actions/git b/lib/keyringer/actions/git index 3c4f435..108ccea 100755 --- a/lib/keyringer/actions/git +++ b/lib/keyringer/actions/git @@ -12,5 +12,13 @@ CWD="`pwd`" # Run git command shift -mkdir -p "$BASEDIR" && cd "$BASEDIR" && git $* + +# Set working folder +if [ ! -z "$RELATIVE_PATH" ]; then + WORK="$KEYDIR/$RELATIVE_PATH" +else + WORK="$BASEDIR" +fi + +mkdir -p "$WORK" && cd "$WORK" && git $* cd "$CWD" -- 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 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 f31528e4044e9eac74cf1b256c4c57bc3a065424 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 28 Dec 2013 13:44:18 -0200 Subject: Removing trailing spaces from copyright notice --- keyringer | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyringer b/keyringer index 9c45d97..ca47062 100755 --- a/keyringer +++ b/keyringer @@ -3,17 +3,17 @@ # Keyringer key management system. # # Copyright (C) 2010 Silvio Rhatto - rhatto at riseup.net -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published # by the Free Software Foundation, either version 3 of the License, # or any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -- cgit v1.2.3 From 65f63e1b889a9f0e5e9a0b1646ddcee3b4b44242 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 28 Dec 2013 13:45:27 -0200 Subject: Adds missing comments --- keyringer | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyringer b/keyringer index ca47062..cc8378f 100755 --- a/keyringer +++ b/keyringer @@ -18,6 +18,7 @@ # along with this program. If not, see . # +# Initialize a new keyring function keyringer_init { BASEDIR="$3" URL="$4" @@ -104,6 +105,7 @@ function keyringer_init { fi } +# Action dispatcher function keyringer_dispatch { BASEDIR="`keyringer_config $KEYRING`" -- cgit v1.2.3 From 05c979445a142de0b9a66995728d984ab2247856 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 31 Dec 2013 17:58:30 -0200 Subject: Use 'gpg --quiet' by default --- lib/keyringer/actions/decrypt | 2 +- lib/keyringer/functions | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/keyringer/actions/decrypt b/lib/keyringer/actions/decrypt index 2b1401c..b63b74e 100755 --- a/lib/keyringer/actions/decrypt +++ b/lib/keyringer/actions/decrypt @@ -11,7 +11,7 @@ source "$LIB" || exit 1 keyringer_get_file "$2" # Decrypt -$GPG --quiet --use-agent -d "$KEYDIR/$FILE" +$GPG --use-agent -d "$KEYDIR/$FILE" # Exit exit "$?" diff --git a/lib/keyringer/functions b/lib/keyringer/functions index de7516f..9eb832f 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -290,9 +290,9 @@ function keyringer_set_env { fi if [ ! -z "$KEYID" ]; then - GPG="gpg -u $KEYID" + GPG="gpg --quiet -u $KEYID" else - GPG="gpg" + GPG="gpg --quiet" fi # Check keyring config version -- cgit v1.2.3 From 0471007d92b837d8d5df2c6d3a80fffd1048c3a4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 12 Feb 2014 12:13:27 -0200 Subject: Proper error handling at edit action --- lib/keyringer/actions/edit | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 5f31aa0..03ccdab 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -44,5 +44,18 @@ $APP "$TMPWORK" # Encrypt again $GPG --yes -o "$KEYDIR/$FILE" --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") "$TMPWORK" +# Check exit status +errcrypt="$?" + # Remove temp file keyringer_unset_tmpfile "$TMPWORK" + +# Check exit status again +errwipe="$?" + +# Error handling must be done after temp file removal +if [ "$errcrypt" != "0" ]; then + exit "$errcrypt" +elif [ "$errwipe" != "0" ]; then + exit $errwipe +fi -- cgit v1.2.3 From 36b74ae7fad92c8f03a6f00ff2d0fe2f70ea7899 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 12 Feb 2014 13:31:16 -0200 Subject: Check key expirations (#37) --- lib/keyringer/functions | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 9eb832f..810effe 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -541,6 +541,31 @@ EOF echo "Please check for this key or fix the recipient file." exit 1 fi + + # Current date + seconds="`date +%s`" + + # Check the main key + expiry="`gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^pub | cut -d : -f 7`" + + # Check if key is expired + if [[ "$seconds" -gt "$expiry" ]]; then + echo "Fatal: primary key for $recipient expired on `date --date="@$expiry"`" + exit 1 + else + # Check the subkeys + for expiry in `gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^sub | cut -d : -f 7`; do + if [[ "$seconds" -lt "$expiry" ]]; then + not_expired="1" + fi + + if [ "$not_expired" != "1" ]; then + echo "Fatal: key $recipient has no keys suitable for encryption: all subkeys expired." + exit 1 + fi + done + fi + fi done } -- 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(-) 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 2842331046ee4b31d13a210a6d69a87363fa20e1 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 13 Feb 2014 11:54:45 -0200 Subject: Expiration check should handle keys without expiry dates --- lib/keyringer/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 810effe..5cc92b1 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -549,7 +549,7 @@ EOF expiry="`gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^pub | cut -d : -f 7`" # Check if key is expired - if [[ "$seconds" -gt "$expiry" ]]; then + if [ ! -z "$expiry" ] && [[ "$seconds" -gt "$expiry" ]]; then echo "Fatal: primary key for $recipient expired on `date --date="@$expiry"`" exit 1 else -- 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 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 04b03dd14a0abe02f436f86e3d647f97b3e5522b Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 19 Feb 2014 23:42:29 -0300 Subject: Adding xclip action thanks to password-store (2) --- lib/keyringer/actions/xclip | 6 ++++++ lib/keyringer/completions/bash/keyringer | 2 +- lib/keyringer/completions/zsh/_keyringer | 2 +- share/man/keyringer.1.mdwn | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/keyringer/actions/xclip b/lib/keyringer/actions/xclip index 414013b..b28984f 100755 --- a/lib/keyringer/actions/xclip +++ b/lib/keyringer/actions/xclip @@ -38,6 +38,12 @@ clip() { LIB="`dirname $0`/../functions" source "$LIB" || exit 1 +# Check for xclip +if ! which xclip; then + echo "fatal: xclip not found" + exit 1 +fi + # Get file keyringer_get_file "$2" diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index eb8fabd..a640583 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -94,7 +94,7 @@ _keyringer() { recipients) opts="ls edit" ;; - ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip) cur="`echo ${cur} | sed -e "s|^/*||"`" # avoid leading slash opts="$(bash -c "set -f && export KEYRINGER_CHECK_VERSION=false && keyringer $instance ls -p -d ${cur}*" 2> /dev/null)" ;; diff --git a/lib/keyringer/completions/zsh/_keyringer b/lib/keyringer/completions/zsh/_keyringer index e889fd8..1a6d8c6 100644 --- a/lib/keyringer/completions/zsh/_keyringer +++ b/lib/keyringer/completions/zsh/_keyringer @@ -50,7 +50,7 @@ _keyringer() { recipients) compadd "$@" ls edit ;; - ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open) + ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip) words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash compadd "$@" $(KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null) ;; diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index 1cd7a45..ccaabdf 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -150,6 +150,9 @@ recrypt <*secret*> into the recipient configuration. If no *secret* is given, all secrets in the repository are re-encrypted. +clip <*secret*>, xclip <*secret*> +: Copy the first line of a secret to the clipboard, following password-store convention. + # CONFIGURATION ACTIONS commands -- cgit v1.2.3 From 0fba4b17d2c76784f99de0182d175b2d37f07638 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 20 Feb 2014 00:22:03 -0300 Subject: Try to find a similar file at keyringer_get_file() --- lib/keyringer/actions/find | 2 +- lib/keyringer/functions | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find index 92bec25..21afc7a 100755 --- a/lib/keyringer/actions/find +++ b/lib/keyringer/actions/find @@ -15,5 +15,5 @@ shift ARGS="`echo "$*" | sed -e "s|^/*||"`" # Run find command -cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" +cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" | sed -e 's|^./||g' cd "$CWD" diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 5cc92b1..014c2c9 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -411,8 +411,33 @@ function keyringer_get_file { keyringer_action_usage exit 1 elif [ ! -f "$KEYDIR/$FILE" ]; then - echo "File not found: $KEYDIR/$FILE" - exit 1 + # Try to find a similar file + count=0 + candidates=(`keyringer_exec find "$BASEDIR" "$1" | grep -e '.asc$'`) + + if [ ! -z "$candidates" ]; then + echo "Could not find exact match \"$1\", please chose one" + echo "of the following secrets:" + echo "" + + for candidate in ${candidates[@]}; do + echo -e "\t[$count] $candidate" + let count++ + done + + echo "" + read -p "Enter option: " option + + if [[ "$option" =~ ^[0-9]+$ ]] && [ ! -z "${candidates[$option]}" ]; then + FILE="$(keyringer_filename "$RELATIVE_PATH/${candidates[$option]}")" + else + echo "Invalid option" + exit 1 + fi + else + echo "File not found: $KEYDIR/$FILE" + exit 1 + fi fi } -- 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(+) 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(-) 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