From 9d40aa8fc28a2b1a8db089c7a6b034a4fd2f5adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 28 Jun 2024 17:25:40 +0200 Subject: [PATCH] allow configuring default reva address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- ocis-pkg/config/config.go | 1 + ocis-pkg/config/defaultconfig.go | 4 ++++ ocis-pkg/config/parser/parse.go | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index 84f4119ac..5e469d7be 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -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 diff --git a/ocis-pkg/config/defaultconfig.go b/ocis-pkg/config/defaultconfig.go index bca348b4e..f25cccd81 100644 --- a/ocis-pkg/config/defaultconfig.go +++ b/ocis-pkg/config/defaultconfig.go @@ -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(), diff --git a/ocis-pkg/config/parser/parse.go b/ocis-pkg/config/parser/parse.go index 27d98f7b1..30dbacd17 100644 --- a/ocis-pkg/config/parser/parse.go +++ b/ocis-pkg/config/parser/parse.go @@ -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