Skip to content

Commit 0159523

Browse files
authored
Merge branch 'master' into makefile-fixes
2 parents 8d9dd7a + 4e74463 commit 0159523

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ This piece of software wraps around the **[zx2c4 pass](http://www.zx2c4.com/proj
2222

2323
#### Linux, MacOS, * BSD
2424

25-
Download the `install_host_app.sh` script from [our releases page](https://github.com/passff/passff-host/releases) and execute it. You can do this in one line like so:
25+
Download the latest `install_host_app.sh` script from [our releases page](https://github.com/passff/passff-host/releases) and execute it. As an example, Firefox users can do this in one line like so:
2626

2727
```
28-
$ curl -sSL https://github.com/passff/passff-host/releases/download/1.0.1/install_host_app.sh | bash -s -- [firefox|chrome|opera|chromium|vivaldi]
28+
$ VERSION=1.0.2
29+
$ curl -sSL https://github.com/passff/passff-host/releases/download/${VERSION}/install_host_app.sh | bash -s -- firefox
2930
```
3031

31-
This script will download the host application (a small python script) and the add-on's manifest file (a JSON config file) and put them in the right place.
32+
Users of other supported browsers need to replace the last argument (`firefox`) by `chrome`, `opera`, `chromium` or `vivaldi`.
33+
The script will download the host application (a small python script) and the add-on's manifest file (a JSON config file) and put them in the right place.
3234
If you're concerned about executing a script that downloads files from the web, you can download the files yourself and run the script with the `--local` option instead or link the files yourself. Details below.
3335

3436
#### Windows
35-
Download the `install_host_app.bat` script from [our releases page](https://github.com/passff/passff-host/releases) and execute it from within a shell with a correct PATH.
37+
Download the `install_host_app.bat` script from [our releases page](https://github.com/passff/passff-host/releases) and execute it from within a shell with a correct PATH, mentioning your browser in the last argument (i.e., replace `firefox` by `chrome`, `opera`, `chromium` or `vivaldi` if necessary).
3638
*The rule of thumb is: if you can execute pass and python from your shell, then your host application will be installed correctly.*
3739

3840
```
39-
> install_host_app.bat [firefox|chrome|opera|chromium|vivaldi]
41+
> install_host_app.bat firefox
4042
```
4143

4244
Note: Older Windows versions might require powershell to be installed manually as the install script uses powershell internally. Windows 10 users should be fine out of the box.
@@ -143,6 +145,12 @@ In the preferences of PassFF, you can enable the status bar and debug logs in th
143145
* The typical output for an empty store is:
144146
* `{"stderr": "", "version": "1.0.1", "exitCode": 0, "stdout": "Password Store\n"}`
145147

148+
#### Testing OTP support
149+
```console
150+
$ echo -e "\x19\x00\x00\x00[\"otp\",\"/www/github.com\"]" | /path/to/passff.py | tail -c +4; echo
151+
{"exitCode": 0, "stderr": "", "stdout": "123456\n", "version": "1.0.1"}
152+
```
153+
146154
### Preferences
147155
If you use a customized `pass` installation: environment variables, customized repository path or extensions, you may have to customize the *preferences section* in `passff.py`.
148156

src/install_host_app.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ fi
4343
usage() {
4444
echo "Usage: $0 [OPTION] [chrome|chromium|firefox|opera|vivaldi]
4545
46+
Example:
47+
$0 firefox # Install host app for Mozilla Firefox
48+
4649
Options:
4750
-l, --local Install files from disk instead of downloading them
4851
-h, --help Show this message"

src/passff.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,23 @@ def sendMessage(encodedMessage):
5252
std_input = None
5353

5454
if len(receivedMessage) == 0:
55-
pass
55+
opt_args = ["show"]
5656
elif receivedMessage[0] == "insert":
5757
opt_args = ["insert", "-m"]
5858
pos_args = [receivedMessage[1]]
5959
std_input = receivedMessage[2]
6060
elif receivedMessage[0] == "generate":
61-
pos_args = [receivedMessage[1], receivedMessage[2]]
6261
opt_args = ["generate"]
62+
pos_args = [receivedMessage[1], receivedMessage[2]]
6363
if "-n" in receivedMessage[3:]:
6464
opt_args.append("-n")
65+
elif receivedMessage[0] == "otp" and len(receivedMessage) == 2:
66+
opt_args = ["otp"]
67+
key = receivedMessage[1]
68+
key = "/" + (key[1:] if key[0] == "/" else key)
69+
pos_args = [key]
6570
else:
71+
opt_args = ["show"]
6672
key = receivedMessage[0]
6773
key = "/" + (key[1:] if key[0] == "/" else key)
6874
pos_args = [key]

0 commit comments

Comments
 (0)