Skip to content

Commit

Permalink
gpg api: allow self signed and use default gpg version
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Apr 3, 2024
1 parent b5b0a52 commit 6be4f5e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func apiGPGAddKey(c *gin.Context) {
}

var err error
args := []string{"--no-default-keyring"}
args := []string{"--no-default-keyring", "--allow-non-selfsigned-uid"}
keyring := "trustedkeys.gpg"
if len(b.Keyring) > 0 {
keyring = b.Keyring
Expand Down Expand Up @@ -73,11 +73,11 @@ func apiGPGAddKey(c *gin.Context) {
// there is no error handling for such as gpg will do this for us
cmd := exec.Command(gpg, args...)
fmt.Printf("running %s %s\n", gpg, strings.Join(args, " "))
cmd.Stdout = os.Stdout
if err = cmd.Run(); err != nil {
AbortWithJSONError(c, 400, err)
out, err := cmd.CombinedOutput()
if err != nil {
c.JSON(400, string(out))
return
}

c.JSON(200, gin.H{})
c.JSON(200, string(out))
}

0 comments on commit 6be4f5e

Please sign in to comment.