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

Add more locations to check for default store path #108

Closed
wants to merge 1 commit into from
Closed

Add more locations to check for default store path #108

wants to merge 1 commit into from

Conversation

cloudlena
Copy link

Fixes #107

@maximbaz
Copy link
Member

maximbaz commented Aug 3, 2021

Hey @mastertinner, thanks for a quick PR! We had a quick discussion internally and decided to go with another approach, we will keep the list of such lookup paths on extension side and rewrite the native component to make it generic - it is our goal to change native host as little as possible, such that if gopass changes folders lookup, if pass finally decides something on #95 or if yet another tool becomes popular, we will be able to simply add support to these new locations in the extension, without having to change native component.

Sorry that I initially gave you a different suggestion, and thanks again for the PR! I'll have a look into it and ping you once it's ready, so that you can test if you'd like to!

@cloudlena
Copy link
Author

OK, sounds good. So should I close this PR?

@maximbaz
Copy link
Member

maximbaz commented Aug 3, 2021

It's fine to keep it for now, I'll reference it in that other PR and it will be closed then :)

@cloudlena
Copy link
Author

@maximbaz, is there any progress on this matter?

@maximbaz
Copy link
Member

Unfortunately, no, sorry it took so long 😞 If you have time, would you like to try to help out? We haven't discussed exactly how to implement this correctly, but I'll outline my idea below, and ping @erayd to confirm whether I'm not missing something 🙂

We can extend request settings to contain a list of strings, a list of paths to look for default password store location, this list should be used in this function instead of the hardcoded $PASSWORD_STORE_DIR or ~/.password-store/. This list would receive paths, that can contain ~ or environment variables, and we have a handy helper function that can be used to normalize it all.

Then to determine a default password store, we simply iterate that list, returning the first folder that exists.

Then on the extension side, we'd pass this list as following, in this order:

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

And then we'd need to test this, to make sure that new extension can run with old native host, and maybe if old extension can run with new native host.

@cloudlena cloudlena closed this by deleting the head repository Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Check gopass default store location
2 participants