Skip to content

Commit

Permalink
docs: Document new way of storing to keyring
Browse files Browse the repository at this point in the history
Part of #153
  • Loading branch information
VorpalBlade committed Sep 1, 2024
1 parent efdcc18 commit ceb5496
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions docs/src/examples/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ transform "Identity 0" "Password" keyring service="konversation" user="konversat
add:hide "Identity 0" "Password"
```

To store the password for Identity 0 in your keyring of choice you can use the
`secret-tool` program from `libsecret` (`libsecret-tools` on Debian/Ubuntu):
To store the password for Identity 0 in your keyring of choice you can use:

```console
$ secret-tool store --label="Konversation password" service konversation username konversation_id0
$ chezmoi_modify_manager --keyring-set konversation konversation_id0
[Enter your password at the prompt]
```

Expand Down Expand Up @@ -145,18 +144,18 @@ in git. This works similarly to [konversation](#konversationrc).
For example, you might use the following if you have a Prusa Mk3.9:

```bash
transform "<NO_SECTION>" "printhost_password" keyring service="ini_processor" user="prusa_mk39_password" separator=" = "
transform "<NO_SECTION>" "printhost_apikey" keyring service="ini_processor" user="prusa_mk39_apikey" separator=" = "
transform "<NO_SECTION>" "printhost_password" keyring service="chezmoi_modify_manager" user="prusa_mk39_password" separator=" = "
transform "<NO_SECTION>" "printhost_apikey" keyring service="chezmoi_modify_manager" user="prusa_mk39_apikey" separator=" = "
add:hide "<NO_SECTION>" "printhost_password"
add:hide "<NO_SECTION>" "printhost_apikey"
```

To add your password and API key you would then use:

```console
$ secret-tool store --label="Prusa Mk3.9 password" service ini_processor username prusa_mk39_password
chezmoi_modify_manager --keyring-set chezmoi_modify_manager prusa_mk39_password
Password: [Enter password]
$ secret-tool store --label="Prusa Mk3.9 API key" service ini_processor username prusa_mk39_apikey
chezmoi_modify_manager --keyring-set chezmoi_modify_manager prusa_mk39_apikey
Password: [Enter the API key]
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Arguments:
* `service="service-name"`: Service name to find entry in the keyring.
* `user="user-name"`: Username to find entry in the keyring.

On Linux you can add an entry to the keyring using:
You can add an entry to the secret store for your platform with:

```bash
secret-tool store --label="Descriptive name" service "service-name" username "user-name"
chezmoi_modify_manager --keyring-set service-name user-name
```
2 changes: 1 addition & 1 deletion src/transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) enum Transform {
/// * user="user-name" (username to find entry in the keyring)
///
/// On Linux you can add an entry to the keyring using:
/// secret-tool store --label="Descriptive name" service "service-name" username "user-name"
/// chezmoi_modify_manager --keyring-set "service-name" "user-name"
#[strum(serialize = "keyring")]
Keyring,
}
Expand Down

0 comments on commit ceb5496

Please sign in to comment.