diff options
author | Alex <alex@adnab.me> | 2023-01-04 10:35:49 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2023-01-04 10:35:49 +0000 |
commit | 80e4abb98dfbf2e88414a8b28e8c9134fa0a65e7 (patch) | |
tree | 5e3ca67d106e5a5aa5c1749045c78060105fc8a2 | |
parent | 570e5e5bbb7a3eac41350db9433e28ed289b97f4 (diff) | |
parent | 8be862aa193ebe3081d1a74c3c5fc493ae9c82b0 (diff) | |
download | garage-80e4abb98dfbf2e88414a8b28e8c9134fa0a65e7.tar.gz garage-80e4abb98dfbf2e88414a8b28e8c9134fa0a65e7.zip |
Merge pull request 'Changed all instances of 'key new' to 'key create' to make it the same as the bucket commands.' (#459) from jpds/garage:key-create-standardize into next
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/459
-rw-r--r-- | doc/book/connect/apps/index.md | 8 | ||||
-rw-r--r-- | doc/book/connect/backup.md | 2 | ||||
-rw-r--r-- | doc/book/connect/repositories.md | 4 | ||||
-rw-r--r-- | doc/book/quick-start/_index.md | 2 | ||||
-rwxr-xr-x | script/dev-bucket.sh | 2 | ||||
-rw-r--r-- | src/garage/admin.rs | 2 | ||||
-rw-r--r-- | src/garage/cli/structs.rs | 6 | ||||
-rw-r--r-- | src/garage/tests/common/garage.rs | 3 |
8 files changed, 14 insertions, 15 deletions
diff --git a/doc/book/connect/apps/index.md b/doc/book/connect/apps/index.md index 737351a0..78d9310d 100644 --- a/doc/book/connect/apps/index.md +++ b/doc/book/connect/apps/index.md @@ -36,7 +36,7 @@ Second, we suppose you have created a key and a bucket. As a reminder, you can create a key for your nextcloud instance as follow: ```bash -garage key new --name nextcloud-key +garage key create nextcloud-key ``` Keep the Key ID and the Secret key in a pad, they will be needed later. @@ -138,7 +138,7 @@ a reasonable trade-off for some instances. Create a key for Peertube: ```bash -garage key new --name peertube-key +garage key create peertube-key ``` Keep the Key ID and the Secret key in a pad, they will be needed later. @@ -252,7 +252,7 @@ As such, your Garage cluster should be configured appropriately for good perform This is the usual Garage setup: ```bash -garage key new --name mastodon-key +garage key create mastodon-key garage bucket create mastodon-data garage bucket allow mastodon-data --read --write --key mastodon-key ``` @@ -378,7 +378,7 @@ Supposing you have a working synapse installation, you can add the module with p Now create a bucket and a key for your matrix instance (note your Key ID and Secret Key somewhere, they will be needed later): ```bash -garage key new --name matrix-key +garage key create matrix-key garage bucket create matrix garage bucket allow matrix --read --write --key matrix-key ``` diff --git a/doc/book/connect/backup.md b/doc/book/connect/backup.md index 48a2d7be..919e78c3 100644 --- a/doc/book/connect/backup.md +++ b/doc/book/connect/backup.md @@ -20,7 +20,7 @@ If you still want to use Borg, you can use it with `rclone mount`. Create your key and bucket: ```bash -garage key new my-key +garage key create my-key garage bucket create backup garage bucket allow backup --read --write --key my-key ``` diff --git a/doc/book/connect/repositories.md b/doc/book/connect/repositories.md index 4b14bb46..66365d64 100644 --- a/doc/book/connect/repositories.md +++ b/doc/book/connect/repositories.md @@ -23,7 +23,7 @@ You can configure a different target for each data type (check `[lfs]` and `[att Let's start by creating a key and a bucket (your key id and secret will be needed later, keep them somewhere): ```bash -garage key new --name gitea-key +garage key create gitea-key garage bucket create gitea garage bucket allow gitea --read --write --key gitea-key ``` @@ -118,7 +118,7 @@ through another support, like a git repository. As a first step, we will need to create a bucket on Garage and enabling website access on it: ```bash -garage key new --name nix-key +garage key create nix-key garage bucket create nix.example.com garage bucket allow nix.example.com --read --write --key nix-key garage bucket website nix.example.com --allow diff --git a/doc/book/quick-start/_index.md b/doc/book/quick-start/_index.md index ac55d2f7..ab83b75a 100644 --- a/doc/book/quick-start/_index.md +++ b/doc/book/quick-start/_index.md @@ -206,7 +206,7 @@ one key can access multiple buckets, multiple keys can access one bucket. Create an API key using the following command: ``` -garage key new --name nextcloud-app-key +garage key create nextcloud-app-key ``` The output should look as follows: diff --git a/script/dev-bucket.sh b/script/dev-bucket.sh index 9bcf5bda..33d739fa 100755 --- a/script/dev-bucket.sh +++ b/script/dev-bucket.sh @@ -10,7 +10,7 @@ NIX_RELEASE="${REPO_FOLDER}/result/bin/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:${NIX_RELEASE}:$PATH" garage -c /tmp/config.1.toml bucket create eprouvette -KEY_INFO=$(garage -c /tmp/config.1.toml key new --name opérateur) +KEY_INFO=$(garage -c /tmp/config.1.toml key create opérateur) ACCESS_KEY=`echo $KEY_INFO|grep -Po 'GK[a-f0-9]+'` SECRET_KEY=`echo $KEY_INFO|grep -Po 'Secret key: [a-f0-9]+'|grep -Po '[a-f0-9]+$'` garage -c /tmp/config.1.toml bucket allow eprouvette --read --write --owner --key $ACCESS_KEY diff --git a/src/garage/admin.rs b/src/garage/admin.rs index c669b5e6..58d645ac 100644 --- a/src/garage/admin.rs +++ b/src/garage/admin.rs @@ -577,7 +577,7 @@ impl AdminRpcHandler { match cmd { KeyOperation::List => self.handle_list_keys().await, KeyOperation::Info(query) => self.handle_key_info(query).await, - KeyOperation::New(query) => self.handle_create_key(query).await, + KeyOperation::Create(query) => self.handle_create_key(query).await, KeyOperation::Rename(query) => self.handle_rename_key(query).await, KeyOperation::Delete(query) => self.handle_delete_key(query).await, KeyOperation::Allow(query) => self.handle_allow_key(query).await, diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index 825c1813..531501bf 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -331,8 +331,8 @@ pub enum KeyOperation { Info(KeyOpt), /// Create new key - #[structopt(name = "new", version = garage_version())] - New(KeyNewOpt), + #[structopt(name = "create", version = garage_version())] + Create(KeyNewOpt), /// Rename key #[structopt(name = "rename", version = garage_version())] @@ -364,7 +364,7 @@ pub struct KeyOpt { #[derive(Serialize, Deserialize, StructOpt, Debug)] pub struct KeyNewOpt { /// Name of the key - #[structopt(long = "name", default_value = "Unnamed key")] + #[structopt(default_value = "Unnamed key")] pub name: String, } diff --git a/src/garage/tests/common/garage.rs b/src/garage/tests/common/garage.rs index a539abb7..dbebe5b1 100644 --- a/src/garage/tests/common/garage.rs +++ b/src/garage/tests/common/garage.rs @@ -172,8 +172,7 @@ api_bind_addr = "127.0.0.1:{admin_port}" let output = self .command() - .args(["key", "new"]) - .args(["--name", name]) + .args(["key", "create", name]) .expect_success_output("Could not create key"); let stdout = String::from_utf8(output.stdout).unwrap(); |