browserpass / browserpass-native

Browserpass native client app
ISC License
394 stars 50 forks source link

Unable to detect the location of the gpg binary to use #123

Closed zorgick closed 2 years ago

zorgick commented 2 years ago

General information


If you are getting an error immediately after opening popup, have you followed the Configure browsers documentation section? yes. The popup appears as expected and suggests possible pass options.


Exact steps to reproduce the problem

  1. Open extension popup

  2. Click on any pass option

  3. Error appears:

    Error: {
    "status":"error",
    "code":22,
    "version":3000010,
    "params": {
     "action":"fetch",
     "error":"Unable to detect the location of the gpg binary to use",
     "message":"Unable to detect the location of the gpg binary"
    }
    }

What should happen?

The browserpass-native should search for gpg binary correctly on MacOS.

It seems that this function doesn't have a full list of binary location.

If gpg was installed via MacPorts, the default location is /opt/local/bin

What happened instead?

GPG binary path was not found.

maximbaz commented 2 years ago

Hi there, to be honest /opt/local/bin is quite not standard location on Unix systems to be added to the default list, I'm not saying it's wrong or necessarily shouldn't be included, but at the same time I would like to limit hardcoding dependencies on very specific choices of very specific package managers of certain operating systems into a cross-platform binary...

There are several ways you can fix the issue today:

  1. The first location in the full list is actually just gpg, in other words it would look in $PATH - you can add your /opt/local/bin location to PATH for GUI apps (look into sudo launchctl config user path '.....') and it will be discovered by default.
  2. You can also configure location of gpg binary in extension options (but be aware of https://github.com/browserpass/browserpass-extension/issues/293)
  3. You can finally configure location of gpg binary in .browserpass.json config file in your password store - see this section of docs for details.
zorgick commented 2 years ago

Yeah, /opt/local/bin seems offputting to me also. I just switched to Mac from linux (my employer gave it) and it is a nightmare to configure all my utils for MacOS.

Thanks for the hint with this command sudo launchctl config user path. I never needed it on Linux, but I knew there is some way to configure $PATH for GUI apps on Mac.