Skip to content

Commit

Permalink
Using sane default for partial config (#1968)
Browse files Browse the repository at this point in the history
RELEASE_NOTES=[BUGFIX] Use same default for partial config files

This is also upgrading the documentation regarding setup as we didn't reflect the move to the .local dir in there yet.

Fixes #1654

Fixes #1967

Signed-off-by: Yolan Romailler <yolan@romailler.ch>
  • Loading branch information
AnomalRoil authored Aug 8, 2021
1 parent 0ebfc78 commit a4e2a77
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
10 changes: 7 additions & 3 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ gopass init
```

This will prompt you for which GPG key you want to associate the store with.
Then it will create a `.password-store` directory in your home directory.
Then it will create a `.local/share/gopass/stores/root` directory in your home directory.

If you don't want gopass to use this default directory, you can instead initialize a password store with:

Expand All @@ -85,16 +85,20 @@ If you already have an existing password store that exists in a Git repository,
gopass clone git@example.com/pass.git
```

This runs `git clone` in the background. If you don't want gopass to use the default directory of "$HOME/.password-store", then you can specify an additional parameter:
This runs `git clone` in the background. If you don't want gopass to use the default root mount of "$HOME/.local/share/gopass/stores/root", then you can specify an additional mount parameter:

```bash
gopass clone git@example.com/pass-work.git work # This will initialize the password store in the "$HOME/.password-store-work" directory
gopass clone git@example.com/pass-work.git work # This will initialize the password store in the "$HOME/.local/share/gopass/stores/work" directory
```

Please note that all cloned repositories must already have been initialized with gopass. (See the previous section for more details.)

Note too that unless you are already a recipient of the cloned repository, you must add the destination's public GPG key as a recipient to the existing store.

Finally notice that if you really want your password-store directory at a specific location, you should `git clone` it manually at that location, and either set Gopass' `PASSWORD_STORE_DIR` env var to that location, or set Gopass' config `path` option to that location.

An existing `$HOME/.password-store` directory should also be automatically picked-up by Gopass upon first run.

### Adding Secrets

Let's say you want to create an account.
Expand Down
8 changes: 6 additions & 2 deletions internal/config/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ type configer interface {

func decode(buf []byte, relaxed bool) (*Config, error) {
mostRecent := &Config{
ExportKeys: true,
Parsing: true,
AutoImport: true,
ClipTimeout: 45,
ExportKeys: true,
Notifications: true,
Parsing: true,
Path: PwStoreDir(""),
}
cfgs := []configer{
// most recent config must come first
Expand Down
4 changes: 2 additions & 2 deletions tests/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ autoimport: true
cliptimeout: 45
exportkeys: false
nopager: false
notifications: false
notifications: true
parsing: true
`
wanted += "path: " + ts.storeDir("root") + "\n"
Expand Down Expand Up @@ -73,7 +73,7 @@ autoimport: true
cliptimeout: 45
exportkeys: false
nopager: false
notifications: false
notifications: true
parsing: true
path: `
wanted += ts.storeDir("root") + "\n"
Expand Down
5 changes: 1 addition & 4 deletions tests/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ import (
)

const (
gopassConfig = `autoclip: false
autoimport: true
cliptimeout: 45
gopassConfig = `
exportkeys: false
parsing: true
`
keyID = "BE73F104"
)
Expand Down

0 comments on commit a4e2a77

Please sign in to comment.