passff-host icon indicating copy to clipboard operation
passff-host copied to clipboard

[Windows] Add install script for Cygwin

Open rhlee opened this issue 6 years ago • 6 comments

I use passff with pass on Cygwin piped to Firefox on Windows. I need to set up the host side again to reflect the latest changes. Would you guys be willing to accept a pull request for an install script for pass/Cygwin <=> Firefox/Windows?

rhlee avatar Mar 25 '18 14:03 rhlee

We can't say anything about that before seeing the pull request actually. In principal, a working Windows setup would be good. But I don't have Windows, so won't be able to test your proposal. Therefore I depend on a third opinion before accepting any pull requests in that direction. Same thing as with Mac, where we have been waiting for someone to review the install script updates for almost three months now: https://github.com/passff/passff/pull/268

tuxor1337 avatar Mar 25 '18 15:03 tuxor1337

I just created pr #23 . Microsoft provides free Windows VM images for browser testing. These can be used for testing passff on cygwin. If you need instructions on how to do this, let me know.

rhlee avatar Jun 14 '18 09:06 rhlee

Thanks for the PR :+1:

I'd like to test it with my two windows setups: Windows 7 Home and 10 Pro.

I followed these steps (read: my steps) to install cygwin & pass on my Windows 7 desktop :

  1. Install cygwin with chocolatey: choco install cygwin cyg-get
  2. In cygwin, install the dependencies for passff-host/pass cyg-get.bat python3 curl tree make (You may need to install git and gpg! I personally have git & gpg4win installed with chocolatey)
  3. In cygwin, download pass: curl -L -O https://git.zx2c4.com/password-store/snapshot/password-store-1.7.3.tar.xz
  4. Extract it: tar --xz -xvf password-store*.tar.xz
  5. And install it (no sudo! run cygwin with admin rights! ): make -C password-store-1.7.3 install
  6. Download rhlee's script: curl -L -O https://raw.githubusercontent.com/rhlee/passff-host/cygwin/src/install_host_app_cygwin.sh

Passff-host install

  1. Replace the placeholder with the right version sed -i 's/_VERSIONHOLDER_/1.0.1/' install_host_app_cygwin.sh

  2. Run it in cygwin: bash -x install_host_app_cygwin.sh firefox

  3. I install passff on Firefox... And I get Error: "password store in empty"...as expected ;)

  4. Let's find the cygwin path of my password store: cygpath.exe -u 'E:\Sync\mypass.git'

  5. Let's innovate and put SET PASSWORD_STORE_DIR=/cygdrive/e/sync/mypass.git in passff_cygwin.bat line 2 instead of passff.py (see Preferences https://github.com/passff/passff-host#preferences )

It works!

:100: :100: :100: :tada: :tada: :tada:


As a side note, I also have a MINGW64 shell thanks to git, and I think I could manage to use MINGW instead of cygwin :thinking:

EDIT 2020/04/03 : Install make with cygwin, Bump pass version to 1.7.3, Fix the make command.

5bentz avatar Jun 15 '18 14:06 5bentz

Thanks @5bentz ! Your instructions took me almost there 🎉 🎉 🎉

I have passff now working in Win10 but it's looking at the wrong password store (an empty one). I've run pass init when passff told me so, and that created the default ~/.password-store which is what I assume passff is using.

However my password store is in a different location. I've got it to work under cygwin adding the env to my .bashrc (running pass in cygwin now displays the correct list of passwords), but I can't find the way to tell passff to use the correct path.

I have added SET PASSWORD_STORE_DIR="/cygdrive/z/actual-path/of-my-password-store/" to passff-cygwin.bat instead of your step 10, but it doesn't seem to be working: the extension in Firefox shows an empty password list.

I'm sure it's something silly that I'm missing, but I can't work it out!

mirenbz avatar Jun 18 '18 08:06 mirenbz

Ohhhh sorry I see now. You appended the line in the file AFTER the call to passff.py. Move your line before the call, put it on line2 before SET PATH=.....

Your file should look like that: the environment variables must be set before passff.py is executed!

@ECHO OFF
SET VAR1=blabla
SET VAR2=foobar
C:\path\to\python3.6m.exe "path/to/passff.py" %%*

Another way is to set this env variable in passff.py: add this line in COMMAND_ENV dict: "PASSWORD_STORE_DIR": "/cygdrive/path/to/store",

5bentz avatar Jun 18 '18 11:06 5bentz

@5bentz that made it!! Just moved the line up and it's perfectly working now in Windows 10 + cygwin. Thanks! 👏

mirenbz avatar Jun 18 '18 12:06 mirenbz