Giter Site home page Giter Site logo

bitwarden-dmenu's People

Contributors

actions-user avatar andykais avatar avalonwilliams avatar epse avatar paga2004 avatar thereverend403 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bitwarden-dmenu's Issues

Ignores dmenu font option

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

Hitting escape locks bitwarden

When hitting escape inside of the menu selection bitwarden just immediately locks. No matter for how long the grace period should have lasted.

To reproduce:

  • open bitwarden-dmenu with a session timeout
  • Enter your password and unlock your vault
  • in the item selection screen hit escape to exit dmenu

Expected behaviour:

The menu just closes and the vault stays unlocked

Actual behaviour:

The vault locks immediately so you have to reenter your password once you open bitwarden-dmenu again

Weird Behaviour with Bemenu

This line unconditionally adds some dmenu args, specifically for password input, and there isnt currently a way to disable them

const dmenuPswdArgsParsed = ['-p', 'Password:', '-nf', 'black', '-nb', 'black'].concat(

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

Error messages on running.

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.

Use for selfhosted Servers

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.

Unexpected EOF while looking for matching `''

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.

Invalid password with the correct password.

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.

Wrong account being selected

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.

The dmenu-args flag causes type error

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.

Request: use git tags to mark releases

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!

[Feature Request] Prompt for bw login and export BW_SESSION

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)

real session security

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

Example command in the readme not correct

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.