Update configuration format, add switch to install(1) in mkfile
Signed-off-by: Aoi K <koizumi.aoi@kyoko-project.wer.ee> git-svn-id: file:///srv/svn/repo/kanako/trunk@14 62e5d677-aa6e-8c4a-b8cb-b9416171cb8e
This commit is contained in:
parent
81d0c774b1
commit
378502256e
30
kanako
30
kanako
@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh
|
||||||
|
# $KyokoNet: kanako,v 1.7 2022/11/26 08:44:11 akoizumi Exp $
|
||||||
|
|
||||||
readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}"
|
readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}"
|
||||||
readonly kanako_key_dir="${kanako_key_dir:-$HOME/.kanako}"
|
readonly kanako_key_dir="${kanako_key_dir:-$HOME/.kanako}"
|
||||||
@ -22,16 +23,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
fn_copy() {
|
fn_copy() {
|
||||||
fn_view $1 | "${clip_cmd}"
|
fn_view $1 | "${kanako_clip_cmd}"
|
||||||
}
|
}
|
||||||
fn_edit() {
|
fn_edit() {
|
||||||
${encrypt_cmd} ${decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
|
${kanako_encrypt_cmd} ${kanako_decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
|
||||||
"${EDITOR}" "${1%%.enc}"
|
"${EDITOR}" "${1%%.enc}"
|
||||||
${encrypt_cmd} ${encrypt_args} ${1%%.enc} > ${1%%.enc}.enc
|
${kanako_encrypt_cmd} ${kanako_encrypt_args} ${1%%.enc} > ${1%%.enc}.enc
|
||||||
rm "${1%%.enc}"
|
rm "${1%%.enc}"
|
||||||
}
|
}
|
||||||
fn_list() {
|
fn_list() {
|
||||||
"${list_cmd}" "${store_dir}"
|
"${kanako_list_cmd}" "${kanako_store_dir}/"
|
||||||
}
|
}
|
||||||
fn_new() {
|
fn_new() {
|
||||||
test -d $1 && fn_usage && exit 1
|
test -d $1 && fn_usage && exit 1
|
||||||
@ -40,26 +41,25 @@ fn_new() {
|
|||||||
"${EDITOR}" "${tmpfile}"
|
"${EDITOR}" "${tmpfile}"
|
||||||
|
|
||||||
mkdir -p "$(dirname "$1")"
|
mkdir -p "$(dirname "$1")"
|
||||||
${encrypt_cmd} ${encrypt_args} ${tmpfile} > ${1%%.enc}.enc
|
${kanako_encrypt_cmd} ${kanako_encrypt_args} ${tmpfile} > ${1%%.enc}.enc
|
||||||
rm ${tmpfile}
|
rm ${tmpfile}
|
||||||
}
|
}
|
||||||
fn_trash_directory() {
|
fn_trash_directory() {
|
||||||
rm -rf $@
|
rm -rf "$@"
|
||||||
}
|
}
|
||||||
fn_trash_entry() {
|
fn_trash_file() {
|
||||||
rm -f "${1}${2}".enc
|
rm -f "${1}${2}".enc
|
||||||
}
|
}
|
||||||
fn_usage() {
|
fn_usage() {
|
||||||
cat <<EOF
|
printf "Usage: %s [-c|-e|-h|-l|-n|-R|-r|-v [file or directory]]\n" "$0"
|
||||||
Usage:
|
printf "The arguments for all switches except for '-h' are relative to\n"
|
||||||
kanako [-celnrRv] <arguments>
|
printf "\t\$kanako_store_dir which is set to %s\n\n" "{$kanako_store_dir}"
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
fn_view() {
|
fn_view() {
|
||||||
if [ -f "${1%%.enc}".enc ]; then
|
if [ -f "${1%%.enc}".enc ]; then
|
||||||
${encrypt_cmd} ${decrypt_args} "${1%%.enc}".enc
|
${kanako_encrypt_cmd} ${kanako_decrypt_args} "${1%%.enc}".enc
|
||||||
elif [ -d "${1:-.}" ]; then
|
elif [ -d "${1:-.}" ]; then
|
||||||
${list_cmd} "${1:-.}"
|
${kanako_list_cmd} "${1:-.}"
|
||||||
else
|
else
|
||||||
fn_usage
|
fn_usage
|
||||||
fi
|
fi
|
||||||
@ -70,8 +70,8 @@ case $1 in
|
|||||||
-e) fn_edit $2 ;;
|
-e) fn_edit $2 ;;
|
||||||
-l) fn_list ;;
|
-l) fn_list ;;
|
||||||
-n) fn_new $2 ;;
|
-n) fn_new $2 ;;
|
||||||
-r) fn_trash_entry $2 ;;
|
|
||||||
-R) fn_trash_directory $2 ;;
|
-R) fn_trash_directory $2 ;;
|
||||||
|
-r) fn_trash_file $2 ;;
|
||||||
-v) fn_view $2 ;;
|
-v) fn_view $2 ;;
|
||||||
*) fn_usage ;;
|
*) fn_usage ;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
# Configuration file for kanako(1)
|
# Configuration file for kanako(1)
|
||||||
|
|
||||||
#clip="xclip -i"
|
#kanako_clip_cmd="xclip -i"
|
||||||
#clip="wl-copy --primary"
|
#kanako_clip_cmd="wl-copy --primary"
|
||||||
#list_cmd="tree"
|
#kanako_list_cmd="tree"
|
||||||
|
|
||||||
## age
|
## age
|
||||||
#encrypt_cmd="age"
|
#kanako_encrypt_cmd="age"
|
||||||
#encrypt_args="-e -R ${key_dir}/pub.age --armor"
|
#kanako_encrypt_args="-e -R ${kanako_key_dir}/pub.key --armor"
|
||||||
#decrypt_args="-d -i ${key_dir}/priv.age"
|
#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.key"
|
||||||
|
|
||||||
## cream
|
## cream
|
||||||
#encrypt_cmd="cream"
|
#kanako_encrypt_cmd="cream"
|
||||||
#encrypt_args="-e -f"
|
#kanako_encrypt_args="-e -f"
|
||||||
#decrypt_args="-d"
|
#kanako_decrypt_args="-d"
|
||||||
|
|
||||||
## gpg
|
## gpg
|
||||||
#encrypt_cmd="gpg"
|
#kanako_encrypt_cmd="gpg"
|
||||||
#encrypt_args="-e --recipient ${key_dir}/pub.gpg"
|
#kanako_encrypt_args="-e --recipient ${kanako_key_dir}/pub.key"
|
||||||
#decrypt_args="-d"
|
#kanako_decrypt_args="-d"
|
||||||
|
|
||||||
## salty
|
## salty
|
||||||
#encrypt_cmd="salty"
|
#kanako_encrypt_cmd="salty"
|
||||||
#encrypt_args="-e -r $(cat ${key_dir}/pub.slt)"
|
#kanako_encrypt_args="-e -r $(cat ${kanako_key_dir}/pub.slt)"
|
||||||
#decrypt_args="-d -i ${key_dir}/priv.slt"
|
#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.slt"
|
@ -1,4 +1,4 @@
|
|||||||
.Dd Bureaucracy 65, 3188
|
.Dd Bureaucracy 73, 3188
|
||||||
.Dt KANAKO.CONF 5
|
.Dt KANAKO.CONF 5
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -9,11 +9,17 @@
|
|||||||
.Ss General section
|
.Ss General section
|
||||||
.Bl -tag -width 11n -compact
|
.Bl -tag -width 11n -compact
|
||||||
.It clip_cmd
|
.It clip_cmd
|
||||||
Clipboard executable to use with
|
Clipboard manager command
|
||||||
the program.
|
.It debug
|
||||||
|
Controls whether to use debug
|
||||||
|
mode or not. Any value other
|
||||||
|
than false is interpreted as
|
||||||
|
true.
|
||||||
.It list_cmd
|
.It list_cmd
|
||||||
Listing executable to use
|
Command used to print a listing
|
||||||
with the program.
|
of the password store
|
||||||
|
.It menu_cmd
|
||||||
|
Menu command for kanako_menu
|
||||||
.El
|
.El
|
||||||
.Ss Encryption section
|
.Ss Encryption section
|
||||||
.Bl -tag -width 11n -compact
|
.Bl -tag -width 11n -compact
|
||||||
|
33
kanako.mdoc
33
kanako.mdoc
@ -1,11 +1,39 @@
|
|||||||
.Dd Bureaucracy 72, 3188
|
.Dd Bureaucracy 73, 3188
|
||||||
.Dt KANAKO 1
|
.Dt KANAKO 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm kanako
|
.Nm kanako
|
||||||
.Nd the adaptable password manager
|
.Nd the adaptable password manager
|
||||||
|
.Sh SYNOPSIS
|
||||||
|
.Nm
|
||||||
|
.Fl c
|
||||||
|
.Ar args
|
||||||
|
.Nm
|
||||||
|
.Fl e
|
||||||
|
.Ar args
|
||||||
|
.Nm
|
||||||
|
.Fl l
|
||||||
|
.Nm
|
||||||
|
.Fl n
|
||||||
|
.Ar args
|
||||||
|
.Nm
|
||||||
|
.Fl r
|
||||||
|
.Ar args
|
||||||
|
.Nm
|
||||||
|
.Fl R
|
||||||
|
.Ar args
|
||||||
|
.Nm
|
||||||
|
.Fl v
|
||||||
|
.Ar args
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
|
It is a clean rewrite of
|
||||||
|
.Xr ayu 1
|
||||||
|
supporting multiple backends
|
||||||
|
and having more add-ons for
|
||||||
|
use with it. However, it
|
||||||
|
may be pretty unstable compared
|
||||||
|
to said tool, but should work
|
||||||
|
well for its purpose.
|
||||||
.Sh USAGE
|
.Sh USAGE
|
||||||
.Bl -tag -width 11n -compact
|
.Bl -tag -width 11n -compact
|
||||||
.It -n
|
.It -n
|
||||||
@ -26,6 +54,7 @@ View an entry
|
|||||||
.El
|
.El
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr age 1
|
.Xr age 1
|
||||||
|
.Xr cream 1
|
||||||
.Xr gpg 1
|
.Xr gpg 1
|
||||||
.Xr kanako.conf 5
|
.Xr kanako.conf 5
|
||||||
.Xr pwgen 1
|
.Xr pwgen 1
|
||||||
|
8
mkfile
8
mkfile
@ -4,12 +4,12 @@ install:V: install-bin install-examples install-man
|
|||||||
uninstall:V: uninstall-bin uninstall-examples uninstall-man
|
uninstall:V: uninstall-bin uninstall-examples uninstall-man
|
||||||
|
|
||||||
install-bin:
|
install-bin:
|
||||||
install -m$EXEC_MODE kanako $PREFIX/bin/kanako
|
install -Dm$EXEC_MODE kanako $PREFIX/bin/kanako
|
||||||
install-examples:
|
install-examples:
|
||||||
install -m$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
|
install -Dm$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
|
||||||
install-man:
|
install-man:
|
||||||
install -m$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
|
install -Dm$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
|
||||||
install -m$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
|
install -Dm$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
|
||||||
uninstall-bin:
|
uninstall-bin:
|
||||||
rm -f $PREFIX/bin/kanako
|
rm -f $PREFIX/bin/kanako
|
||||||
uninstall-examples:
|
uninstall-examples:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user