Skip to content

Commit

Permalink
allow configuring default reva address
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Jun 28, 2024
1 parent b70d720 commit fe4f543
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ocis-pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ocis-pkg/config/defaultconfig.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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(),
Expand Down
6 changes: 5 additions & 1 deletion ocis-pkg/config/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe4f543

Please sign in to comment.