password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit 6ecdfe3844eec6e3d3f2d04c506c75114d97a5ec
parent f423a27d4da8a1b830e368d846880886470b22dd
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Wed, 12 Sep 2012 02:05:53 +0200

Use PASSWORD_STORE_DIR environment variable if it is set.

A user made this request:

    I was wondering whether it is in a planning to have multiple
    password-store directory trees or possible to achieve? eg.
    $HOME/.pwd-store-work and $HOME/.pwd-store-home. Maybe distinguish them
    with a command line switch and then create aliases in .bash_aliases?

    Why I'm asking is that I have multiple major password categories -
    personal, work etc. It'll be nice to keep them separate and under
    different repos.

Reported-by: Simon KP <si@eskp.net>

Diffstat:
Mman/pass.1 | 7++++---
Msrc/password-store.sh | 2+-
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/man/pass.1 b/man/pass.1 @@ -19,7 +19,8 @@ pass - stores, retrieves, generates, and synchronizes passwords securely is a very simple password store that keeps passwords inside .BR gpg (1) encrypted files inside a simple directory tree residing at -.IR $HOME/.password-store . +.IR $HOME/.password-store , +or the environment variable \fBPASSWORD_STORE_DIR\fP if it is set. The .B pass utility provides a series of commands for manipulating the password store, @@ -82,8 +83,8 @@ Insert a new password or edit an existing password using the default text editor by the environment variable \fBEDITOR\fP or using .BR vi (1) as a fallback. This mode makes use of temporary files for editing, but care is taken to -ensure that temporary files are created in \fB/dev/shm\fP in order to avoid writing to -difficult-to-erase disk sectors. If \fB/dev/shm\fP is not accessible, fallback to +ensure that temporary files are created in \fI/dev/shm\fP in order to avoid writing to +difficult-to-erase disk sectors. If \fI/dev/shm\fP is not accessible, fallback to the ordinary \fBTMPDIR\fP location, and print a warning. .TP \fBgenerate\fP [ \fI--no-symbols\fP, \fI-n\fP ] [ \fI--clip\fP, \fI-c\fP ] \fIpass-name pass-length\fP diff --git a/src/password-store.sh b/src/password-store.sh @@ -5,7 +5,7 @@ umask 077 -PREFIX="$HOME/.password-store" +PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" ID="$PREFIX/.gpg-id" GIT="$PREFIX/.git"