Skip to content

Is this useful? I wrote an automated script to organize imported passwords (e.g. from Gmail) #49

@niftylettuce

Description

@niftylettuce

I wrote a quick Node.js script to automate the conversion of password store naming conventions from pass (https://passwordstore.org) into a more organized format. This is especially useful when importing 🎉

I imported passwords from a Chrome export, and all of them were organized like accounts.google.com0, accounts.google.com1, accounts.google.com2 and so on.

When using pass in combination with https://github.com/browserpass/browserpass the helper browser extension had a polluted list that was incredibly hard to use (you would have to click each one, or have to manually go through each and clean it up).

I tried using https://qtpass.org/, but it was too slow. I also tried using the CLI, but I wanted to automate this. Below is a quick Node.js script I wrote (with zero dependencies required). All you have to do is save it as file.js, install Node, and then run node file.js.

It goes through ~/.password-store and picks out files ending in .gpg (password store names) and excludes directories. It then iterates over each and pulls out the login and url values from the configuration. Lastly it moves the file such that the format is $login/$url.hostname. It runs serially and has some safeguards built-in.

https://gist.github.com/niftylettuce/9ab522a2c60424c071f057bc197d140b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions