Skip to content

Commit

Permalink
[n/a] applying code review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yolan Romailler <[email protected]>
  • Loading branch information
AnomalRoil committed Oct 14, 2024
1 parent 7edd80f commit 3e7321c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/backends/age.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ This will automatically create a new age keypair and initialize the new store.

Existing stores can be migrated using `gopass convert --crypto age`.

N.B. for a fully scripted or **non-interactive setup**, you can use the `GOPASS_AGE_PWID` env variable
N.B. for a fully scripted or **non-interactive setup**, you can use the `GOPASS_AGE_PASSWORD` env variable
to set your identity file secret passphrase, and specify the age identity and recipients
that should be used for encrypting/decrypting passwords as follows:
```
$ gopass age identity add <AGE-...> <age1...>
$ GOPASS_AGE_PWID=mypassword gopass init --crypto age <age1...>
$ GOPASS_AGE_PASSWORD=mypassword gopass init --crypto age <age1...>
```
Notice the extra space in front of the command to skip most shell's history.
You'll need to have setup your name and username in git using git directly if you're using the git filesystem backend (the default one).
You'll need to set your name and username using `git` directly if you're using it as storage backend (the default one).

## Features

Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Some configuration options are only available through setting environment variab
| **Option** | **Type** | **Description** |
|------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `CHECKPOINT_DISABLE` | `bool` | Set to any non-empty value to disable calling the GitHub API when running `gopass version`. |
| `GOPASS_AGE_PWID` | `string` | Set to any value (including the empty string) to use as a password for the age identity file containing your secret age identities. |
| `GOPASS_AGE_PASSWORD` | `string` | Set to any value (including the empty string) to use as a password for the age identity file containing your secret age identities. |
| `GOPASS_AUTOSYNC_INTERVAL` | `int` | Set this to the number of days between autosync runs. |
| `GOPASS_CHARACTER_SET` | `bool` | Set to any non-empty value to restrict the characters used in generated passwords |
| `GOPASS_CLIPBOARD_CLEAR_CMD` | `string` | Use an external command to remove a password from the clipboard. See [GPaste](usecases/gpaste.md) for an example |
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ func initContext(ctx context.Context, cfg *config.Config) context.Context {
}

// using a password callback for age identity file or not?
if pw, isSet := os.LookupEnv("GOPASS_AGE_PWID"); isSet {
if pw, isSet := os.LookupEnv("GOPASS_AGE_PASSWORD"); isSet {
ctx = ctxutil.WithPasswordCallback(ctx, func(_ string, _ bool) ([]byte, error) {
debug.Log("using age password callback from env variable GOPASS_AGE_PWID")
debug.Log("using age password callback from env variable GOPASS_AGE_PASSWORD")

return []byte(pw), nil
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctxutil/ctxutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func GetImportFunc(ctx context.Context) store.ImportCallback {
// PasswordCallback is a password prompt callback used in our age crypto backend.
// The arguments are typically the filename and whether or not to ask for a confirmation
// of the provided password, we use it notably together with askPass.
// It is linked to the GOPASS_AGE_PWID env variable.
// It is linked to the GOPASS_AGE_PASSWORD env variable.
type PasswordCallback func(string, bool) ([]byte, error)

// WithPasswordCallback returns a context with the password callback set.
Expand Down

0 comments on commit 3e7321c

Please sign in to comment.