mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 12:31:02 +01:00
fix pod bug
This commit is contained in:
45
anydb.1
45
anydb.1
@@ -1,4 +1,4 @@
|
|||||||
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
|
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
|
||||||
.\"
|
.\"
|
||||||
.\" Standard preamble:
|
.\" Standard preamble:
|
||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
.\"
|
.\"
|
||||||
.IX Title "ANYDB 1"
|
.IX Title "ANYDB 1"
|
||||||
.TH ANYDB 1 "2024-12-23" "1" "User Commands"
|
.TH ANYDB 1 "2024-12-25" "1" "User Commands"
|
||||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||||
.\" way too many mistakes in technical documents.
|
.\" way too many mistakes in technical documents.
|
||||||
.if n .ad l
|
.if n .ad l
|
||||||
@@ -276,7 +276,7 @@ You might as well specify a file directly using the \f(CW\*(C`\-f\*(C'\fR option
|
|||||||
.PP
|
.PP
|
||||||
Values can be encrypted using \fBChaCha20Poly1305\fR when you specify the
|
Values can be encrypted using \fBChaCha20Poly1305\fR when you specify the
|
||||||
\&\f(CW\*(C`\-e\*(C'\fR option. Anydb will ask you interactively for a passphrase. You
|
\&\f(CW\*(C`\-e\*(C'\fR option. Anydb will ask you interactively for a passphrase. You
|
||||||
might as well provide the passphrase using the environment variable
|
can also provide the passphrase using the environment variable
|
||||||
\&\f(CW\*(C`ANYDB_PASSWORD\*(C'\fR. To encrypt the value, a cryptographically secure
|
\&\f(CW\*(C`ANYDB_PASSWORD\*(C'\fR. To encrypt the value, a cryptographically secure
|
||||||
key will be derived from the passphrase using the ArgonID2
|
key will be derived from the passphrase using the ArgonID2
|
||||||
algorithm. Each value can be encrypted with another passphrase. So,
|
algorithm. Each value can be encrypted with another passphrase. So,
|
||||||
@@ -339,7 +339,7 @@ If the value is encrypted, you will be asked for the passphrase to
|
|||||||
decrypt it. If the environment variable \f(CW\*(C`ANYDB_PASSWORD\*(C'\fR is set, its
|
decrypt it. If the environment variable \f(CW\*(C`ANYDB_PASSWORD\*(C'\fR is set, its
|
||||||
value will be used instead.
|
value will be used instead.
|
||||||
.PP
|
.PP
|
||||||
There are different output modes you can choos from: simple, wide and
|
There are different output modes you can choose from: simple, wide and
|
||||||
json. The \*(L"simple\*(R" mode is the default one, it just prints the value
|
json. The \*(L"simple\*(R" mode is the default one, it just prints the value
|
||||||
as is. The \*(L"wide\*(R" mode prints a tabular output similar to the \fBlist\fR
|
as is. The \*(L"wide\*(R" mode prints a tabular output similar to the \fBlist\fR
|
||||||
subcommand, see there for more details. The options \f(CW\*(C`\-n\*(C'\fR and \f(CW\*(C`\-N\*(C'\fR
|
subcommand, see there for more details. The options \f(CW\*(C`\-n\*(C'\fR and \f(CW\*(C`\-N\*(C'\fR
|
||||||
@@ -356,14 +356,16 @@ Usage:
|
|||||||
.PP
|
.PP
|
||||||
.Vb 2
|
.Vb 2
|
||||||
\& Usage:
|
\& Usage:
|
||||||
\& anydb list [<filter\-regex>] [\-t <tag>] [\-m <mode>] [\-n \-N] [\-T <tpl>] [flags]
|
\& anydb list [<filter\-regex>] [\-t <tag>] [\-m <mode>] [\-n \-N] [\-T <tpl>] [\-i] [flags]
|
||||||
\&
|
\&
|
||||||
\& Aliases:
|
\& Aliases:
|
||||||
\& list, /, ls
|
\& list, /, ls
|
||||||
\&
|
\&
|
||||||
\& Flags:
|
\& Flags:
|
||||||
|
\& \-i, \-\-case\-insensitive filter case insensitive
|
||||||
\& \-h, \-\-help help for list
|
\& \-h, \-\-help help for list
|
||||||
\& \-m, \-\-mode string output format (table|wide|json|template), wide is a verbose table. (default \*(Aqtable\*(Aq)
|
\& \-m, \-\-mode string output format (table|wide|json|template),
|
||||||
|
\& wide is a verbose table. (default \*(Aqtable\*(Aq)
|
||||||
\& \-n, \-\-no\-headers omit headers in tables
|
\& \-n, \-\-no\-headers omit headers in tables
|
||||||
\& \-N, \-\-no\-human do not translate to human readable values
|
\& \-N, \-\-no\-human do not translate to human readable values
|
||||||
\& \-t, \-\-tags stringArray tags, multiple allowed
|
\& \-t, \-\-tags stringArray tags, multiple allowed
|
||||||
@@ -405,6 +407,8 @@ about the syntax, refer to
|
|||||||
regexp dialect is not \s-1PCRE\s0 compatible, but supports most of its
|
regexp dialect is not \s-1PCRE\s0 compatible, but supports most of its
|
||||||
features.
|
features.
|
||||||
.PP
|
.PP
|
||||||
|
If you want to search case insensitive, add the option \f(CW\*(C`\-i\*(C'\fR.
|
||||||
|
.PP
|
||||||
You can \- as with the \fBget\fR command \- use other output modes. The
|
You can \- as with the \fBget\fR command \- use other output modes. The
|
||||||
default mode is \*(L"table\*(R". The \*(L"wide\*(R" mode is, as already mentioned, a
|
default mode is \*(L"table\*(R". The \*(L"wide\*(R" mode is, as already mentioned, a
|
||||||
more detailed table. Also supported is \*(L"json\*(R" mode and \*(L"template\*(R"
|
more detailed table. Also supported is \*(L"json\*(R" mode and \*(L"template\*(R"
|
||||||
@@ -465,7 +469,7 @@ behavior by setting the environment variable \f(CW\*(C`EDITOR\*(C'\fR appropriat
|
|||||||
Please note, that this does not work with binary content!
|
Please note, that this does not work with binary content!
|
||||||
.SS "export"
|
.SS "export"
|
||||||
.IX Subsection "export"
|
.IX Subsection "export"
|
||||||
Since the bbold database file is not portable across platforms (it is
|
Since the bbolt database file is not portable across platforms (it is
|
||||||
bound to the endianess of the \s-1CPU\s0 it was being created on), you might
|
bound to the endianess of the \s-1CPU\s0 it was being created on), you might
|
||||||
want to create a backup file of your database. You can do this with
|
want to create a backup file of your database. You can do this with
|
||||||
the \fBexport\fR subcommand.
|
the \fBexport\fR subcommand.
|
||||||
@@ -599,8 +603,20 @@ required, the template provided applies to every matching entry
|
|||||||
separatley.
|
separatley.
|
||||||
.PP
|
.PP
|
||||||
The following template variables can be used:
|
The following template variables can be used:
|
||||||
.IP "\fBKey\fR \- string =item \fBValue\fR \- string =item \fBBin\fR \- []byte =item \fBCreated\fR \- time.Time =item \fBTags\fR \- []string =item \fBEncrypted\fR bool" 4
|
.IP "\fBKey\fR \- string" 4
|
||||||
.IX Item "Key - string =item Value - string =item Bin - []byte =item Created - time.Time =item Tags - []string =item Encrypted bool"
|
.IX Item "Key - string"
|
||||||
|
.PD 0
|
||||||
|
.IP "\fBValue\fR \- string" 4
|
||||||
|
.IX Item "Value - string"
|
||||||
|
.IP "\fBBin\fR \- []byte" 4
|
||||||
|
.IX Item "Bin - []byte"
|
||||||
|
.IP "\fBCreated\fR \- time.Time" 4
|
||||||
|
.IX Item "Created - time.Time"
|
||||||
|
.IP "\fBTags\fR \- []string" 4
|
||||||
|
.IX Item "Tags - []string"
|
||||||
|
.IP "\fBEncrypted\fR bool" 4
|
||||||
|
.IX Item "Encrypted bool"
|
||||||
|
.PD
|
||||||
.PP
|
.PP
|
||||||
Prepend a single dot (\*(L".\*(R") before each variable name.
|
Prepend a single dot (\*(L".\*(R") before each variable name.
|
||||||
.PP
|
.PP
|
||||||
@@ -627,7 +643,7 @@ Print the values in \s-1CSV\s0 format \s-1ONLY\s0 if they have some tag:
|
|||||||
.Ve
|
.Ve
|
||||||
.SH "CONFIGURATION"
|
.SH "CONFIGURATION"
|
||||||
.IX Header "CONFIGURATION"
|
.IX Header "CONFIGURATION"
|
||||||
Anydb looks at the following location for a configuration file, in
|
Anydb looks at the following locations for a configuration file, in
|
||||||
that order:
|
that order:
|
||||||
.ie n .IP """$HOME/.config/anydb/anydb.toml""" 4
|
.ie n .IP """$HOME/.config/anydb/anydb.toml""" 4
|
||||||
.el .IP "\f(CW$HOME/.config/anydb/anydb.toml\fR" 4
|
.el .IP "\f(CW$HOME/.config/anydb/anydb.toml\fR" 4
|
||||||
@@ -643,17 +659,18 @@ that order:
|
|||||||
.el .IP "or specify one using \f(CW\-c\fR" 4
|
.el .IP "or specify one using \f(CW\-c\fR" 4
|
||||||
.IX Item "or specify one using -c"
|
.IX Item "or specify one using -c"
|
||||||
.PD
|
.PD
|
||||||
|
.PP
|
||||||
The configuration format uses the \s-1TOML\s0 language, refer to
|
The configuration format uses the \s-1TOML\s0 language, refer to
|
||||||
<https://toml.io/en/> for more details. The key names correspond to
|
<https://toml.io/en/> for more details. The key names correspond to
|
||||||
the commandline options in most cases.
|
the commandline options in most cases.
|
||||||
.Sp
|
.PP
|
||||||
Configuration follows a certain precedence: the files are tried to be
|
Configuration follows a certain precedence: the files are tried to be
|
||||||
read in the given order, followed by commandline options. That is, the
|
read in the given order, followed by commandline options. That is, the
|
||||||
last configuration file wins, unless the user provides a commandline
|
last configuration file wins, unless the user provides a commandline
|
||||||
option, then this setting will be taken.
|
option, then this setting will be taken.
|
||||||
.Sp
|
.PP
|
||||||
A complete configuration file might look like this:
|
A complete configuration file might look like this:
|
||||||
.Sp
|
.PP
|
||||||
.Vb 7
|
.Vb 7
|
||||||
\& # defaults
|
\& # defaults
|
||||||
\& dbfile = "~/.config/anydb/default.db"
|
\& dbfile = "~/.config/anydb/default.db"
|
||||||
@@ -670,7 +687,7 @@ A complete configuration file might look like this:
|
|||||||
\& [buckets.test]
|
\& [buckets.test]
|
||||||
\& encrypt = false
|
\& encrypt = false
|
||||||
.Ve
|
.Ve
|
||||||
.Sp
|
.PP
|
||||||
Under normal circumstances you don't need a configuration
|
Under normal circumstances you don't need a configuration
|
||||||
file. However, if you want to use different buckets, then this might
|
file. However, if you want to use different buckets, then this might
|
||||||
be a handy option. Buckets are being configured in ini-style with the
|
be a handy option. Buckets are being configured in ini-style with the
|
||||||
|
|||||||
@@ -526,7 +526,6 @@ term "bucket." followed by the bucket name. In the example above we
|
|||||||
enable encryption for the default bucket "data" and disable it for a
|
enable encryption for the default bucket "data" and disable it for a
|
||||||
bucket "test". To use different buckets, use the C<-b> option.
|
bucket "test". To use different buckets, use the C<-b> option.
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=head1 REST API
|
=head1 REST API
|
||||||
|
|
||||||
|
|||||||
61
cmd/anydb.go
61
cmd/anydb.go
@@ -116,12 +116,12 @@ SUBCOMMANDS
|
|||||||
anydb set key -f file
|
anydb set key -f file
|
||||||
|
|
||||||
Values can be encrypted using ChaCha20Poly1305 when you specify the "-e"
|
Values can be encrypted using ChaCha20Poly1305 when you specify the "-e"
|
||||||
option. Anydb will ask you interactively for a passphrase. You might as
|
option. Anydb will ask you interactively for a passphrase. You can also
|
||||||
well provide the passphrase using the environment variable
|
provide the passphrase using the environment variable "ANYDB_PASSWORD".
|
||||||
"ANYDB_PASSWORD". To encrypt the value, a cryptographically secure key
|
To encrypt the value, a cryptographically secure key will be derived
|
||||||
will be derived from the passphrase using the ArgonID2 algorithm. Each
|
from the passphrase using the ArgonID2 algorithm. Each value can be
|
||||||
value can be encrypted with another passphrase. So, the database itself
|
encrypted with another passphrase. So, the database itself is not
|
||||||
is not encrypted, just the values.
|
encrypted, just the values.
|
||||||
|
|
||||||
You can supply tags by using the option "-t". Multiple tags can be
|
You can supply tags by using the option "-t". Multiple tags can be
|
||||||
provided either by separating them with a comma or by using multiple
|
provided either by separating them with a comma or by using multiple
|
||||||
@@ -172,7 +172,7 @@ SUBCOMMANDS
|
|||||||
decrypt it. If the environment variable "ANYDB_PASSWORD" is set, its
|
decrypt it. If the environment variable "ANYDB_PASSWORD" is set, its
|
||||||
value will be used instead.
|
value will be used instead.
|
||||||
|
|
||||||
There are different output modes you can choos from: simple, wide and
|
There are different output modes you can choose from: simple, wide and
|
||||||
json. The "simple" mode is the default one, it just prints the value as
|
json. The "simple" mode is the default one, it just prints the value as
|
||||||
is. The "wide" mode prints a tabular output similar to the list
|
is. The "wide" mode prints a tabular output similar to the list
|
||||||
subcommand, see there for more details. The options "-n" and "-N" have
|
subcommand, see there for more details. The options "-n" and "-N" have
|
||||||
@@ -187,14 +187,16 @@ SUBCOMMANDS
|
|||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
anydb list [<filter-regex>] [-t <tag>] [-m <mode>] [-n -N] [-T <tpl>] [flags]
|
anydb list [<filter-regex>] [-t <tag>] [-m <mode>] [-n -N] [-T <tpl>] [-i] [flags]
|
||||||
|
|
||||||
Aliases:
|
Aliases:
|
||||||
list, /, ls
|
list, /, ls
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
|
-i, --case-insensitive filter case insensitive
|
||||||
-h, --help help for list
|
-h, --help help for list
|
||||||
-m, --mode string output format (table|wide|json|template), wide is a verbose table. (default 'table')
|
-m, --mode string output format (table|wide|json|template),
|
||||||
|
wide is a verbose table. (default 'table')
|
||||||
-n, --no-headers omit headers in tables
|
-n, --no-headers omit headers in tables
|
||||||
-N, --no-human do not translate to human readable values
|
-N, --no-human do not translate to human readable values
|
||||||
-t, --tags stringArray tags, multiple allowed
|
-t, --tags stringArray tags, multiple allowed
|
||||||
@@ -230,6 +232,8 @@ SUBCOMMANDS
|
|||||||
note, that this regexp dialect is not PCRE compatible, but supports most
|
note, that this regexp dialect is not PCRE compatible, but supports most
|
||||||
of its features.
|
of its features.
|
||||||
|
|
||||||
|
If you want to search case insensitive, add the option "-i".
|
||||||
|
|
||||||
You can - as with the get command - use other output modes. The default
|
You can - as with the get command - use other output modes. The default
|
||||||
mode is "table". The "wide" mode is, as already mentioned, a more
|
mode is "table". The "wide" mode is, as already mentioned, a more
|
||||||
detailed table. Also supported is "json" mode and "template" mode. For
|
detailed table. Also supported is "json" mode and "template" mode. For
|
||||||
@@ -281,7 +285,7 @@ SUBCOMMANDS
|
|||||||
Please note, that this does not work with binary content!
|
Please note, that this does not work with binary content!
|
||||||
|
|
||||||
export
|
export
|
||||||
Since the bbold database file is not portable across platforms (it is
|
Since the bbolt database file is not portable across platforms (it is
|
||||||
bound to the endianess of the CPU it was being created on), you might
|
bound to the endianess of the CPU it was being created on), you might
|
||||||
want to create a backup file of your database. You can do this with the
|
want to create a backup file of your database. You can do this with the
|
||||||
export subcommand.
|
export subcommand.
|
||||||
@@ -402,8 +406,12 @@ TEMPLATES
|
|||||||
|
|
||||||
The following template variables can be used:
|
The following template variables can be used:
|
||||||
|
|
||||||
Key - string =item Value - string =item Bin - []byte =item Created -
|
Key - string
|
||||||
time.Time =item Tags - []string =item Encrypted bool
|
Value - string
|
||||||
|
Bin - []byte
|
||||||
|
Created - time.Time
|
||||||
|
Tags - []string
|
||||||
|
Encrypted bool
|
||||||
|
|
||||||
Prepend a single dot (".") before each variable name.
|
Prepend a single dot (".") before each variable name.
|
||||||
|
|
||||||
@@ -423,21 +431,22 @@ TEMPLATES
|
|||||||
anydb list -m template -T "{{ if .Tags }}{{ .Key }},{{ .Value }},{{ .Created}}{{ end }}"
|
anydb list -m template -T "{{ if .Tags }}{{ .Key }},{{ .Value }},{{ .Created}}{{ end }}"
|
||||||
|
|
||||||
CONFIGURATION
|
CONFIGURATION
|
||||||
Anydb looks at the following location for a configuration file, in that
|
Anydb looks at the following locations for a configuration file, in that
|
||||||
order:
|
order:
|
||||||
|
|
||||||
"$HOME/.config/anydb/anydb.toml"
|
"$HOME/.config/anydb/anydb.toml"
|
||||||
"$HOME/.anydb.toml"
|
"$HOME/.anydb.toml"
|
||||||
"anydb.toml" in the current directory
|
"anydb.toml" in the current directory
|
||||||
or specify one using "-c"
|
or specify one using "-c"
|
||||||
The configuration format uses the TOML language, refer to
|
|
||||||
<https://toml.io/en/> for more details. The key names correspond to
|
|
||||||
the commandline options in most cases.
|
|
||||||
|
|
||||||
Configuration follows a certain precedence: the files are tried to
|
The configuration format uses the TOML language, refer to
|
||||||
be read in the given order, followed by commandline options. That
|
<https://toml.io/en/> for more details. The key names correspond to the
|
||||||
is, the last configuration file wins, unless the user provides a
|
commandline options in most cases.
|
||||||
commandline option, then this setting will be taken.
|
|
||||||
|
Configuration follows a certain precedence: the files are tried to be
|
||||||
|
read in the given order, followed by commandline options. That is, the
|
||||||
|
last configuration file wins, unless the user provides a commandline
|
||||||
|
option, then this setting will be taken.
|
||||||
|
|
||||||
A complete configuration file might look like this:
|
A complete configuration file might look like this:
|
||||||
|
|
||||||
@@ -456,12 +465,12 @@ CONFIGURATION
|
|||||||
[buckets.test]
|
[buckets.test]
|
||||||
encrypt = false
|
encrypt = false
|
||||||
|
|
||||||
Under normal circumstances you don't need a configuration file.
|
Under normal circumstances you don't need a configuration file. However,
|
||||||
However, if you want to use different buckets, then this might be a
|
if you want to use different buckets, then this might be a handy option.
|
||||||
handy option. Buckets are being configured in ini-style with the
|
Buckets are being configured in ini-style with the term "bucket."
|
||||||
term "bucket." followed by the bucket name. In the example above we
|
followed by the bucket name. In the example above we enable encryption
|
||||||
enable encryption for the default bucket "data" and disable it for a
|
for the default bucket "data" and disable it for a bucket "test". To use
|
||||||
bucket "test". To use different buckets, use the "-b" option.
|
different buckets, use the "-b" option.
|
||||||
|
|
||||||
REST API
|
REST API
|
||||||
The subcommand serve starts a simple HTTP service, which responds to
|
The subcommand serve starts a simple HTTP service, which responds to
|
||||||
|
|||||||
Reference in New Issue
Block a user