summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README24
-rw-r--r--contrib/autocomplete.ksh6
-rw-r--r--contrib/autocomplete.zsh6
-rwxr-xr-xcontrib/kasimenu (renamed from contrib/angoumenu)8
-rwxr-xr-xkasi (renamed from angou)34
-rw-r--r--kasi.1 (renamed from angou.1)0
6 files changed, 39 insertions, 39 deletions
diff --git a/README b/README
index d6d1d42..0ab4de6 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
1angou (暗号) 1kasi ("veil"/"conceal" in Esperanto)
2============ 2====================================
3A simple password manager written in POSIX shell. 3A simple password manager written in POSIX shell.
4 4
5Dependencies 5Dependencies
@@ -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
20Configuration 20Configuration
21------------- 21-------------
@@ -23,17 +23,17 @@ In your ~/.profile or wherever you set environment variables, add something
23like this if you use age: 23like this if you use age:
24export AGE_KEY=/nas/ssh/id_ed25519 24export AGE_KEY=/nas/ssh/id_ed25519
25export AGE_PUB=${AGE_KEY}.pub 25export AGE_PUB=${AGE_KEY}.pub
26export ANGOU_DIR=/nas/angou-age 26export KASI_DIR=/nas/kasi-age
27export ANGOU_ENCRYPT="age -R $AGE_PUB" 27export KASI_ENCRYPT="age -R $AGE_PUB"
28export ANGOU_DECRYPT="age -d -i $AGE_KEY -o -" 28export KASI_DECRYPT="age -d -i $AGE_KEY -o -"
29 29
30If you use GnuPG, then add: 30If you use GnuPG, then add:
31export GPG_ID="user@email.tld" # or your key id 31export GPG_ID="user@email.tld" # or your key id
32export ANGOU_DECRYPT="gpg -qd" 32export KASI_DECRYPT="gpg -qd"
33export ANGOU_ENCRYPT="gpg -er $GPG_ID -o -" 33export KASI_ENCRYPT="gpg -er $GPG_ID -o -"
34 34
35For some other file encryptor, you'd need to be able to output the encrypted 35For some other file encryptor, you'd need to be able to output the encrypted
36file to stdout or change the last line of edit() that runs $ANGOU_ENCRYPT. 36file to stdout or change the last line of edit() that runs $KASI_ENCRYPT.
37 37
38Why should I use this over password-store? 38Why 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
42Migrating from password-store 42Migrating from password-store
43----------------------------- 43-----------------------------
44Set the ANGOU_DIR environment variable to your password store directory. 44Set the KASI_DIR environment variable to your password store directory.
45 45
46Auto-complete 46Auto-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
2set -A complete_angou_1 -- help copy edit view pass generate 2set -A complete_kasi_1 -- help copy edit view pass generate
3set -A complete_angou_2 -- $(find ${ANGOU_DIR:-~/.angou} -type f | sort \ 3set -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
3passwords() { 3passwords() {
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
2ANGOU_DIR="${ANGOU_DIR:-~/.angou}" 2KASI_DIR="${KASI_DIR:-~/.kasi}"
3DMENU="dmenu" 3DMENU="dmenu"
4 4
5cd "$ANGOU_DIR" 5cd "$KASI_DIR"
6file=$(find . -type f -printf '%P\n' | sort | sed 's,^\./,,' | $DMENU) 6file=$(find . -type f -printf '%P\n' | sort | sed 's,^\./,,' | $DMENU)
7 7
8if [ -z "$1" ]; then 8if [ -z "$1" ]; then
9 angou copy "$file" 9 kasi copy "$file"
10elif [ "$1" = "totp" ] 10elif [ "$1" = "totp" ]
11 angou totp "$file" 11 kasi totp "$file"
12else 12else
13 exit 1 13 exit 1
14fi 14fi
diff --git a/angou b/kasi
index 179775d..46a5584 100755
--- a/angou
+++ b/kasi
@@ -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
4ANGOU_DIR=${ANGOU_DIR:-"$HOME/.angou/"} 4KASI_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)
6ANGOU_CLIPBOARD=${ANGOU_CLIPBOARD:-"xsel -i"} 6KASI_CLIPBOARD=${KASI_CLIPBOARD:-"xsel -i"}
7# sets command to use when listing directory structure 7# sets command to use when listing directory structure
8ANGOU_LIST=${ANGOU_LIST:-"tree"} 8KASI_LIST=${KASI_LIST:-"tree"}
9# custom command for generating passwords/users 9# custom command for generating passwords/users
10ANGOU_GEN_PASS=${ANGOU_GEN_PASS:-"random pass"} 10KASI_GEN_PASS=${KASI_GEN_PASS:-"random pass"}
11ANGOU_GEN_USER=${ANGOU_GEN_USER:-"random user"} 11KASI_GEN_USER=${KASI_GEN_USER:-"random user"}
12 12
13mkdir -p "$ANGOU_DIR" 13mkdir -p "$KASI_DIR"
14cd "$ANGOU_DIR" 14cd "$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
17view() { 17view() {
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() {
36copy() { 36copy() {
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
43edit() { 43edit() {
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
62totp_view() { 62totp_view() {
@@ -67,7 +67,7 @@ totp_view() {
67} 67}
68 68
69totp() { 69totp() {
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"
diff --git a/angou.1 b/kasi.1
index 015c2f5..015c2f5 100644
--- a/angou.1
+++ b/kasi.1