2021-11-28 11:02:54 +00:00
# pass-reveal
An extension for [pass ](https://www.passwordstore.org/ ) (the standard Unix password manager) to easily find elements of the password store.
2019-04-10 10:42:27 +00:00
2019-04-10 15:10:22 +00:00
## Motivation
2021-11-28 11:02:54 +00:00
`pass show` requires that one type in the full path of the service, but I am too lazy to do that.
2019-04-10 15:10:22 +00:00
2019-04-10 10:42:27 +00:00
## Usage
```
Usage:
2021-11-28 11:02:54 +00:00
pass reveal [reveallocation]
On the first run it creates a directory ".reveals" in \$PASSWORD_STORE_DIR.
By default this is ~/.password-store/.reveals".
It creates a reveal of the complete password store by creating a
2019-04-10 10:42:27 +00:00
compressed tar-file with extension .tar.bz2.
2021-11-28 11:02:54 +00:00
reveals themselves are excluded from the reveal.
Without argument the reveal file will receive the default name "passwordstore.DATE.TIME.tar.bz2"
2019-04-10 10:42:27 +00:00
where DATE and TIME are the current date and time.
2021-11-28 11:02:54 +00:00
If an argument is given and it is a directory, the reveal file will be placed
into the specified directory instead of the default ".reveals" directory.
2019-04-10 10:42:27 +00:00
If an argument is given and it is not a directory, it is used as a file
2021-11-28 11:02:54 +00:00
name and the reveal is stored with this filename with .at.gz2 appended.
pass reveal help
2019-04-10 10:42:27 +00:00
Prints this help message.
2021-11-28 11:02:54 +00:00
pass reveal version
2019-04-10 10:42:27 +00:00
Prints the version number.
2021-11-28 11:02:54 +00:00
Usage:
pass reveal [search-terms]
Searches and displays passwords from \$PASSWORD_STORE_LOCATION.
A simple wrapper over pass show, find, and grep.
Based on the pass reveal extension.
$PROGRAM reveal help
Prints this help message.
$PROGRAM reveal version
Prints the version number.
Example: $PROGRAM reveal web
Searches for any files in $PASSWORD_STORE_LOCATION whose filenames contain
the keyword "web"
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
## Example
Let's generate a password for this example
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
pass generate test/test
[master 1dd0d0b] Add generated password for test/test.
1 file changed, 0 insertions(+), 0 deletions(-)
rewrite test/test.gpg (100%)
The generated password for test/test is:
]$OJ& < J18JSk !( Y4u: ~ n \`E3B
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
Then we can search with:
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
> pass reveal test
Best match: test/test
]$OJ& < J18JSk !( Y4u: ~ n \`E3B
Copied test/test to clipboard. Will clear in 45 seconds.
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
## Installation
2019-04-10 10:42:27 +00:00
2021-11-28 11:02:54 +00:00
For installation download and place this bash script file ```reveal.bash``` into
2019-04-10 10:42:27 +00:00
the passwordstore extension directory specified with ```$PASSWORD_STORE_EXTENSIONS_DIR```.
By default this is ```~/.password-store/.extensions```.
```
2021-11-28 11:02:54 +00:00
$ cp reveal.bash ~/.password-store/.extensions
2019-04-10 10:42:27 +00:00
```
Give the file execution permissions:
```
2021-11-28 11:02:54 +00:00
$ chmod 700 ~/.password-store/.extensions/reveal.bash
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
Set the variable ```PASSWORD_STORE_ENABLE_EXTENSIONS```, to true to enable extensions, e.g., in your `.bashrc`
2019-04-10 10:42:27 +00:00
```
$ export PASSWORD_STORE_ENABLE_EXTENSIONS=true
```
2021-11-28 11:02:54 +00:00
Download and source the bash completion file ```pass-reveal.bash.completion``` for bash completion.
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
$ source ~/.password-store/.bash-completions/pass-reveal.bash.completion
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
Type ```pass reveal keyword``` to make your first search.
2019-04-10 10:42:27 +00:00
```
2021-11-28 11:02:54 +00:00
$ pass reveal keyword
2019-04-10 10:42:27 +00:00
```
## Requirements
- `pass` from [https://www.passwordstore.org/ ](https://www.passwordstore.org/ )
- `tar` to be installed for zipping and compression.
2021-11-28 11:02:54 +00:00
## License
This work is released under the [GNU GENERAL PUBLIC LICENSE ](https://www.gnu.org/licenses/gpl-3.0.en.html ).
2019-04-10 10:42:27 +00:00
## Notes
2021-11-28 11:02:54 +00:00
Both files are tiny: 92 lines (script) and 17 lines (autocompletion) respectively. You can check them yourself quickly. No need to trust anyone.
This extension is heavily based on the [pass-backup ](https://github.com/8go/pass-backup ) extension (archived [here ](https://git.loki.red/open.source/pass-backup )). Because `pass-backup` is open source, it was easy to take its architecture and use it for a different purpose.