browserpass / browserpass-legacy

Legacy Browserpass repo, development is now happening at:
https://github.com/browserpass/browserpass-extension
MIT License
999 stars 80 forks source link

Allow configuring multiple custom password stores #237

Closed maximbaz closed 6 years ago

maximbaz commented 6 years ago

I had a few hours free, so I decided to play with implementing this feature.

I suggest reviewing the diff without whitespace changes.

The idea is to allow configuring multiple password stores in options, and even toggle them when needed:


image

image


image

image


A folder can be a path to a custom password store (#98), a path to a subdirectory of a password store (#34) or a path to gopass mount (#77).

Known limitations

Nothing left here 🙂

Fixed 1. It has to be an absolute path, no expansion of `~` or environment variables.
Fixed by @erayd in #239 1. I didn't have time (and desire) to dynamically add/remove more lines for directories, so I pre-created 5 empty input lines. Because 5 should be enough for everyone 😄 I'm joking, but if you want to implement something fancier, please submit a new PR. 1. Current solution doesn't support having files with identical names. In other words, if you enable two password stores in the options: ``` /home/user/.password-store-1/ /home/user/.password-store-2/ ``` And you have identically named files in both password stores, like this: ``` /home/user/.password-store-1/github.com.gpg /home/user/.password-store-2/github.com.gpg ``` Only the first `github.com.gpg` will be seen by browserpass. Use checkbox in the extension options to temporarily disable password store that you don't need. However if the files are in different subfolders (like below), then it's fine: ``` /home/user/.password-store-1/personal/github.com.gpg /home/user/.password-store-2/work/github.com.gpg ```

Fixes #98 Fixes #34 Fixes #77

erayd commented 6 years ago

Current solution doesn't support having files with identical names.

What's the limitation causing this? Would adding a temporary prefix be a suitable workaround?

maximbaz commented 6 years ago

Description updated, all limitations fixed.

maximbaz commented 6 years ago

Looks like this picked up a lot that prettier did not notice when I ran it via docker. Is the makefile config for running prettier via docker correct?

Mmm, the makefile is the same and I just ran make that should be run by docker. I haven't been using this docker image for a while though... When you use the docker image, does it fix any kind of style issues at all? No errors printed? Maybe try to rebuild the docker container?

This is the output when I run make by the way, I think when you use docker image it should print exactly the same output.

image

erayd commented 6 years ago

That looks quite different - I just get this: scr-20180327-223340