mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
Fix: Remove Batch from API options, set to true by default, add comments
Fixes: #1106
This commit is contained in:
+3
-2
@@ -16,7 +16,6 @@ import (
|
||||
// SigningOptions is a shared between publish API GPG options structure
|
||||
type SigningOptions struct {
|
||||
Skip bool
|
||||
Batch bool
|
||||
GpgKey string
|
||||
Keyring string
|
||||
SecretKeyring string
|
||||
@@ -33,7 +32,9 @@ func getSigner(options *SigningOptions) (pgp.Signer, error) {
|
||||
signer.SetKey(options.GpgKey)
|
||||
signer.SetKeyRing(options.Keyring, options.SecretKeyring)
|
||||
signer.SetPassphrase(options.Passphrase, options.PassphraseFile)
|
||||
signer.SetBatch(options.Batch)
|
||||
|
||||
// If Batch is false, GPG will ask for passphrase on stdin, which would block the api process
|
||||
signer.SetBatch(true)
|
||||
|
||||
err := signer.Init()
|
||||
if err != nil {
|
||||
|
||||
+2
-1
@@ -46,7 +46,8 @@ type GoSigner struct {
|
||||
signerConfig *packet.Config
|
||||
}
|
||||
|
||||
// SetBatch controls whether we allowed to interact with user
|
||||
// SetBatch controls whether we allowed to interact with user, for example
|
||||
// for getting the passphrase from stdin.
|
||||
func (g *GoSigner) SetBatch(batch bool) {
|
||||
g.batch = batch
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user