wied03 / cookbook-gpg

GPG cookbook for Chef, LWRP focused
2 stars 8 forks source link

Support GnuPG 2.1 & Import keys from data bags #6

Open grv87 opened 7 years ago

grv87 commented 7 years ago

This PR fixes #5 and passes tests.

However, I'm not sure that implemented proposal to import keys with gpg doesn't introduce regressions with some gpg2-specific key formats. Also, I'm not sure that all other features (not covered by tests) work with GnuPG 2.1. See the whole list of changes in GnuPG 2.1 at https://lists.gnupg.org/pipermail/gnupg-announce/2014q4/000358.html. Maybe additional code changes are needed.

It also adds support to import keys from data bags.

I didn't touch version number and CHANGELOG.

grv87 commented 7 years ago

I see I had to update .travis and .ruby-version as well.

This PR doesn't fix problems with tty, it only suppresses them in tests. It doesn't work in production: I had to set GPG_TTY environment variable and open access to tty to dedicated user, see e.g. here. And after all I can't get rid of password prompt (password is empty), even with --batch --no-tty.

So, it looks like GnuPG 2.1 can't be used in unattended environment after all. Maybe we could switch to good old gpg. I'm open to discussion.

Fell free to close if you have no ideas.