andykais / bitwarden-dmenu Goto Github PK
View Code? Open in Web Editor NEWdmenu for bitwarden-cli
License: MIT License
dmenu for bitwarden-cli
License: MIT License
Describe the bug
Adding a font to --dmenu-args or --dmenu-passwd-args like --dmenu-pswd-args="-i -fn 'Hack-10'"
doesn't actually change the font
To Reproduce
bitwarden-dmenu --dmenu-pswd-args="-i -fn 'Hack-10'" --dmenu-args="-i -fn 'Hack-10'" --clear-clipboard 30 --session-timeout 500 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low' --debug
bitwarden-dmenu v1.5.3
$ /usr/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw login --check
checking for session file at /tmp/bitwarden-session.txt
no session file found.
$ dmenu -p Password: -nf black -nb black -i -fn 'Hack-10'
The menu shown uses the same default small font as running just dmenu without -fn
Expected behavior
The menu uses the font Hack-10
When hitting escape inside of the menu selection bitwarden just immediately locks. No matter for how long the grace period should have lasted.
The menu just closes and the vault stays unlocked
The vault locks immediately so you have to reenter your password once you open bitwarden-dmenu again
This line unconditionally adds some dmenu args, specifically for password input, and there isnt currently a way to disable them
Line 80 in 221205e
Bemenu has slightly different arg handling where multi-character arguments are prefixed with a double hyphen instead of single (--nb
instead of -nb
), and interprets these arguments to mean the flags -n and -b which puts the password prompt always at the bottom of the screen.
A fix would be to simply make these defaults for dmenu-pswd-args, rather than adding them unconditionally
Describe the bug
After logging in to bitwarden-cli client, then running bitwarden-dmenu
I received a few error messages after typing the master password into the dmenu dialog box.
To Reproduce
`โ bitwarden-dmenu --verbose
$ dmenu -p Password: -nf black -nb black
$ /home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw unlock '******' --raw
$ /home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw sync --last --session=******
syncing vault...
$ /home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw sync --session=******
sync complete, last sync was 2018-09-16T13:15:42.029Z
$ /home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw list items --session=******
TypeError: Cannot read property 'username' of undefined
at list.map.a (/home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/src/index.js:58:60)
at Array.map ()
at chooseAccount (/home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/src/index.js:58:29)
at module.exports (/home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/src/index.js:100:33)
begin cleanup
/tmp/bitwarden-session.txt already removed.
$ /home/{myuser}/.node_modules/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw lock
bitwarden is locked.
clipboard is cleared.
`
Expected behavior
I guess to list the items in the password vault for selection.
Currently I don't see the ability to pass a URL for login to a selfhosted instance.
I would love to use this on my OnePlus6 running SXMO under sway.
Describe the bug
After logging in using the bw
command, I run dmenu (with the options from the readme) from the command line. (Usually it is run from i3, but I wanted debug info).
It correctly prompts for my password, but after pressing Enter it errors out.
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
Error
at module.exports.args (/usr/lib/node_modules/bitwarden-dmenu/src/exec-bitwarden -
cli.js:13:11)
at getSessionVar (/usr/lib/node_modules/bitwarden-dmenu/src/index.js:24:23)
bitwarden is locked.
clipboard is cleared
To Reproduce
Use a password that contains a single quote '
. This will cause the error, correct password or not. Double quotes work fine, typing a backslash in front of a single quote (to escape it) doesn't fix the issue. This can be reproduced by typing any random password containing a single quote.
When typing a password containing two single quotes, the error does not happen. However I don't know what password is actually passed on to bitwarden.
Expected behavior
My password gets accepted and I can select an accout to copy the password from.
I suppose we would have to escape passwords before sending them in.
rev@serenity ~> bitwarden-dmenu --on-error 'xargs notify-send --urgency=low' --verbose
$ dmenu -p Password: -nf black -nb black
$ /home/rev/.nvm/versions/node/v8.12.0/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw unlock $'******' --raw
Error: Invalid master password.
at module.exports.args (/home/rev/.nvm/versions/node/v8.12.0/lib/node_modules/bitwarden-dmenu/src/exec-bitwarden-cli.js:13:11)
at getSessionVar (/home/rev/.nvm/versions/node/v8.12.0/lib/node_modules/bitwarden-dmenu/src/index.js:32:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
begin cleanup
/tmp/bitwarden-session.txt already removed.
$ /home/rev/.nvm/versions/node/v8.12.0/lib/node_modules/bitwarden-dmenu/node_modules/.bin/bw lock
bitwarden is locked.
clipboard is cleared.
Now that #4 works, when I select certain accounts, Rizon: Leliana
for example, it actually returns the password for Paypal: <[email protected]>
. I've had a poke around and I think it's something to do with https://github.com/andykais/bitwarden-dmenu/blob/master/src/index.js#L61 being passed as an array key to an array where the keys are ['accountname']
instead of ['accountname: username']
. The part I have no idea about is why some work fine and others don't even though they all do the same array indexing.
Describe the bug
The --dmenu-args
flag produces a type error.
To Reproduce
I essentially copied your command from the README, tweaking a few of the values.
$ bitwarden-dmenu --debug --dmenu-args '-i' --clear-clipboard 30 --session-timeout 3600 --sync-vault-after 3600
/home/steen/.config/nvm/versions/node/v13.13.0/lib/node_modules/bitwarden-dmenu/bin/cli.js:76
const dmenuArgsParsed = dmenuArgs ? dmenuArgs.split(/\s+/) : []
^
TypeError: dmenuArgs.split is not a function
at Object.<anonymous> (/home/steen/.config/nvm/versions/node/v13.13.0/lib/node_modules/bitwarden-dmenu/bin/cli.js:76:47)
at Module._compile (internal/modules/cjs/loader.js:1123:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:972:32)
at Function.Module._load (internal/modules/cjs/loader.js:872:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
I am on version 1.5.5, using Node 13.13.0 (through nvm).
Expected behavior
I expected the script to run correctly, as it does upon removing the --dmenu-args
option.
Hi there! I'm a happy user of this repo, so much that I package it for the AUR (user-generated packages for Arch Linux).
My request is that each release should be tagged via git, which means that (1) I can get notified on each release via RSS and (2) I can download a snapshot of the repository directly from GitHub without cloning it. I'm aware that you're tagging the releases in npm, but I found no way to subscribe to those.
Thank you for your work!
I'm not a JS dev, otherwise I'd love to try to implement this myself.
A way to login though dmenu (if not already logged in) would be amazing.
The bash command corresponding to the required action: export BW_SESSION="$(bw login --raw)"
The fish command for those who use fish (me): set BW_SESSION (bw login --raw)
leaving this as an open issue for jotting down thoughts. Currently sessions are reusable by storing a txt file in /tmp/bitwarden-session.txt
. This is obviously not ideal, since it opens up users to an attach which looks for that open session file. I haven't figured out how to store a key somewhere on the system in such a way that I can access it from different terminals/processes and not force the user to provide a key.
Perhaps I can tie the session key to the keyring using the user's access as the permission. Its probably safe to assume that the user executing the command is safe to access that session key.
Another open is setting up a daemon. It would be easy to just assume the session key being stored in memory is "good enough" for now. This would also help with race conditions on closing the session/clearing the clipboard. A daemon is more annoying to wield though, it requires adding something to your startup scripts
Describe the bug
When I run the example command provided in the README, I get the following error. I also tried with the flag --debug
. The output stays the same.
$ bitwarden-dmenu --dmenu-args '-i' --clear-clipboard 30 --session-timeout 100 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low'
/usr/lib/node_modules/bitwarden-dmenu/bin/cli.js:77
const dmenuArgsParsed = dmenuArgs ? dmenuArgs.split(/\s+/) : []
^
TypeError: dmenuArgs.split is not a function
at Object.<anonymous> (/usr/lib/node_modules/bitwarden-dmenu/bin/cli.js:77:47)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
To Reproduce
Run the following command.
$ bitwarden-dmenu --dmenu-args '-i' --clear-clipboard 30 --session-timeout 100 --sync-vault-after 3600 --on-error 'xargs notify-send --urgency=low'
Expected behavior
It should open dmenu and just work with the specified arguments like it is descriebed in the usage section.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.