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

Enhancement request: improve scriptablility #4

Closed
udf2457 opened this issue Jun 20, 2020 · 7 comments
Closed

Enhancement request: improve scriptablility #4

udf2457 opened this issue Jun 20, 2020 · 7 comments

Comments

@udf2457
Copy link

udf2457 commented Jun 20, 2020

Woul be nice if rsign were given args to enable it to be more scriptable. At the moment it expects key password to be typed in, a scriptable alternative for this (e.g. path to env file) would be very much appreciated.

@jedisct1
Copy link
Owner

You can use the < shell operator in order to get input data from a file instead of a keyboard.

rsign2 ... < password.txt

Works with anything that expects input from the keyboard :)

@Firaenix
Copy link

Firaenix commented Jun 3, 2023

using < in macos doesnt work for me when passing a password.txt in, I still get prompted for the password.

Is there anyway around this?

@jedisct1
Copy link
Owner

jedisct1 commented Jun 3, 2023

@Firaenix You can use the original version: https://jedisct1.github.io/minisign/

< works as it should, and there's also a -W command-line flag to not use a password at all.

@jedisct1
Copy link
Owner

jedisct1 commented Jun 3, 2023

I released a new version of rsign2, that includes the same feature.

@passcod
Copy link

passcod commented Sep 6, 2023

rsign2 uses rpassword, which reads /dev/tty instead of /dev/stdin, hence why < file doesn't work.

Though a bit clunky, I've successfully used good ol expect instead. If it helps anyone else:

expect <<EXP
spawn rsign generate -f -p minisign.pub -s minisign.key
expect "Password:"
send -- "$SIGNING_KEY_SECRET\r"
expect "Password (one more time):"
send -- "$SIGNING_KEY_SECRET\r"
expect eof
EXP
expect <<EXP
spawn rsign sign -s minisign.key -x "$file.sig" -t "$comment" "$file"
expect "Password:"
send -- "$SIGNING_KEY_SECRET\r"
expect eof
EXP

@jedisct1
Copy link
Owner

jedisct1 commented Sep 6, 2023

rsign generate --passwordless creates a key pair that doesn't require a password.

@passcod
Copy link

passcod commented Sep 6, 2023

Yes, but in that case I do want a password, just not interactively.

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

4 participants