Skip to content

Instantly share code, notes, and snippets.

@jasonm23
Last active October 19, 2024 06:06
Show Gist options
  • Save jasonm23/c2c3d96512ddac336ffa878a0d38d712 to your computer and use it in GitHub Desktop.
Save jasonm23/c2c3d96512ddac336ffa878a0d38d712 to your computer and use it in GitHub Desktop.
Running passff on Windows and Firefox

Hi all, Please consider donating to this or any of my many of opensource projects.

Buy Me a Coffee at ko-fi.com

How To run PassFF for Firefox on Windows

Getting it running on Windows is fairly simple, but the browser extension PassFF with its host script, PassFF host didn't work for me after running the installer install_host_app.bat file.

I found gopass which is a Go implementation of the original pass script, and seems to be 100% compatible.

Side note: Gopass does provide gopassbridge which is a browser extension very similar to passff, but FWIW it was not a drop in solution for me, even though gopass is in my PATH.

So, I put together this guide to show how I got up and running with PassFF using gopass.

Steps to make it work...

  • Install Chocolatey

Follow the instructions here https://chocolatey.org/install

  • Install the latest golang (using Chocolatey)

    In the terminal:

    choco install golang
  • Install gopass:

    In the terminal:

    go install github.com/gopasspw/gopass@latest

    Check it's working run gopass in the terminal:

       __     _    _ _      _ _   ___   ___
     /'_ '\ /'_'\ ( '_'\  /'_' )/',__)/',__)
    ( (_) |( (_) )| (_) )( (_| |\__, \\__, \
    '\__  |'\___/'| ,__/''\__,_)(____/(____/
    ( )_) |       | |
     \___/'       (_)
    
    🌟 Welcome to gopass!
    ⚠ This is the built-in shell. Type 'help' for a list of commands.
    gopass> 

    If you haven't installed pass already, run gopass init to setup your password repo.

  • Get install_host_app.bat and run it.

    Your %APPDATA\passff\ folder will have:

    passff.bat
    passff.json
    passff.py
  • The passff.bat file is a bit odd, and overwrites the PATH and tries to run passff.py using a full path, so I don't know what the thinking was but, I replaced it with this:

    @echo off
    python passff.py %*
  • To use gopass instead of pass, replace the command in the passfy.py:

    passff.py:L17-L20

    ###############################################################################
    ######################## Begin preferences section ############################
    ###############################################################################
    COMMAND = "pass"

    To:

    ###############################################################################
    ######################## Begin preferences section ############################
    ###############################################################################
    COMMAND = "gopass"

passff.json - host manifest

The good part of the story, where I screwed up!

On one machine I installed passff, the above steps didn't work. Turns out I'd broken the passff.json.

It locates the passff.bat for the passff extension, and it should look like this: (with YOURNAME corrected to your Windows username.)

{
  "name": "passff",
  "description": "Host for communicating with zx2c4 pass",
  "path": "C:\\Users\\YOURNAME\\AppData\\Roaming\\passff\\passff.bat",
  "type": "stdio",
  "allowed_extensions": [ "[email protected]" ]
}

My passff.json looked like this this:

{
  "name": "passff",
  "description": "Host for communicating with zx2c4 pass",
  "path": "PLACEHOLDER",
  "type": "stdio",
  "allowed_extensions": [ "[email protected]" ]
}

I think install_passff_host.bat should set this correctly, I must have copied over it.


After restarting Firefox, PassFF now pops up the password search box, like this:

Screenshot 2024-10-18 162705

Let me know if you have any trouble, I'll be happy to help getting it working for you too.

@jasonm23
Copy link
Author

jasonm23 commented Oct 19, 2024

Windows SSH is the next problem if you have multiple keys:

Terminal as administrator:

Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service
start-ssh-agent.cmd
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

Just Works

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