browserpass-native icon indicating copy to clipboard operation
browserpass-native copied to clipboard

Check gopass default store location

Open cloudlena opened this issue 4 years ago • 1 comments

General information

  • Operating system + version: Arch Linux rolling
  • Browser + version: Firefox 90.0.2
  • Information about the host app:
    • How did you install it? Installed via a package manager
    • If installed an official release, put a version ($ browserpass --version): 3.0.7
  • Information about the browser extension:
    • How did you install it? webstore
    • Browserpass extension version as reported by your browser: 3.7.2

What should happen?

I would expect browserpass to also check the default password store location of gopass (~/.local/share/gopass/stores/root) by default.

What happened instead?

browserpass doesn't work out of the box with gopass' default store location. PASSWORD_STORE_DIR has to be set.

cloudlena avatar Aug 02 '21 18:08 cloudlena

Makes sense, especially given that we explicitly say that browserpass works with pass and gopass 🙂

Would you like to take a stab at it?

This is the function to change:

https://github.com/browserpass/browserpass-native/blob/4d8abe1399967e4ca13389e7753422e13dd5418a/request/configure.go#L145

This is the gopass logic:

https://github.com/gopasspw/gopass/blob/d00c29a0e8e521eb32e4564998690430dcc7dbbc/pkg/appdir/appdir_xdg.go#L39-L50

I suppose the check should be done in this priority order (return earliest match):

  1. $PASSWORD_STORE_DIR
  2. $GOPASS_HOMEDIR
  3. $HOME/.password-store
  4. $XDG_DATA_HOME/gopass/stores/root
  5. $HOME/.local/share/gopass/stores/root

If at some point the discussion linked in #95 settles, this priority list would be extended even further.

max-baz avatar Aug 03 '21 09:08 max-baz