dnbert / prm

PRM Allows you to quickly build package repositories, inspired by Jordan Sissels' FPM
MIT License
250 stars 33 forks source link

gpg integration is improved #70

Open litch opened 7 years ago

litch commented 7 years ago

We operate PRM via another controlling process (a web app) that does not have access to tty. However, without access to tty, gpg fails, and the release is not signed - leading to all kinds of problems. This was also experienced here, it seems:

https://github.com/dnbert/prm/issues/69

While adding the tty flag, we found that though gpg_passphrase is set to false by Clamp, the logic seems to be predicated on it being nil.

Result of a prm invocation without a passphrase:

sign_cmd = echo 'false' | gpg --digest-algo \"SHA256\" -u <KeyID> --passphrase-fd 0 --yes --output Release.gpg -b Release

An unprotected key doesn't seem to mind if you pass it the wrong password, so it's possible to eliminate the third branch entirely, but that seems sloppy.