Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a standard way for batch-creation of passwords/notes? #220

Open
bogorad opened this issue Dec 4, 2024 · 2 comments
Open

a standard way for batch-creation of passwords/notes? #220

bogorad opened this issue Dec 4, 2024 · 2 comments

Comments

@bogorad
Copy link

bogorad commented Dec 4, 2024

I needed to batch-create a couple of keys, so I found a hacky way to do it (spawn a fake "editor" that echos some stuff into the file provided as argument, use it as EDITOR=, then immediately delete it), but - maybe - there should be a less hacky way? :)

@Anachron
Copy link

Anachron commented Dec 6, 2024

Yep I need to migrate a ton of passwords and an option to disable the editor and just use whatever is on stdin would be very appreciated.

@bogorad
Copy link
Author

bogorad commented Dec 6, 2024

you can use my hack for now:

    # Store private key in Bitwarden
    echo "Storing private key in Bitwarden..."
    # cleanup fake editor
    rm -rf /tmp/fake-editor.sh
    # create fake-editor.sh
    cat <<EOL > /tmp/fake-editor.sh
#!/usr/bin/env bash
echo "no-password" >\$1
cat $key_dir/key_file >>\$1
EOL
    # make it executable
    chmod +x /tmp/fake-editor.sh
    # now run rbw that will call our fake-editor
    EDITOR=/tmp/fake-editor.sh rbw add "$key_name" ||
    die "Failed to store key in Bitwarden"
.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants