allow configuring default reva address

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2024-06-28 17:25:40 +02:00
parent 871228ac96
commit 9d40aa8fc2
3 changed files with 10 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ type Config struct {
GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
GRPCServiceTLS *shared.GRPCServiceTLS `yaml:"grpc_service_tls"`
HTTPServiceTLS shared.HTTPServiceTLS `yaml:"http_service_tls"`
Reva *shared.Reva `yaml:"reva"`
Mode Mode // DEPRECATED
File string

View File

@@ -1,6 +1,7 @@
package config
import (
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
activitylog "github.com/owncloud/ocis/v2/services/activitylog/pkg/config/defaults"
antivirus "github.com/owncloud/ocis/v2/services/antivirus/pkg/config/defaults"
appProvider "github.com/owncloud/ocis/v2/services/app-provider/pkg/config/defaults"
@@ -52,6 +53,9 @@ func DefaultConfig() *Config {
Port: "9250",
Host: "localhost",
},
Reva: &shared.Reva{
Address: "com.owncloud.api.gateway",
},
Activitylog: activitylog.DefaultConfig(),
Antivirus: antivirus.DefaultConfig(),

View File

@@ -58,7 +58,9 @@ func EnsureDefaults(cfg *config.Config) {
if cfg.GRPCServiceTLS == nil {
cfg.GRPCServiceTLS = &shared.GRPCServiceTLS{}
}
if cfg.Reva == nil {
cfg.Reva = &shared.Reva{}
}
}
// EnsureCommons copies applicable parts of the oCIS config into the commons part
@@ -111,6 +113,8 @@ func EnsureCommons(cfg *config.Config) {
if cfg.OcisURL != "" {
cfg.Commons.OcisURL = cfg.OcisURL
}
cfg.Commons.Reva = structs.CopyOrZeroValue(cfg.Reva)
}
// Validate checks that all required configs are set. If a required config value