Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using sane default for partial config #1968

Merged
merged 1 commit into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -21,7 +21,7 @@ cliptimeout: 45
exportkeys: false
nocolor: false
nopager: false
notifications: false
notifications: true
parsing: true
`
wanted += "path: " + ts.storeDir("root") + "\n"
Expand Down Expand Up @@ -75,7 +75,7 @@ cliptimeout: 45
exportkeys: false
nocolor: 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