Merge pull request #4180 from owncloud/fix-search-reva-addr-config
fix search reva addr config parsing
This commit is contained in:
2 files changed
+10
-2
No files matched your search
@@ -19,7 +19,7 @@ type Config struct {
|
|||||||
GRPC GRPC `yaml:"grpc"`
|
GRPC GRPC `yaml:"grpc"`
|
||||||
|
|
||||||
Datapath string `yaml:"data_path" env:"SEARCH_DATA_PATH" desc:"Path for the search persistence directory."`
|
Datapath string `yaml:"data_path" env:"SEARCH_DATA_PATH" desc:"Path for the search persistence directory."`
|
||||||
Reva Reva `yaml:"reva"`
|
Reva *Reva `yaml:"reva"`
|
||||||
Events Events `yaml:"events"`
|
Events Events `yaml:"events"`
|
||||||
|
|
||||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SEARCH_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services."`
|
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SEARCH_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services."`
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Name: "search",
|
Name: "search",
|
||||||
},
|
},
|
||||||
Datapath: path.Join(defaults.BaseDataPath(), "search"),
|
Datapath: path.Join(defaults.BaseDataPath(), "search"),
|
||||||
Reva: config.Reva{
|
Reva: &config.Reva{
|
||||||
Address: "127.0.0.1:9142",
|
Address: "127.0.0.1:9142",
|
||||||
},
|
},
|
||||||
Events: config.Events{
|
Events: config.Events{
|
||||||
@@ -68,6 +68,14 @@ func EnsureDefaults(cfg *config.Config) {
|
|||||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.Reva == nil && cfg.Commons != nil && cfg.Commons.Reva != nil {
|
||||||
|
cfg.Reva = &config.Reva{
|
||||||
|
Address: cfg.Commons.Reva.Address,
|
||||||
|
}
|
||||||
|
} else if cfg.Reva == nil {
|
||||||
|
cfg.Reva = &config.Reva{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Sanitize(cfg *config.Config) {
|
func Sanitize(cfg *config.Config) {
|
||||||
|
|||||||
Reference in new issue
Block a user