summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-22 19:47:55 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-22 19:47:55 +0200
commit05a219587336d51203196f5f809d1c5d9d93af7c (patch)
tree62995a640dca6859158eb08fa6c8cec4f14e2b94
parent68f910fbbe81166dfe4765bcb8a05effc444e528 (diff)
downloadpass-05a219587336d51203196f5f809d1c5d9d93af7c.tar.gz
pass-05a219587336d51203196f5f809d1c5d9d93af7c.tar.bz2
pass-05a219587336d51203196f5f809d1c5d9d93af7c.zip
Allow git repo to be elsewhere via env var.
Diffstat (limited to '')
-rw-r--r--man/pass.129
-rwxr-xr-xsrc/password-store.sh4
2 files changed, 24 insertions, 9 deletions
diff --git a/man/pass.1 b/man/pass.1
index d00363b..5a8a32b 100644
--- a/man/pass.1
+++ b/man/pass.1
@@ -19,8 +19,7 @@ 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 ,
-or the environment variable \fBPASSWORD_STORE_DIR\fP if it is set.
+.IR ~/.password-store .
The
.B pass
utility provides a series of commands for manipulating the password store,
@@ -43,8 +42,7 @@ extended description using \fBinit\fP and
The \fBinit\fP command must be run before other commands in order to initialize
the password store with the correct gpg key id. Passwords are encrypting using
-the gpg key set with \fBinit\fP, unless the \fBPASSWORD_STORE_KEY\fP environment
-variable is set to an alternative key id.
+the gpg key set with \fBinit\fP.
There is a corresponding bash completion script for use with tab completing
password names in
@@ -318,11 +316,28 @@ To kexec.com:pass-store
.TP
.B ~/.password-store
-The password storage directory.
+The default password storage directory.
.TP
.B ~/.password-store/.gpg-id
-Contains the gpg key identification used for encryption and decryption. This should
-be set using the \fBinit\fP command.
+Contains the default gpg key identification used for encryption and decryption.
+This should be set using the \fBinit\fP command.
+
+.SH ENVIRONMENT VARIABLES
+
+.TP
+.I PASSWORD_STORE_DIR
+Overrides the default password storage directory.
+.TP
+.I PASSWORD_STORE_KEY
+Overrides the default gpg key identification set by \fBinit\fP.
+.TP
+.I PASSWORD_STORE_GIT
+Overrides the default root of the git repository, which is helpful if
+\fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default
+password store.
+.TP
+.I EDITOR
+The location of the text editor used by \fBedit\fP.
.SH SEE ALSO
.BR gpg (1),
diff --git a/src/password-store.sh b/src/password-store.sh
index 21f8fe4..b28e408 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -7,11 +7,11 @@ umask 077
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
ID="$PREFIX/.gpg-id"
-GIT_DIR="$PREFIX/.git"
+GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git"
GPG_OPTS="--quiet --yes --batch"
export GIT_DIR
-export GIT_WORK_TREE="$PREFIX"
+export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}"
version() {
cat <<_EOF