- Timestamp:
- Nov 26, 2022, 2:15:17 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kanako
r12 r14 1 #!/bin/sh -e 1 #!/bin/sh 2 # $KyokoNet: kanako,v 1.7 2022/11/26 08:44:11 akoizumi Exp $ 2 3 3 4 readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}" … … 23 24 24 25 fn_copy() { 25 fn_view $1 | "${ clip_cmd}"26 fn_view $1 | "${kanako_clip_cmd}" 26 27 } 27 28 fn_edit() { 28 ${ encrypt_cmd} ${decrypt_args} ${1%%.enc}.enc > ${1%%.enc}29 ${kanako_encrypt_cmd} ${kanako_decrypt_args} ${1%%.enc}.enc > ${1%%.enc} 29 30 "${EDITOR}" "${1%%.enc}" 30 ${ encrypt_cmd} ${encrypt_args} ${1%%.enc} > ${1%%.enc}.enc31 ${kanako_encrypt_cmd} ${kanako_encrypt_args} ${1%%.enc} > ${1%%.enc}.enc 31 32 rm "${1%%.enc}" 32 33 } 33 34 fn_list() { 34 "${ list_cmd}" "${store_dir}"35 "${kanako_list_cmd}" "${kanako_store_dir}/" 35 36 } 36 37 fn_new() { … … 41 42 42 43 mkdir -p "$(dirname "$1")" 43 ${ encrypt_cmd} ${encrypt_args} ${tmpfile} > ${1%%.enc}.enc44 ${kanako_encrypt_cmd} ${kanako_encrypt_args} ${tmpfile} > ${1%%.enc}.enc 44 45 rm ${tmpfile} 45 46 } 46 47 fn_trash_directory() { 47 rm -rf $@48 rm -rf "$@" 48 49 } 49 fn_trash_ entry() {50 fn_trash_file() { 50 51 rm -f "${1}${2}".enc 51 52 } 52 53 fn_usage() { 53 cat <<EOF 54 Usage: 55 kanako [-celnrRv] <arguments> 56 EOF 54 printf "Usage: %s [-c|-e|-h|-l|-n|-R|-r|-v [file or directory]]\n" "$0" 55 printf "The arguments for all switches except for '-h' are relative to\n" 56 printf "\t\$kanako_store_dir which is set to %s\n\n" "{$kanako_store_dir}" 57 57 } 58 58 fn_view() { 59 59 if [ -f "${1%%.enc}".enc ]; then 60 ${ encrypt_cmd} ${decrypt_args} "${1%%.enc}".enc60 ${kanako_encrypt_cmd} ${kanako_decrypt_args} "${1%%.enc}".enc 61 61 elif [ -d "${1:-.}" ]; then 62 ${ list_cmd} "${1:-.}"62 ${kanako_list_cmd} "${1:-.}" 63 63 else 64 64 fn_usage … … 71 71 -l) fn_list ;; 72 72 -n) fn_new $2 ;; 73 -r) fn_trash_entry $2 ;;74 73 -R) fn_trash_directory $2 ;; 74 -r) fn_trash_file $2 ;; 75 75 -v) fn_view $2 ;; 76 76 *) fn_usage ;; -
trunk/kanako.conf.example
r13 r14 1 1 # Configuration file for kanako(1) 2 2 3 # clip="xclip -i"4 # clip="wl-copy --primary"5 # list_cmd="tree"3 #kanako_clip_cmd="xclip -i" 4 #kanako_clip_cmd="wl-copy --primary" 5 #kanako_list_cmd="tree" 6 6 7 7 ## age 8 # encrypt_cmd="age"9 # encrypt_args="-e -R ${key_dir}/pub.age--armor"10 # decrypt_args="-d -i ${key_dir}/priv.age"8 #kanako_encrypt_cmd="age" 9 #kanako_encrypt_args="-e -R ${kanako_key_dir}/pub.key --armor" 10 #kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.key" 11 11 12 12 ## cream 13 # encrypt_cmd="cream"14 # encrypt_args="-e -f"15 # decrypt_args="-d"13 #kanako_encrypt_cmd="cream" 14 #kanako_encrypt_args="-e -f" 15 #kanako_decrypt_args="-d" 16 16 17 17 ## gpg 18 # encrypt_cmd="gpg"19 # encrypt_args="-e --recipient ${key_dir}/pub.gpg"20 # decrypt_args="-d"18 #kanako_encrypt_cmd="gpg" 19 #kanako_encrypt_args="-e --recipient ${kanako_key_dir}/pub.key" 20 #kanako_decrypt_args="-d" 21 21 22 22 ## salty 23 # encrypt_cmd="salty"24 # encrypt_args="-e -r $(cat ${key_dir}/pub.slt)"25 # decrypt_args="-d -i ${key_dir}/priv.slt"23 #kanako_encrypt_cmd="salty" 24 #kanako_encrypt_args="-e -r $(cat ${kanako_key_dir}/pub.slt)" 25 #kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.slt" -
trunk/kanako.conf.mdoc
r4 r14 1 .Dd Bureaucracy 65, 31881 .Dd Bureaucracy 73, 3188 2 2 .Dt KANAKO.CONF 5 3 3 .Os … … 10 10 .Bl -tag -width 11n -compact 11 11 .It clip_cmd 12 Clipboard executable to use with 13 the program. 12 Clipboard manager command 13 .It debug 14 Controls whether to use debug 15 mode or not. Any value other 16 than false is interpreted as 17 true. 14 18 .It list_cmd 15 Listing executable to use 16 with the program. 19 Command used to print a listing 20 of the password store 21 .It menu_cmd 22 Menu command for kanako_menu 17 23 .El 18 24 .Ss Encryption section -
trunk/kanako.mdoc
r11 r14 1 .Dd Bureaucracy 7 2, 31881 .Dd Bureaucracy 73, 3188 2 2 .Dt KANAKO 1 3 3 .Os … … 5 5 .Nm kanako 6 6 .Nd the adaptable password manager 7 .Sh SYNOPSIS 8 .Nm 9 .Fl c 10 .Ar args 11 .Nm 12 .Fl e 13 .Ar args 14 .Nm 15 .Fl l 16 .Nm 17 .Fl n 18 .Ar args 19 .Nm 20 .Fl r 21 .Ar args 22 .Nm 23 .Fl R 24 .Ar args 25 .Nm 26 .Fl v 27 .Ar args 7 28 .Sh DESCRIPTION 8 29 It is a clean rewrite of 30 .Xr ayu 1 31 supporting multiple backends 32 and having more add-ons for 33 use with it. However, it 34 may be pretty unstable compared 35 to said tool, but should work 36 well for its purpose. 9 37 .Sh USAGE 10 38 .Bl -tag -width 11n -compact … … 27 55 .Sh SEE ALSO 28 56 .Xr age 1 57 .Xr cream 1 29 58 .Xr gpg 1 30 59 .Xr kanako.conf 5 -
trunk/mkfile
r11 r14 5 5 6 6 install-bin: 7 install - m$EXEC_MODE kanako $PREFIX/bin/kanako7 install -Dm$EXEC_MODE kanako $PREFIX/bin/kanako 8 8 install-examples: 9 install - m$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf9 install -Dm$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf 10 10 install-man: 11 install - m$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.112 install - m$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.511 install -Dm$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1 12 install -Dm$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5 13 13 uninstall-bin: 14 14 rm -f $PREFIX/bin/kanako
Note:
See TracChangeset
for help on using the changeset viewer.