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 Mar 6, 2024
1 parent e564b7c commit eda1e48
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))

Check warning on line 78 in api/gpg.go

View check run for this annotation

Codecov / codecov/patch

api/gpg.go#L78

Added line #L78 was not covered by tests
return
}

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

0 comments on commit eda1e48

Please sign in to comment.