Debian Codegraph @

browserpass-native/README.md

raw
1 <p align="center"><img src="https://github.com/browserpass/browserpass-extension/raw/master/images/logotype-horizontal.png"></p>
2
3 # Browserpass - native messaging host
4
5 This is a host application for [browserpass](https://github.com/browserpass/browserpass-extension) browser extension providing it access to your password store. The communication is handled through [Native Messaging API](https://developer.chrome.com/extensions/nativeMessaging).
6
7 ## Table of Contents
8
9 - [Installation](#installation)
10 - [Install via package manager](#install-via-package-manager)
11 - [Install manually](#install-manually)
12 - [Install on Nix / NixOS](#install-on-nix--nixos)
13 - [Install on Windows](#install-on-windows)
14 - [Install on Windows through WSL](#install-on-windows-through-wsl)
15 - [Configure browsers](#configure-browsers)
16 - [Building the app](#building-the-app)
17 - [Build locally](#build-locally)
18 - [Build using Docker](#build-using-docker)
19 - [Updates](#updates)
20 - [FAQ](#faq)
21 - [Error: Unable to fetch and parse login fields](#error-unable-to-fetch-and-parse-login-fields)
22 - [Uninstallation](#uninstallation)
23 - [Contributing](#contributing)
24
25 ## Installation
26
27 ### Install via package manager
28
29 The following operating systems provide a browserpass package that can be installed using a package manager:
30
31 - Arch Linux: [browserpass](https://www.archlinux.org/packages/community/x86_64/browserpass/)
32 - Gentoo Linux: [browserpass](https://packages.gentoo.org/packages/www-plugins/browserpass)
33 - Debian sid: [browserpass](https://packages.debian.org/source/sid/browserpass)
34 - openSUSE Tumbleweed: [browserpass-native](https://software.opensuse.org/package/browserpass-native)
35 - NixOS: [browserpass](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/security/browserpass/default.nix) - also read [Install on Nix / NixOS](#install-on-nix--nixos)
36 - macOS: [browserpass](https://github.com/Amar1729/homebrew-formulae/blob/master/browserpass.rb) in a user-contributed tap [amar1729/formulae](https://github.com/amar1729/homebrew-formulae)
37
38 Once the package is installed, **refer to the section [Configure browsers](#configure-browsers)**.
39
40 If your OS is not listed above, proceed with the manual installation steps below.
41
42 ### Install manually
43
44 Download [the latest Github release](https://github.com/browserpass/browserpass-native/releases), choose either the source code archive (if you want to compile the app yourself) or an archive for your operating system (it contains a pre-built binary).
45
46 All release files are signed with a PGP key that is available on [maximbaz.com](https://maximbaz.com/), [keybase.io](https://keybase.io/maximbaz) and various OpenPGP key servers. First, import the public key using any of these commands:
47
48 ```
49 $ curl https://maximbaz.com/pgp_keys.asc | gpg --import
50 $ curl https://keybase.io/maximbaz/pgp_keys.asc | gpg --import
51 $ gpg --recv-keys EB4F9E5A60D32232BB52150C12C87A28FEAC6B20
52 ```
53
54 To verify the signature of a given file, use `$ gpg --verify <file>.asc`.
55
56 It should report:
57
58 ```
59 gpg: Signature made ...
60 gpg: using RSA key 8053EB88879A68CB4873D32B011FDC52DA839335
61 gpg: Good signature from "Maxim Baz <...>"
62 gpg: aka ...
63 Primary key fingerprint: EB4F 9E5A 60D3 2232 BB52 150C 12C8 7A28 FEAC 6B20
64 Subkey fingerprint: 8053 EB88 879A 68CB 4873 D32B 011F DC52 DA83 9335
65 ```
66
67 Unpack the archive. If you decided to compile the application yourself, refer to the [Building the app](#building-the-app) section on how to do so. Once complete, continue with the steps below.
68
69 If you are on macOS, first install the necessary tools: `brew install coreutils gnu-sed`.
70
71 If you are on FreeBSD, first install the GNU tools: `pkg install coreutils gmake gsed'.` Use `gmake` in place of `make` below.
72
73 If you downloaded a release archive with pre-compiled binary, follow these steps to install the app:
74
75 ```
76 # IMPORTANT: replace XXXX with OS name depending on the archive you downloaded, e.g. "linux64"
77 make BIN=browserpass-XXXX configure # Configure the hosts json files
78 sudo make BIN=browserpass-XXXX install # Install the app
79 ```
80
81 In addition, both `configure` and `install` targets respect `PREFIX`, `DESTDIR` parameters if you want to customize the install location (e.g. to install to a `$HOME` dir to avoid using `sudo`).
82
83 For example, if you are on macOS or FreeBSD, you probably want to install Browserpass in `/usr/local/bin`, therefore you need to run:
84
85 ```
86 make BIN=browserpass-darwin64 PREFIX=/usr/local configure # Configure the hosts json files
87 sudo make BIN=browserpass-darwin64 PREFIX=/usr/local install # Install the app
88 ```
89
90 If you compiled the app yourself, you can omit `BIN` parameter:
91
92 ```
93 make configure # Configure the hosts json files
94 sudo make install # Install the app
95 ```
96
97 Finally proceed to the [Configure browsers](#configure-browsers) section.
98
99 #### Install on Nix / NixOS
100
101 For a declarative NixOS installation, update your channel with `sudo nix-channel --update`, use the following to your `/etc/nixos/configuration.nix` and rebuild your system:
102
103 ```nix
104 { pkgs, ... }: {
105 programs.browserpass.enable = true;
106 environment.systemPackages = with pkgs; [
107 # All of these browsers will work
108 chromium firefox google-chrome vivaldi
109 # firefox*-bin versions do *not* work with this. If you require such Firefox versions, use the stateful setup described below.
110 ];
111 }
112 ```
113
114 For a stateful Nix setup, update your channel, install Browserpass and link the necessary files with the Makefile (see [Configure browsers](#configure-browsers) section), but pass `DESTDIR=~/.nix-profile`:
115
116 ```bash
117 $ nix-channel --update
118 $ nix-env -iA nixpkgs.browserpass # Or nix-env -iA nixos.browserpass on NixOS
119 $ DESTDIR=~/.nix-profile make -f ~/.nix-profile/lib/browserpass/Makefile <desired make goal>
120 ```
121
122 #### Install on Windows
123 Download [the latest Github release](https://github.com/browserpass/browserpass-native/releases/latest) for `windows64`.
124
125 Run the installer, it will install all the necessary files in `C:\Program Files\Browserpass` and it will also [configure browsers](#configure-browsers).
126
127 #### Install on Windows through WSL
128
129 If you want to use WSL instead
130 1) Follow the [installation](#installation) steps for the WSL distribution you are using. There is no need to configure the browser as your browser does not run in WSL.
131 2) Follow the then [installation](#install-on-windows) steps for installing on Windows.
132 3) Create `C:\Program Files\Browserpass\browserpass-wsl.bat` with the following contents:
133 ```
134 @echo off
135 bash -c "/usr/bin/browserpass-linux64 2>/dev/null"
136 ```
137 4) Edit the hosts json files (in our example `C:\Program Files\Browserpass\browser-files\*-host.json`) and replace `browserpass-windows64.exe` with `browserpass-wsl.bat` you've just created.
138
139 Remember to check [Hints for configuring gpg](#hints-for-configuring-gpg) on how to configure pinentry to unlock your PGP key.
140
141 ### Configure browsers
142
143 The following operating systems provide packages for certain browsers that can be installed using a package manager:
144
145 - Arch Linux: [browserpass-chromium](https://www.archlinux.org/packages/community/any/browserpass-chromium/) and [browserpass-firefox](https://www.archlinux.org/packages/community/any/browserpass-firefox/)
146 - AUR: [browserpass-chrome](https://aur.archlinux.org/packages/browserpass-chrome/)
147
148 If you installed a distro package above, you are done!
149
150 If something went wrong, if there's no package for your OS and/or a browser of your choice, or for whatever reason you just don't want to use them, proceed with the steps below.
151
152 First, enter the directory with installed Browserpass, by default it is `/usr/lib/browserpass/`, but if you used `PREFIX` or `DESTDIR` when running `make install`, it might be different for you. For example, on macOS the directory is likely to be `/usr/local/lib/browserpass/`.
153
154 See below the list of available `make` goals to configure various browsers. Use `gmake` on FreeBSD in place of `make`.
155
156 **It is recommended to use `*-user` make goals**, as more people had luck with them. But if they don't work as expected, try other available goals.
157
158 If you provided `PREFIX` and/or `DESTDIR` while running `make install`, remember that you must provide the same parameters, for example `make PREFIX=/usr/local hosts-chromium-user`:
159
160 | Command | Description |
161 | -------------------------- | -------------------------------------------------------------------------- |
162 | `make hosts-chromium-user` | Configure browserpass for Chromium browser, for the current user only |
163 | `make hosts-firefox-user` | Configure browserpass for Firefox browser, for the current user only |
164 | `make hosts-chrome-user` | Configure browserpass for Google Chrome browser, for the current user only |
165 | `make hosts-brave-user` | Configure browserpass for Brave browser, for the current user only |
166 | `make hosts-iridium-user` | Configure browserpass for Iridium browser, for the current user only |
167 | `make hosts-vivaldi-user` | Configure browserpass for Vivaldi browser, for the current user only |
168 | `make hosts-slimjet-user` | Configure browserpass for Slimjet browser, for the current user only |
169 | `sudo make hosts-chromium` | Configure browserpass for Chromium browser, system-wide |
170 | `sudo make hosts-firefox` | Configure browserpass for Firefox browser, system-wide |
171 | `sudo make hosts-chrome` | Configure browserpass for Google Chrome browser, system-wide |
172 | `sudo make hosts-brave` | Configure browserpass for Brave browser, system-wide |
173 | `sudo make hosts-iridium` | Configure browserpass for Iridium browser, system-wide |
174 | `sudo make hosts-vivaldi` | Configure browserpass for Vivaldi browser, system-wide |
175 | `sudo make hosts-slimjet` | Configure browserpass for Slimjet browser, system-wide |
176
177 In addition, Chromium-based browsers support the following `make` goals:
178
179 | Command | Description |
180 | ----------------------------- | ----------------------------------------------------------------------------------------------------------- |
181 | `make policies-chromium-user` | Automatically install browser extension from Web Store for Chromium browser, for the current user only |
182 | `make policies-chrome-user` | Automatically install browser extension from Web Store for Google Chrome browser, for the current user only |
183 | `make policies-brave-user` | Automatically install browser extension from Web Store for Brave browser, for the current user only |
184 | `make policies-iridium-user` | Automatically install browser extension from Web Store for Iridium browser, for the current user only |
185 | `make policies-slimjet-user` | Automatically install browser extension from Web Store for Slimjet browser, for the current user only |
186 | `make policies-vivaldi-user` | Automatically install browser extension from Web Store for Vivaldi browser, for the current user only |
187 | `sudo make policies-chromium` | Automatically install browser extension from Web Store for Chromium browser, system-wide |
188 | `sudo make policies-chrome` | Automatically install browser extension from Web Store for Google Chrome browser, system-wide |
189 | `sudo make policies-brave` | Automatically install browser extension from Web Store for Brave browser, system-wide |
190 | `sudo make policies-iridium` | Automatically install browser extension from Web Store for Iridium browser, system-wide |
191 | `sudo make policies-slimjet` | Automatically install browser extension from Web Store for Slimjet browser, system-wide |
192 | `sudo make policies-vivaldi` | Automatically install browser extension from Web Store for Vivaldi browser, system-wide |
193
194 ## Building the app
195
196 ### Build locally
197
198 Make sure you have the latest stable Go installed.
199
200 The following `make` goals are available (check Makefile for more details):
201
202 | Command | Description |
203 | ---------------------------- | ----------------------------------- |
204 | `make` or `make all` | Compile the app and run tests |
205 | `make browserpass` | Compile the app for your OS |
206 | `make browserpass-linux64` | Compile the app for Linux 64-bit |
207 | `make browserpass-windows64` | Compile the app for Windows 64-bit |
208 | `make browserpass-darwin64` | Compile the app for Mac OS X 64-bit |
209 | `make browserpass-openbsd64` | Compile the app for OpenBSD 64-bit |
210 | `make browserpass-freebsd64` | Compile the app for FreeBSD 64-bit |
211 | `make test` | Run tests |
212
213 ### Build using Docker
214
215 First build the docker image using the following command in the project root:
216
217 ```shell
218 docker build -t browserpass-native .
219 ```
220
221 The entry point in the docker image is the `make` command. To run it:
222
223 ```shell
224 docker run --rm -v "$(pwd)":/src browserpass-native
225 ```
226
227 Specify `make` goal(s) as the last parameter, for example:
228
229 ```shell
230 docker run --rm -v "$(pwd)":/src browserpass-native test
231 ```
232
233 Refer to the list of available `make` goals above.
234
235 ## Updates
236
237 If you installed the app using a package manager for your OS, you will likely update it in the same way.
238
239 If you installed manually, repeat the steps in the [Install manually](#install-manually) section.
240
241 ## FAQ
242
243 ### Error: Unable to fetch and parse login fields
244
245 If you can see passwords, but unable to fill forms or copy credentials, you likely have issues with your `gpg` setup.
246
247 First things first, make sure that `gpg` and some GUI `pinentry` are installed.
248
249 - on macOS many people succeeded with `pinentry-mac`
250 - on Linux [users report](https://github.com/browserpass/browserpass-extension/issues/155) that `pinentry-gnome3` does not work well with GNOME 3 and Firefox, use e.g. `pinentry-gtk-2`
251 - on Windows WSL people succeded with [pinentry-wsl-ps1](https://github.com/diablodale/pinentry-wsl-ps1)
252
253 `pinentry` is the application that asks you your password to unlock PGP key when you for example use `pass`.
254
255 The selected `pinentry` **must have GUI**, console-based (like `pinentry-tty` or `pinentry-curses`) **are not supported** (unless you know what you are doing).
256
257 Ensure that `gpg-agent` process is actually running, if not you need to investigate how to enable it.
258
259 Finally configure a GUI pinentry program in `~/.gnupg/gpg-agent.conf`:
260
261 ```
262 pinentry-program /full/path/to/pinentry
263 ```
264
265 You will need to restart `gpg-agent` using: `$ gpgconf --kill gpg-agent`
266
267 If Browserpass is unable to locate the proper `gpg` binary, try configuring a full path to your `gpg` in the browser extension settings or in `.browserpass.json` file in the root of your password store:
268
269 ```json
270 {
271 "gpgPath": "/full/path/to/gpg"
272 }
273 ```
274
275 ## Uninstallation
276
277 If you installed Browserpass via a package manager, uninstalling the package will hopefully do all the necessary cleanup.
278
279 For manual installations, uninstallation procedure basically consists of following the steps you ran in Makefile in reverse.
280
281 ## Contributing
282
283 1. Fork [the repo](https://github.com/browserpass/browserpass-extension)
284 2. Create your feature branch
285 - `git checkout -b my-new-feature`
286 3. Commit your changes
287 - `git commit -am 'Add some feature'`
288 4. Push the branch
289 - `git push origin my-new-feature`
290 5. Create a new pull request