mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
gpg api: allow self signed and use default gpg version
This commit is contained in:
+5
-5
@@ -25,7 +25,7 @@ func apiGPGAddKey(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
args := []string{"--no-default-keyring"}
|
args := []string{"--no-default-keyring", "--allow-non-selfsigned-uid"}
|
||||||
keyring := "trustedkeys.gpg"
|
keyring := "trustedkeys.gpg"
|
||||||
if len(b.Keyring) > 0 {
|
if len(b.Keyring) > 0 {
|
||||||
keyring = b.Keyring
|
keyring = b.Keyring
|
||||||
@@ -73,11 +73,11 @@ func apiGPGAddKey(c *gin.Context) {
|
|||||||
// there is no error handling for such as gpg will do this for us
|
// there is no error handling for such as gpg will do this for us
|
||||||
cmd := exec.Command(gpg, args...)
|
cmd := exec.Command(gpg, args...)
|
||||||
fmt.Printf("running %s %s\n", gpg, strings.Join(args, " "))
|
fmt.Printf("running %s %s\n", gpg, strings.Join(args, " "))
|
||||||
cmd.Stdout = os.Stdout
|
out, err := cmd.CombinedOutput()
|
||||||
if err = cmd.Run(); err != nil {
|
if err != nil {
|
||||||
AbortWithJSONError(c, 400, err)
|
c.JSON(400, string(out))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(200, gin.H{})
|
c.JSON(200, string(out))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user