From 6abacff2a3172ca7724cdf00bea204249d9b09ab Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Sat, 26 Dec 2020 12:46:42 +1300 Subject: [PATCH] More improvements to documentation. --- Cargo.lock | 2 +- Cargo.toml | 2 +- doc/man/bupstash-get.1.md | 4 ++-- doc/man/bupstash-new-sub-key.1.md | 10 +++++----- doc/man/bupstash-put.1.md | 4 ++-- doc/man/bupstash.1.md | 13 +++++-------- src/main.rs | 2 +- 7 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dc5f3bf..35fbc79c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,7 +67,7 @@ dependencies = [ [[package]] name = "bupstash" -version = "0.6.0" +version = "0.6.2" dependencies = [ "anyhow", "atty", diff --git a/Cargo.toml b/Cargo.toml index 2562c005..ffe95d58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bupstash" -version = "0.6.1" +version = "0.6.2" authors = ["Andrew Chambers "] edition = "2018" license = "MIT" diff --git a/doc/man/bupstash-get.1.md b/doc/man/bupstash-get.1.md index a1d0e381..44485213 100644 --- a/doc/man/bupstash-get.1.md +++ b/doc/man/bupstash-get.1.md @@ -31,7 +31,7 @@ more information on the query cache. remote repositories if ssh access is configured. If not specified, is set to `BUPSTASH_REPOSITORY`. * -k, --key KEY: - Primary key used to decrypt data and metadata. If not set, defaults + Key that will be used to decrypt data and metadata. If not set, defaults to `BUPSTASH_KEY`. * --pick PATH: @@ -60,7 +60,7 @@ more information on the query cache. allows more complex connections to the repository for less common use cases. * BUPSTASH_KEY: - Path to a primary key that will be used for decrypting data and metadata. + Path to the key that will be used for decrypting data and metadata. * BUPSTASH_KEY_COMMAND: A command to run that must print the key data, can be used instead of BUPSTASH_KEY diff --git a/doc/man/bupstash-new-sub-key.1.md b/doc/man/bupstash-new-sub-key.1.md index d62f3990..7a2f1c1a 100644 --- a/doc/man/bupstash-new-sub-key.1.md +++ b/doc/man/bupstash-new-sub-key.1.md @@ -22,15 +22,15 @@ their search tags, without exposing the data decryption key. The generated key will be marked readable only for the creating user. -If a sub-key is lost, the primary key will still be able to decrypt -any data saved with the original primary key, or a put-key derived from that key. +If a sub-key is lost, the original key will still be able to decrypt any data in the repository +encrypted by that sub-key. ## OPTIONS * -k, --key PATH: - Key to derive the new put-key from. + Key to derive the new sub-key from. * -o, --output PATH: - Path to where the put-key will be written. + Path to where the sub-key will be written. * --put: The key is able to encrypt data for 'put' operations. * --list: @@ -43,7 +43,7 @@ any data saved with the original primary key, or a put-key derived from that key ### Create a new put only key ``` -$ bupstash new-put-key -k backups.key -o ./put.key +$ bupstash new-sub-key --put -k backups.key -o ./put.key $ bupstash put -k ./backups-put.key ./data ``` diff --git a/doc/man/bupstash-put.1.md b/doc/man/bupstash-put.1.md index f422999b..9f1712e1 100644 --- a/doc/man/bupstash-put.1.md +++ b/doc/man/bupstash-put.1.md @@ -76,7 +76,7 @@ Default tags can be overidden manually by simply specifying them. remote repositories if ssh access is configured. If not specified, is set to `BUPSTASH_REPOSITORY`. * -k, --key KEY: - Primary key or put-key to encrypt data and metadata with. If not set, defaults + Key used to encrypt data and metadata. If not set, defaults to `BUPSTASH_KEY`. * -e, --exec: @@ -125,7 +125,7 @@ Default tags can be overidden manually by simply specifying them. allows more complex connections to the repository for less common use cases. * BUPSTASH_KEY: - Path to a primary key, or a put-key, that will be used to encrypt + Path to the key that will be used to encrypt the data. Only the associated primary key will be able to decrypt the data once sent. diff --git a/doc/man/bupstash.1.md b/doc/man/bupstash.1.md index 45c3bb25..c4f4ec47 100644 --- a/doc/man/bupstash.1.md +++ b/doc/man/bupstash.1.md @@ -9,8 +9,7 @@ Run one of the following `bupstash` subcommands. `bupstash init ...`
`bupstash new-key ...`
-`bupstash new-put-key ...`
-`bupstash new-metadata-key ...`
+`bupstash new-sub-key ...`
`bupstash put ...`
`bupstash list ...`
`bupstash list-contents ...`
@@ -47,10 +46,8 @@ that each have their own documentation. Initialize a bupstash repository. * bupstash-new-key(1): Create a new primary key for creating/reading repository items. -* bupstash-new-put-key(1): - Derive a put only key from a primary key. -* bupstash-new-metadata-key(1): - Derive a list/rm only key from a primary key. +* bupstash-new-sub-key(1): + Derive a sub key for a subset of operations. * bupstash-put(1): Add data to a bupstash repository. * bupstash-get(1): @@ -148,8 +145,8 @@ $ bupstash gc ``` # Create a key, a put only key, and a metadata (list/rm only) key. $ bupstash new-key -o backups.key -$ bupstash new-put-key -k backups.key -o backups-put.key -$ bupstash new-metadata-key -k backups.key -o backups-metadata.key +$ bupstash new-sub-key --put -k backups.key -o backups-put.key +$ bupstash new-sub-key --list -k backups.key -o backups-metadata.key ... Copy backups.key to secure offline storage ... diff --git a/src/main.rs b/src/main.rs index e057b5cc..b44249f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -509,7 +509,7 @@ fn list_main(args: Vec) -> Result<(), anyhow::Error> { Some(key) => { if !key.is_list_key() { anyhow::bail!( - "only primary keys and sub keys created with '--list' can be used for listing" + "only main keys and sub keys created with '--list' can be used for listing" ) }