diff options
| author | Shulhan <ms@kilabit.info> | 2023-05-15 01:23:27 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-05-15 01:23:27 +0700 |
| commit | 7398b1b41deb5bc165c4bde3718aaffc1f32b01a (patch) | |
| tree | ef44939d4c5ca70793a56bb6bdfff66806e9820c | |
| parent | 85d43645f617e4679d4f08cc6f4501ccdc4e2143 (diff) | |
| download | gotp-7398b1b41deb5bc165c4bde3718aaffc1f32b01a.tar.xz | |
all: convert the README from asciidoc to markdown
I use two remote repositories: GitHub and SourceHut.
GitHub support rendering README using asciidoc while SourceHut not.
This cause the repository that use README.adoc rendered as text in
SourceHut which make the repository page less readable.
Also, the pkg.go.dev now render README but only support Markdown.
Since we cannot control the SourceHut and go.dev, the only option is
to support converting Markdown in ciigo so I can write README using
Markdown and the rest of documentation using Asciidoc.
| -rw-r--r-- | .reuse/dep5 | 4 | ||||
| l--------- | README.adoc | 1 | ||||
| -rw-r--r-- | README.md (renamed from README) | 69 | ||||
| l--------- | _doc/README.adoc | 1 | ||||
| l--------- | _doc/README.md | 1 | ||||
| -rw-r--r-- | cli.go | 2 |
6 files changed, 47 insertions, 31 deletions
diff --git a/.reuse/dep5 b/.reuse/dep5 index 90c86e3..a5d3b9a 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,6 +3,10 @@ Upstream-Name: gotp Upstream-Contact: Shulhan <ms@kilabit.info> Source: https://git.sr.ht/~shulhan/gotp +Files: README.md +Copyright: 2022 Shulhan <ms@kilabit.info> +License: GPL-3.0-or-later + Files: go.sum Copyright: 2022 Shulhan <ms@kilabit.info> License: GPL-3.0-or-later diff --git a/README.adoc b/README.adoc deleted file mode 120000 index 100b938..0000000 --- a/README.adoc +++ /dev/null @@ -1 +0,0 @@ -README
\ No newline at end of file @@ -1,17 +1,17 @@ -// SPDX-FileCopyrightText: 2021 M. Shulhan <ms@kilabit.info> -// SPDX-License-Identifier: GPL-3.0-or-later -= gotp -Shulhan <ms@kilabit.info> +# gotp A command line interface to manage and generate Time-based One Time Password (TOTP). -== SYNOPSIS +## SYNOPSIS - gotp <command> <parameters...> +``` +gotp <command> <parameters...> +``` -== DESCRIPTION +## DESCRIPTION +``` add <LABEL> <HASH>:<BASE32-SECRET>[:DIGITS][:TIME-STEP][:ISSUER] Add a TOTP secret identified by unique LABEL. @@ -47,8 +47,9 @@ remove <LABEL> rename <LABEL> <NEW-LABEL> Rename a LABEL into NEW-LABEL. +``` -== ENCRYPTION +## ENCRYPTION On the first run, the gotp command will ask for path of private key. If the key exist, all the OTP values (excluding the label) will be encrypted. @@ -57,46 +58,58 @@ The private key must be RSA based. One can skip inputting the private key by pressing enter, and the OTP configuration will be stored as plain text. -== FILES +## FILES $USER_CONFIG_DIR/gotp/gotp.conf:: Path to file where the configuration and secret are stored. -== EXAMPLES +## EXAMPLES Add "my-totp" to configuration using SHA1 as hash function, "GEZDGNBVGY3TQOJQ" as the secret, with 6 digits passwords, and 30 seconds as time step. - $ gotp add my-totp SHA1:GEZDGNBVGY3TQOJQ:6:30 +``` +$ gotp add my-totp SHA1:GEZDGNBVGY3TQOJQ:6:30 +``` Generate 3 recents passwords from "my-totp", - $ gotp gen my-totp 3 - gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf - 847945 - 326823 - 767317 +``` +$ gotp gen my-totp 3 +gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf +847945 +326823 +767317 +``` Import the exported Aegis TOTP from file, - $ gotp import aegis aegis-export-uri.txt - gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf - OK +``` +$ gotp import aegis aegis-export-uri.txt +gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf +OK +``` List all labels stored in the configuration, - $ gotp list - gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf - my-totp +``` +$ gotp list +gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf +my-totp +``` Remove a label "my-totp", - $ gotp remove my-totp - gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf - OK +``` +$ gotp remove my-totp +gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf +OK +``` Rename a label "my-totp" to "my-otp", - $ gotp rename my-totp my-otp - gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf - OK +``` +$ gotp rename my-totp my-otp +gotp: reading configuration from /home/$USER/.config/gotp/gotp.conf +OK +``` diff --git a/_doc/README.adoc b/_doc/README.adoc deleted file mode 120000 index 59a23c4..0000000 --- a/_doc/README.adoc +++ /dev/null @@ -1 +0,0 @@ -../README
\ No newline at end of file diff --git a/_doc/README.md b/_doc/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/_doc/README.md @@ -0,0 +1 @@ +../README.md
\ No newline at end of file @@ -19,7 +19,7 @@ import ( "golang.org/x/term" ) -//go:embed README +//go:embed README.md var Readme string type Cli struct { |
