commit d55cab46a70d5e576d3dde569b2e2b0610544778 Author: koizumi.aoi Date: Sun Oct 9 02:26:55 2022 +0000 Initial payload Signed-off-by: Aoi K git-svn-id: file:///srv/svn/repo/kanako/trunk@1 62e5d677-aa6e-8c4a-b8cb-b9416171cb8e diff --git a/DPL-2.3 b/DPL-2.3 new file mode 100644 index 0000000..c467e69 --- /dev/null +++ b/DPL-2.3 @@ -0,0 +1,15 @@ +Discordian Public License 2.3 (DPL-2.3) + +All Rites Reversed (ΔΈ) 3188 Aoi Koizumi [Champagne Supernova] + +Permission is hereby granted, to any person obtaining a copy of this +material without restriction, including but not limited the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the material, subject to the following conditions: + +YOU AGREE THAT THERE IS NO GODDESS BUT GODDESS AND SHE IS YOUR GODDESS & +THAT THERE IS NO ERISIAN MOVEMENT BUT THE ERISIAN MOVEMENT AND IT IS THE +ERISIAN MOVEMENT. + +HAIL ERIS! +FIVE TONS OF FLAX diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3b0653 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# ayu-ng +Rewrite of `ayu(1)`, an actually boring password manager, now with interchangeable encryption backend. + +## Backends supported +* [age](https://age-encryption.org) +* [gpg](https://gnupg.org) +* [saltpack (via salty)](https://git.mills.io/prologic/salty) + +## Dependencies +* Any of the above, depending how you configured it +* `ls(1)` or `tree(1)` for printing a list +* `mandoc(1)` for documentation + +## License +* [Discordian Public License, version 2.3](https://gt.kalli.st/novaburst/discordian-public-license/src/branch/discordia/DPL-2.3) + +## Related software +* [biox/pa](https://github.com/biox/pa) +* [e-zk/page](https://github.com/e-zk/page) +* [kl3/spm](https://notabug.org/kl3/spm) +* [nmeum/tpm](https://github.com/nmeum/tpm) +* [shokara/angou](https://gt.kalli.st/shokara/angou) +* [zx2c4/pass](https://passwordstore.org) diff --git a/ayu-ng b/ayu-ng new file mode 100755 index 0000000..59faac3 --- /dev/null +++ b/ayu-ng @@ -0,0 +1,66 @@ +#!/bin/sh -e + +conf_dir=${conf_dir:-$HOME/.config/ayu} +key_dir=${key_dir:-$HOME/.ayu} +store_dir=${store_dir:-$HOME/.ayu-store} + +cd ${store_dir} || exit 1 + +. ${conf_dir}/config + +fn_copy() { + fn_view $2 | ${clip} +} +fn_edit() { + ${decrypt_cmd} ${decrypt_args} ${1%%.enc}.enc + ${EDITOR} ${1%%.enc} + ${encrypt_cmd} ${encrypt_args} ${1%%.enc} + rm ${1%%.enc} +} +fn_generate() { + pwgen -s ${2:-80} +} +fn_list() { + if command -v tree 2>/dev/null; then + tree ${store_dir} + else + ls -l ${store_dir} + fi +} +fn_new() { + test -d $1 && fn_usage && exit 1 + + tmpfile=$(mktemp) + ${EDITOR} ${tmpfile} + + mkdir -p $(dirname $1) + ${encrypt_cmd} ${encrypt_args} ${tmpfile} + + mv ${tmpfile}.enc ${1%%.enc}.enc + rm ${tmpfile} +} +fn_trash_directory() { + rm -rf $@ +} +fn_trash_entry() { + rm -f ${1}${2},enc +} +fn_usage() { + cat < +ayu [copy|edit|generate|list|add|trash|trashdir|view] +EOF +} + +case $1 in + -c | copy) fn_copy $2 ;; + -e | edit) fn_edit $2 ;; + -g | generate) fn_generate $2 ;; + -l | list) fn_list ;; + -n | add) fn_new ;; + -r | trash) fn_trash $2 ;; + -R | trashd) fn_trash_directory $2 ;; + -v | view) fn_view $2 ;; + *) fn_usage ;; +esac diff --git a/ayu-ng.conf.example b/ayu-ng.conf.example new file mode 100644 index 0000000..0a270a5 --- /dev/null +++ b/ayu-ng.conf.example @@ -0,0 +1,18 @@ +# [General] +#clip="xclip -i" + +# [Encryption] +## age +#encrypt_cmd="age" +#encrypt_args="-e -R ${key_dir}/pub.age" +#decrypt_args="-d -i ${key_dir}/priv.age" + +## gpg +#encrypt_cmd="gpg" +#encrypt_args="-e --recipient ${key_dir}/pub.gpg" +#decrypt_args="-d" + +## salty +#encrypt_cmd="salty" +#encrypt_args="-e -r $(cat ${key_dir}/pub.slt)" +#decrypt_args="-d -i ${key_dir}/priv.slt" diff --git a/ayu-ng.mdoc b/ayu-ng.mdoc new file mode 100644 index 0000000..b0a97f8 --- /dev/null +++ b/ayu-ng.mdoc @@ -0,0 +1,43 @@ +.Dd Bureaucracy 62, 3188 +.Dt AYU-NG 1 +.Os +.Sh NAME +.Nm ayu-ng +.Nd rewrite of ayu, an actually boring password manager +.Sh DESCRIPTION + +.Sh USAGE +.Bl -tag -width 11n -compact +.It add, -n +Add a new entry +.It copy, -c +Copy an entry's text to the clipboard +.It edit, -e +Edit an entry +.It generate, -g +Generate a random password +.It list, -l +List all entries +.It del, -r +Remove single entries +.It delr, -R +Remove recursively a directory w/ entries +.It view, -v +View an entry +.Bl +.El +.Sh SEE ALSO +.Xr 5 ayu-ng.conf +.Rs +.%A Rob Pike +.%T "UNIX Style, or cat -v Considered Harmful" +.%J "USENIX Summer Conference Proceedings" +.%D 1983 +.Re +.Sh AUTHORS +.An Aoi Koizumi Aq Mt koizumi.aoi@kyoko-project.wer.ee +.Sh BUGS +Under the Wayland display protocol, +the clipboard subcommand won't work, +due to 'Permission denied'. On X11 +it works just fine. \ No newline at end of file