2019-12-04 11:52:17 +01:00
|
|
|
.\"
|
|
|
|
.\" sekrit.1
|
2020-05-25 17:10:59 +02:00
|
|
|
.\" Written in 2018,2020 by Lucas
|
2019-12-04 11:52:17 +01:00
|
|
|
.\" CC0 1.0 Universal/Public domain - No rights reserved
|
|
|
|
.\"
|
|
|
|
.\" To the extent possible under law, the author(s) have dedicated all
|
|
|
|
.\" copyright and related and neighboring rights to this software to the
|
|
|
|
.\" public domain worldwide. This software is distributed without any
|
|
|
|
.\" warranty. You should have received a copy of the CC0 Public Domain
|
|
|
|
.\" Dedication along with this software. If not, see
|
|
|
|
.\" <http://creativecommons.org/publicdomain/zero/1.0/>.
|
|
|
|
.\"
|
2020-08-26 04:24:01 +02:00
|
|
|
.Dd August 26, 2020
|
2019-12-04 11:52:17 +01:00
|
|
|
.Dt SEKRIT 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm sekrit
|
|
|
|
.Nd Secret files manager
|
|
|
|
.Sh SYNOPSIS
|
2020-05-25 17:10:59 +02:00
|
|
|
.Nm
|
2019-12-04 11:52:17 +01:00
|
|
|
.Cm add
|
2020-06-15 04:43:34 +02:00
|
|
|
.Op Fl f
|
2019-12-04 11:52:17 +01:00
|
|
|
.Ar key
|
|
|
|
.Op Ar value ...
|
2020-05-25 17:10:59 +02:00
|
|
|
.Nm
|
|
|
|
.Cm cp
|
|
|
|
.Op Fl k
|
|
|
|
.Op key
|
|
|
|
.Nm
|
2019-12-04 11:52:17 +01:00
|
|
|
.Cm gen
|
|
|
|
.Op Fl l Ar length
|
|
|
|
.Op Ar chars
|
2020-05-25 17:10:59 +02:00
|
|
|
.Nm
|
2019-12-04 11:52:17 +01:00
|
|
|
.Cm get
|
|
|
|
.Ar key
|
2020-05-25 17:10:59 +02:00
|
|
|
.Nm
|
2019-12-04 11:52:17 +01:00
|
|
|
.Cm has
|
|
|
|
.Ar key
|
2020-05-25 17:10:59 +02:00
|
|
|
.Nm
|
2019-12-04 11:52:17 +01:00
|
|
|
.Cm ls
|
|
|
|
.Op Ar keys ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
is a small shell script for managing encrypted files.
|
|
|
|
It leverages
|
|
|
|
.Xr gpg2 1
|
|
|
|
to create and read encrypted files,
|
|
|
|
and can generate random data to populate them.
|
|
|
|
.Pp
|
|
|
|
Because of this,
|
|
|
|
.Nm
|
|
|
|
can be used as an account credentials manager,
|
|
|
|
or as a general-purpose key-value store of encrypted information.
|
|
|
|
.Bl -tag -width Ds
|
2020-06-15 04:43:34 +02:00
|
|
|
.It Nm Cm add Oo Fl f Oc Ar key Op Ar value ...
|
2019-12-04 11:52:17 +01:00
|
|
|
Adds a value to
|
|
|
|
.Ar key .
|
|
|
|
.Ar value
|
|
|
|
is inserted as is, without any extra modifications.
|
|
|
|
If no
|
|
|
|
.Ar value
|
|
|
|
is specified on command line,
|
|
|
|
.Cm add
|
|
|
|
will read the value from standard input.
|
|
|
|
.Cm add
|
|
|
|
will fail if
|
|
|
|
.Ar key
|
2020-06-15 04:43:34 +02:00
|
|
|
already has a value, unless
|
|
|
|
.Fl f
|
|
|
|
is specified.
|
2020-05-25 17:10:59 +02:00
|
|
|
.It Nm Cm cp Oo Fl k Oc Ar key
|
|
|
|
Decrypts the value associated with
|
|
|
|
.Ar key
|
|
|
|
and copies it to the clipboard with
|
|
|
|
.Xr xclip 1 .
|
|
|
|
It removes the last newline unless
|
|
|
|
.Fl k
|
|
|
|
is given.
|
2019-12-04 11:52:17 +01:00
|
|
|
.It Nm Cm gen Oo Fl l Ar length Oc Op Ar chars
|
|
|
|
Outputs a randomly generated sequence.
|
|
|
|
The generated sequence consist of characters
|
|
|
|
.Ar chars .
|
|
|
|
Defaults to
|
|
|
|
.Ar +/0-9A-Za-z .
|
|
|
|
If
|
|
|
|
.Fl l Ar length
|
|
|
|
is provided, the randomly generated sequence will be
|
|
|
|
.Ar length
|
|
|
|
characters long.
|
|
|
|
Defaults to 43.
|
|
|
|
.It Nm Cm get Ar key
|
|
|
|
Decrypts the value associated with
|
|
|
|
.Ar key
|
|
|
|
and prints it to standard output.
|
|
|
|
Fails if
|
|
|
|
.Ar key
|
|
|
|
doesn't have a value associated with it.
|
|
|
|
.It Nm Cm has Ar key
|
|
|
|
Returns success if
|
|
|
|
.Ar key
|
|
|
|
has a value associated with it.
|
|
|
|
Fails otherwise.
|
|
|
|
.It Nm Cm ls Op Ar keys ...
|
|
|
|
For each
|
|
|
|
.Ar key
|
|
|
|
given as argument,
|
|
|
|
list all the registered keys under that hierarchy.
|
|
|
|
If no
|
|
|
|
.Ar key
|
|
|
|
is given, list all the registeres keys.
|
|
|
|
.El
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
.Bl -tag -width SEKRIT_GPG_ID
|
|
|
|
.It Ev SEKRIT_DIR
|
|
|
|
Secret files base directory.
|
|
|
|
Defaults to
|
|
|
|
.Pa ~/keep/sekrit .
|
|
|
|
.It Ev SEKRIT_GPG_ID
|
|
|
|
The recipient to whom encrypt the files.
|
2020-08-26 04:24:01 +02:00
|
|
|
Must be set for
|
|
|
|
.Nm
|
|
|
|
to work.
|
2019-12-04 11:52:17 +01:00
|
|
|
.El
|
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
|
|
|
.Sh EXAMPLES
|
|
|
|
To use
|
|
|
|
.Nm
|
|
|
|
as an account credentials manager, you can run
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
sekrit add accounts/example.com/user myuser
|
|
|
|
sekrit gen accounts/example.com/pass
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Then, to retrieve credentials to login as
|
|
|
|
.Ar myuser
|
|
|
|
in
|
|
|
|
.Ar example.com
|
|
|
|
you can run
|
|
|
|
.Bd -literal -offset indent
|
2020-05-25 17:10:59 +02:00
|
|
|
sekrit cp accounts/example.com/user
|
|
|
|
sekrit cp accounts/example.com/pass
|
2019-12-04 11:52:17 +01:00
|
|
|
.Ed
|
2020-05-25 17:10:59 +02:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr gpg2 1 ,
|
|
|
|
.Xr xclip 1
|
2019-12-04 11:52:17 +01:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An Lucas
|
|
|
|
.Sh LICENSE
|
|
|
|
.Nm
|
|
|
|
is in the public domain.
|
|
|
|
.Pp
|
|
|
|
To the extent possible under law, the author(s) have dedicated all
|
|
|
|
copyright and related and neighboring rights to this software to the
|
|
|
|
public domain worldwide.
|
|
|
|
.Pp
|
|
|
|
.Lk http://creativecommons.org/publicdomain/zero/1.0/
|