Support store settings (#28)

This commit is contained in:
Maxim Baz
2019-03-16 13:59:20 +01:00
committed by GitHub
parent 800aced875
commit cbbf6b73ff
2 changed files with 15 additions and 5 deletions

View File

@@ -64,8 +64,13 @@ func fetchDecryptedContents(request *request) {
} }
store.Path = normalizedStorePath store.Path = normalizedStorePath
gpgPath := request.Settings.GpgPath var gpgPath string
if gpgPath != "" { if store.Settings.GpgPath != "" || request.Settings.GpgPath != "" {
if store.Settings.GpgPath != "" {
gpgPath = store.Settings.GpgPath
} else {
gpgPath = request.Settings.GpgPath
}
err = validateGpgBinary(gpgPath) err = validateGpgBinary(gpgPath)
if err != nil { if err != nil {
log.Errorf( log.Errorf(

View File

@@ -11,10 +11,15 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
type storeSettings struct {
GpgPath string `json:"gpgPath"`
}
type store struct { type store struct {
ID string `json:"id"` ID string `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Path string `json:"path"` Path string `json:"path"`
Settings storeSettings `json:"settings"`
} }
type settings struct { type settings struct {