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

QtPass doesn't work will pass in WSL #375

Closed
vanyasem opened this issue Apr 27, 2018 · 12 comments
Closed

QtPass doesn't work will pass in WSL #375

vanyasem opened this issue Apr 27, 2018 · 12 comments

Comments

@vanyasem
Copy link

vanyasem commented Apr 27, 2018

QtPass refuses to work with pass running in Bash on Windows (tried Ubuntu and Arch GNU/Linux)

I specified C:\Windows\System32\bash.exe --login /usr/bin/pass for a path to pass (which works with passff for example), but QtPass refuses to accept that setting and tries to use native Git/GPG

@annejan
Copy link
Member

annejan commented Apr 27, 2018

I haven't tried bash on Windows yet.
Should give it a go when I'm playing with the new chocolatey builds.

@vanyasem
Copy link
Author

You can PM me on Telegram @vanyasem or on Matrix @vanyasem:matrix.mynameisivan.ru if you need any assistance

@mirenbz
Copy link

mirenbz commented Jun 5, 2018

I can't make it work in Windows either. Using the WSL is the only way I've found to install pass. No luck with passff either so @vanyasem , I would really appreciate if you could point me to some indications on this!

@rdoeffinger
Copy link
Contributor

I don't think this is realistic to fix.
Issues I could see:

  1. you need to specify a binary, a command with multiple options does not work.
    You get something partially working if you create a gpg.bat with this content:
    C:\Windows\System32\bash.exe --login -c "/usr/bin/gpg %*"
  2. That works for some things, but e.g. for decrypting you need to pass a path to gpg. That path is however a Windows path. While a wslpath command to convert them exist, it's not easy to use
  3. A lot of commands, in especially "pass" itself needs environment variables to be set up. I don't think these get passed from Windows to WSL at all currently, and even if they were there is the whole wslpath issue. The closest I got to, which works on the command-line but not when used programmatically is a pass.bat with this:
    C:\Windows\System32\bash.exe --login -c "PASSWORD_STORE_DIR=$(wslpath '%PASSWORD_STORE_DIR%') /usr/bin/pass %*"
  4. I don't think stdin/stdout is properly passed between WSL and ordinary programs, so this probably just can't work. Then again I might be wrong, as using the gpg.bat wrapper DOES work for listing keys?!

@vanyasem
Copy link
Author

@rdoeffinger Pext (issue mentioned above) implemeted support for pass in WSL. It DOES work. So, well, all of your points are invalid.

@rdoeffinger
Copy link
Contributor

I never said it's not possible (except maybe in point 4, but I also said I might be wrong).
It just seems to need a large number of tricky hacks/fixes and even more debug time.
The .bat files implement mostly what Pext did for its fixes.
Though maybe the problem is actually running .bat files, maybe it would indeed work if running these commands directly? But then, how should these be handled in the UI? Such complex command wrappers do not really work well with how the settings only expect a binary path currently.

@rdoeffinger
Copy link
Contributor

I suspect another issue is that for password-protected keys QtPass currently relies on gpg making use of graphical password input plugins, but those won't be available when running pass in WSL.
Correct me if I miss some reason why that's not a problem though.

@vanyasem
Copy link
Author

vanyasem commented Aug 26, 2018

@rdoeffinger You just get pass as it was running on GNU/Linux. It gives you the same output, and it communicates with gpg by itself. The only thing required is to make QtPass support calling it "the Windows way". I have no idea how GPG or UI changes are related at all.

You won't be able to request a password, so the only limitation is that a GPG key should have an empty keystore. Which is a bummer, and probably has a solution, but that's none of my business, I don't run Windows.

@rdoeffinger
Copy link
Contributor

It happens that I wanted this for other reasons.
There were some nasty issues (some not even related to WSL support), and I haven't even tried keys with password.
But see merge request #416

@annejan annejan closed this as completed Oct 17, 2019
@vanyasem
Copy link
Author

Was this implemented or was it just discarded?

@annejan
Copy link
Member

annejan commented Oct 21, 2019

This has been implemented in #431 and is currently being improved on in project: No OS left behind

TODO:

  • autodetection
  • friendlier handling of errors

@vanyasem
Copy link
Author

@annejan that's great! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants