diff options
| -rw-r--r-- | README | 24 | ||||
| -rw-r--r-- | contrib/autocomplete.ksh | 6 | ||||
| -rw-r--r-- | contrib/autocomplete.zsh | 6 | ||||
| -rwxr-xr-x | contrib/kasimenu (renamed from contrib/angoumenu) | 8 | ||||
| -rwxr-xr-x | kasi (renamed from angou) | 34 | ||||
| -rw-r--r-- | kasi.1 (renamed from angou.1) | 0 |
6 files changed, 39 insertions, 39 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | angou (暗号) | 1 | kasi ("veil"/"conceal" in Esperanto) |
| 2 | ============ | 2 | ==================================== |
| 3 | A simple password manager written in POSIX shell. | 3 | A simple password manager written in POSIX shell. |
| 4 | 4 | ||
| 5 | Dependencies | 5 | Dependencies |
| @@ -9,13 +9,13 @@ Dependencies | |||
| 9 | - tree (for listing all your passwords and their directories) | 9 | - tree (for listing all your passwords and their directories) |
| 10 | - a simple version is available in https://github.com/pyr/tree | 10 | - a simple version is available in https://github.com/pyr/tree |
| 11 | and in OpenBSD's ports | 11 | and in OpenBSD's ports |
| 12 | - can possibly be replaced with ls if you add ANGOU_LIST in your ~/.profile | 12 | - can possibly be replaced with ls if you add KASI_LIST in your ~/.profile |
| 13 | - xsel (for copying password to clipboard, but can be changed to a different | 13 | - xsel (for copying password to clipboard, but can be changed to a different |
| 14 | command with the ANGOU_CLIPBOARD command that accepts stdin) | 14 | command with the KASI_CLIPBOARD command that accepts stdin) |
| 15 | - a password generator | 15 | - a password generator |
| 16 | - script uses contrib/random from this repo by default and expects it in your | 16 | - script uses contrib/random from this repo by default and expects it in your |
| 17 | path | 17 | path |
| 18 | - can change by setting ANGOU_GEN_USER and ANGOU_GEN_PASS in your ~/.profile | 18 | - can change by setting KASI_GEN_USER and KASI_GEN_PASS in your ~/.profile |
| 19 | 19 | ||
| 20 | Configuration | 20 | Configuration |
| 21 | ------------- | 21 | ------------- |
| @@ -23,17 +23,17 @@ In your ~/.profile or wherever you set environment variables, add something | |||
| 23 | like this if you use age: | 23 | like this if you use age: |
| 24 | export AGE_KEY=/nas/ssh/id_ed25519 | 24 | export AGE_KEY=/nas/ssh/id_ed25519 |
| 25 | export AGE_PUB=${AGE_KEY}.pub | 25 | export AGE_PUB=${AGE_KEY}.pub |
| 26 | export ANGOU_DIR=/nas/angou-age | 26 | export KASI_DIR=/nas/kasi-age |
| 27 | export ANGOU_ENCRYPT="age -R $AGE_PUB" | 27 | export KASI_ENCRYPT="age -R $AGE_PUB" |
| 28 | export ANGOU_DECRYPT="age -d -i $AGE_KEY -o -" | 28 | export KASI_DECRYPT="age -d -i $AGE_KEY -o -" |
| 29 | 29 | ||
| 30 | If you use GnuPG, then add: | 30 | If you use GnuPG, then add: |
| 31 | export GPG_ID="user@email.tld" # or your key id | 31 | export GPG_ID="user@email.tld" # or your key id |
| 32 | export ANGOU_DECRYPT="gpg -qd" | 32 | export KASI_DECRYPT="gpg -qd" |
| 33 | export ANGOU_ENCRYPT="gpg -er $GPG_ID -o -" | 33 | export KASI_ENCRYPT="gpg -er $GPG_ID -o -" |
| 34 | 34 | ||
| 35 | For some other file encryptor, you'd need to be able to output the encrypted | 35 | For some other file encryptor, you'd need to be able to output the encrypted |
| 36 | file to stdout or change the last line of edit() that runs $ANGOU_ENCRYPT. | 36 | file to stdout or change the last line of edit() that runs $KASI_ENCRYPT. |
| 37 | 37 | ||
| 38 | Why should I use this over password-store? | 38 | Why should I use this over password-store? |
| 39 | ------------------------------------------ | 39 | ------------------------------------------ |
| @@ -41,7 +41,7 @@ Don't. For a serious answer, it's because this doesn't depend on bash. | |||
| 41 | 41 | ||
| 42 | Migrating from password-store | 42 | Migrating from password-store |
| 43 | ----------------------------- | 43 | ----------------------------- |
| 44 | Set the ANGOU_DIR environment variable to your password store directory. | 44 | Set the KASI_DIR environment variable to your password store directory. |
| 45 | 45 | ||
| 46 | Auto-complete | 46 | Auto-complete |
| 47 | ------------- | 47 | ------------- |
diff --git a/contrib/autocomplete.ksh b/contrib/autocomplete.ksh index 5c91ad8..54d774a 100644 --- a/contrib/autocomplete.ksh +++ b/contrib/autocomplete.ksh | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/ksh | 1 | #!/bin/ksh |
| 2 | set -A complete_angou_1 -- help copy edit view pass generate | 2 | set -A complete_kasi_1 -- help copy edit view pass generate |
| 3 | set -A complete_angou_2 -- $(find ${ANGOU_DIR:-~/.angou} -type f | sort \ | 3 | set -A complete_kasi_2 -- $(find ${KASI_DIR:-~/.kasi} -type f | sort \ |
| 4 | | sed s,${ANGOU_DIR}/,, | sed s,\\.gpg$,,) | 4 | | sed s,${KASI_DIR}/,, | sed s,\\.gpg$,,) |
diff --git a/contrib/autocomplete.zsh b/contrib/autocomplete.zsh index eaafb8c..1a8ea10 100644 --- a/contrib/autocomplete.zsh +++ b/contrib/autocomplete.zsh | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #compdef angou | 1 | #compdef kasi |
| 2 | 2 | ||
| 3 | passwords() { | 3 | passwords() { |
| 4 | files=("${(f)$(find ${ANGOU_DIR:-$HOME/.angou} -type f -printf '%P\n' | sort)}") | 4 | files=("${(f)$(find ${KASI_DIR:-$HOME/.kasi} -type f -printf '%P\n' | sort)}") |
| 5 | _multi_parts / files | 5 | _multi_parts / files |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | _arguments \ | 8 | _arguments \ |
| 9 | '1:angou commands:(copy edit generate help pass view totp totp_view)' \ | 9 | '1:kasi commands:(copy edit generate help pass view totp totp_view)' \ |
| 10 | '2:passwords:passwords' | 10 | '2:passwords:passwords' |
diff --git a/contrib/angoumenu b/contrib/kasimenu index 85ca2e4..3a42745 100755 --- a/contrib/angoumenu +++ b/contrib/kasimenu | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | ANGOU_DIR="${ANGOU_DIR:-~/.angou}" | 2 | KASI_DIR="${KASI_DIR:-~/.kasi}" |
| 3 | DMENU="dmenu" | 3 | DMENU="dmenu" |
| 4 | 4 | ||
| 5 | cd "$ANGOU_DIR" | 5 | cd "$KASI_DIR" |
| 6 | file=$(find . -type f -printf '%P\n' | sort | sed 's,^\./,,' | $DMENU) | 6 | file=$(find . -type f -printf '%P\n' | sort | sed 's,^\./,,' | $DMENU) |
| 7 | 7 | ||
| 8 | if [ -z "$1" ]; then | 8 | if [ -z "$1" ]; then |
| 9 | angou copy "$file" | 9 | kasi copy "$file" |
| 10 | elif [ "$1" = "totp" ] | 10 | elif [ "$1" = "totp" ] |
| 11 | angou totp "$file" | 11 | kasi totp "$file" |
| 12 | else | 12 | else |
| 13 | exit 1 | 13 | exit 1 |
| 14 | fi | 14 | fi |
| @@ -1,22 +1,22 @@ | |||
| 1 | #!/bin/sh -e | 1 | #!/bin/sh -e |
| 2 | 2 | ||
| 3 | # sets the directory with all your passwords | 3 | # sets the directory with all your passwords |
| 4 | ANGOU_DIR=${ANGOU_DIR:-"$HOME/.angou/"} | 4 | KASI_DIR=${KASI_DIR:-"$HOME/.kasi/"} |
| 5 | # sets the command to copy into your clipboard (must accept stdin) | 5 | # sets the command to copy into your clipboard (must accept stdin) |
| 6 | ANGOU_CLIPBOARD=${ANGOU_CLIPBOARD:-"xsel -i"} | 6 | KASI_CLIPBOARD=${KASI_CLIPBOARD:-"xsel -i"} |
| 7 | # sets command to use when listing directory structure | 7 | # sets command to use when listing directory structure |
| 8 | ANGOU_LIST=${ANGOU_LIST:-"tree"} | 8 | KASI_LIST=${KASI_LIST:-"tree"} |
| 9 | # custom command for generating passwords/users | 9 | # custom command for generating passwords/users |
| 10 | ANGOU_GEN_PASS=${ANGOU_GEN_PASS:-"random pass"} | 10 | KASI_GEN_PASS=${KASI_GEN_PASS:-"random pass"} |
| 11 | ANGOU_GEN_USER=${ANGOU_GEN_USER:-"random user"} | 11 | KASI_GEN_USER=${KASI_GEN_USER:-"random user"} |
| 12 | 12 | ||
| 13 | mkdir -p "$ANGOU_DIR" | 13 | mkdir -p "$KASI_DIR" |
| 14 | cd "$ANGOU_DIR" | 14 | cd "$KASI_DIR" |
| 15 | 15 | ||
| 16 | # decrypt and print a password from ANGOU_DIR or print the directory structure | 16 | # decrypt and print a password from KASI_DIR or print the directory structure |
| 17 | view() { | 17 | view() { |
| 18 | if [ -f "$1" ]; then | 18 | if [ -f "$1" ]; then |
| 19 | $ANGOU_DECRYPT "$1" | 19 | $KASI_DECRYPT "$1" |
| 20 | elif [ -d "${1:-.}" ]; then | 20 | elif [ -d "${1:-.}" ]; then |
| 21 | tree "${1:-.}" | 21 | tree "${1:-.}" |
| 22 | else | 22 | else |
| @@ -36,27 +36,27 @@ view_single() { | |||
| 36 | copy() { | 36 | copy() { |
| 37 | [ ! -f "$1" ] && usage && exit 1 | 37 | [ ! -f "$1" ] && usage && exit 1 |
| 38 | 38 | ||
| 39 | view_single "$1" | $ANGOU_CLIPBOARD | 39 | view_single "$1" | $KASI_CLIPBOARD |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | # create new or existing password in ANGOU_DIR | 42 | # create new or existing password in KASI_DIR |
| 43 | edit() { | 43 | edit() { |
| 44 | [ -d "$1" ] && usage && exit 1 | 44 | [ -d "$1" ] && usage && exit 1 |
| 45 | 45 | ||
| 46 | tmpfile="$(mktemp)" | 46 | tmpfile="$(mktemp)" |
| 47 | 47 | ||
| 48 | if [ "$2" = "generate" ]; then | 48 | if [ "$2" = "generate" ]; then |
| 49 | $ANGOU_GEN_PASS >"$tmpfile" | 49 | $KASI_GEN_PASS >"$tmpfile" |
| 50 | echo "Username: $($ANGOU_GEN_USER)" >>"$tmpfile" | 50 | echo "Username: $($KASI_GEN_USER)" >>"$tmpfile" |
| 51 | fi | 51 | fi |
| 52 | 52 | ||
| 53 | # edit a copy of a password if it already exists | 53 | # edit a copy of a password if it already exists |
| 54 | [ -f "$1" ] && $ANGOU_DECRYPT "$1" > "$tmpfile" | 54 | [ -f "$1" ] && $KASI_DECRYPT "$1" > "$tmpfile" |
| 55 | 55 | ||
| 56 | ${VISUAL:-${EDITOR:-ed}} "$tmpfile" | 56 | ${VISUAL:-${EDITOR:-ed}} "$tmpfile" |
| 57 | 57 | ||
| 58 | mkdir -p "$(dirname "$1")" | 58 | mkdir -p "$(dirname "$1")" |
| 59 | $ANGOU_ENCRYPT "$tmpfile" >"$1" | 59 | $KASI_ENCRYPT "$tmpfile" >"$1" |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | totp_view() { | 62 | totp_view() { |
| @@ -67,7 +67,7 @@ totp_view() { | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | totp() { | 69 | totp() { |
| 70 | totp_view "$1" | tr -d '\n' | $ANGOU_CLIPBOARD | 70 | totp_view "$1" | tr -d '\n' | $KASI_CLIPBOARD |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | # print usage | 73 | # print usage |
| @@ -76,7 +76,7 @@ usage() { | |||
| 76 | printf "\tThe edit and copy command expects a file as an argument,\n" | 76 | printf "\tThe edit and copy command expects a file as an argument,\n" |
| 77 | printf "\twhile the view command expects a directory as an argument.\n" | 77 | printf "\twhile the view command expects a directory as an argument.\n" |
| 78 | printf "\tThe arguments for view and edit are relative to\n" | 78 | printf "\tThe arguments for view and edit are relative to\n" |
| 79 | printf "\t\$ANGOU_DIR which is currently set to %s\n\n" "$ANGOU_DIR" | 79 | printf "\t\$KASI_DIR which is currently set to %s\n\n" "$KASI_DIR" |
| 80 | 80 | ||
| 81 | printf "\tThe view command is the default command if only a file or\n" | 81 | printf "\tThe view command is the default command if only a file or\n" |
| 82 | printf "\tdirectory is passed as an argument\n" | 82 | printf "\tdirectory is passed as an argument\n" |
