-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78a76bd
commit 4949050
Showing
9 changed files
with
217 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Bennett Piater | ||
Justus Piater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
# Script to simplify adding a new user/pass combination | ||
# | ||
# This file is part of PUMA. | ||
# Copyright 2017 Bennett Piater and Justus Piater | ||
|
@@ -16,10 +17,13 @@ | |
# You should have received a copy of the GNU General Public License | ||
# along with PUMA. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#PUMA_GPGID="${PUMA_GPGID:[email protected]}" | ||
PUMA_KEYRING="${PUMA_KEYRING:-$HOME/Documents/keyring}" | ||
|
||
if [[ x"$1" = x"--random" ]]; then | ||
IFS="|" read -r FNAME USER < <(zenity --title "Add a new user" --forms --text="Add a new user with random password" --add-entry=filename --add-entry=user) | ||
PASS=$(diceware) | ||
printf "%s" "$PASS" | xclip # Copy the randomly-generated password to the clipboard | ||
PASS=$(diceware) || exit 1 | ||
#printf "%s" "$PASS" | xclip # Copy the randomly-generated password to the clipboard | ||
else | ||
IFS="|" read -r FNAME USER PASS < <(zenity --title "Add a new user" --forms --text="Add a new user" --add-entry=filename --add-entry=user --add-password=pass) | ||
fi | ||
|
@@ -29,11 +33,10 @@ if [[ -z "$FNAME" || -z "$USER" || -z "$PASS" ]]; then | |
exit 1 | ||
fi | ||
|
||
FILENAME="$HOME"/Documents/keyring/"$FNAME" | ||
|
||
printf "User: %s\nPass: %s\n" "$USER" "$PASS" >"$FILENAME" | ||
FILENAME="$PUMA_KEYRING"/"$FNAME" | ||
|
||
gpg --batch --yes --encrypt --recipient [email protected] "$FILENAME" || zenity --error --text "gpg error!" | ||
cat <<< "User: $USER"$'\n'"Pass: $PASS"$'\n' >"$FILENAME" | ||
gpg --batch --yes --encrypt --recipient "$PUMA_GPGID" "$FILENAME" || { zenity --error --text "gpg error!"; exit 1; } | ||
|
||
rm -f "$FILENAME" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
% PUMA-ADD(1) PUMA user manuals | ||
% Bennett Piater and Justus Piater | ||
% January 07, 2017 | ||
|
||
# NAME | ||
puma-add - Add a user account to PUMA | ||
|
||
# SYNOPSIS | ||
puma-add [*options*] | ||
|
||
# Description | ||
Helper script to simplify the flow of adding a new account to PUMA. | ||
|
||
It shows a zenity form popup into which one can enter the account name, user name and password, writes the file, and encrypts it. | ||
|
||
The password is shown in a popup at the end so it can easily be copied. | ||
|
||
# OPTIONS | ||
--random | ||
: Generate a random password instead of asking for it in the popup. | ||
|
||
# EXIT STATUS | ||
TODO | ||
|
||
# ENVIRONMENT | ||
PUMA_KEYRING | ||
: The folder containing the credential files. Defaults to *~/Documents/keyring*. | ||
|
||
PUMA_GPGID | ||
: The gpg id with which to encrypt the password files. | ||
|
||
# NOTES | ||
|
||
# BUGS | ||
|
||
# SEE ALSO | ||
**puma**(1), **puma**(7) | ||
|
||
# COPYRIGHT | ||
PUMA 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 | ||
(at your option) any later version. | ||
PUMA 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 PUMA. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
% PUMA(1) PUMA user manuals | ||
% Bennett Piater and Justus Piater | ||
% January 07, 2017 | ||
|
||
# NAME | ||
puma - simple password manager | ||
|
||
# SYNOPSIS | ||
puma [*options*] <account> | ||
|
||
# Description | ||
Log in automatically using the credentials for the specified account. | ||
|
||
This will type the user name, TAB, password and ENTER. | ||
|
||
# OPTIONS | ||
-h, \--help | ||
: Show a help message. | ||
|
||
-u | ||
: only type the user name and TAB | ||
|
||
-p | ||
: only type the password and ENTER | ||
|
||
# EXIT STATUS | ||
TODO | ||
|
||
# ENVIRONMENT | ||
PUMA_KEYRING | ||
: The folder containing the credential files. Defaults to *~/Documents/keyring*. | ||
|
||
# NOTES | ||
|
||
# BUGS | ||
|
||
# EXAMPLES | ||
To log into your google account, while having keyboard focus in the user name field: | ||
|
||
puma google | ||
|
||
This assumes that $PUMA_KEYRING/google.gpg exists and is valid. | ||
|
||
# SEE ALSO | ||
**puma-add**(1), **puma**(7) | ||
|
||
# COPYRIGHT | ||
PUMA 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 | ||
(at your option) any later version. | ||
PUMA 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 PUMA. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
% PUMA(7) PUMA user manuals | ||
% Bennett Piater and Justus Piater | ||
% January 07, 2017 | ||
|
||
# NAME | ||
PUMA - simple password manager | ||
|
||
# PROGRAMS | ||
The following is just an overview, see the respective documentation for details. | ||
|
||
puma(1) | ||
: Log in using credentials. | ||
|
||
puma-add(1) | ||
: Helper script to simplify adding new credentials. | ||
|
||
puma-menu | ||
: Helper script providing interactive account selection for logging in using dmenu. | ||
|
||
# PURPOSE | ||
We wanted a very simple password manager, so we made this. | ||
All you need to use it is a folder with gpg-encrypted credential files. | ||
Subfolders aren't currently supported, but that won't be hard to add. | ||
|
||
To log in somewhere (as long as tab indices are properly set), simply invoke **puma** or **puma-menu** while having keyboard focus in the username field. | ||
|
||
I recommend binding **puma-menu** to some keyboard shortcut. | ||
|
||
# CREDENTIAL FILE SYNTAX | ||
Credential files are of the following form: | ||
|
||
// ~/Documents/keyring/google.gpg | ||
User: [email protected] | ||
Pass: Tr0ub4dor&3 | ||
|
||
Lines other than *User* and *Pass* are ignored and can be used for notes or any other information. | ||
|
||
# NOTES | ||
Some environment variables may need to be set. Check the documentation of the scripts before using them. | ||
|
||
# BUGS | ||
|
||
# SEE ALSO | ||
**puma**(1), **puma-add**(1) | ||
|
||
# COPYRIGHT | ||
PUMA 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 | ||
(at your option) any later version. | ||
PUMA 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 PUMA. If not, see <http://www.gnu.org/licenses/>. |