From a45f717d3ffc6d508515399734652b2a81b23ee1 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 14 Jan 2022 10:42:36 +0100 Subject: [PATCH] Make the project spaces capability configurable Some deployments don't want to show early stages of the spaces feature set in the clients. It can now be disabled in the capabilities. --- storage/pkg/command/frontend.go | 2 +- storage/pkg/config/config.go | 5 +++++ storage/pkg/config/defaultconfig.go | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/pkg/command/frontend.go b/storage/pkg/command/frontend.go index e96d2c1477..81eb0a268c 100644 --- a/storage/pkg/command/frontend.go +++ b/storage/pkg/command/frontend.go @@ -294,7 +294,7 @@ func frontendConfigFromStruct(c *cli.Context, cfg *config.Config, filesCfg map[s }, "spaces": map[string]interface{}{ "version": "0.0.1", - "enabled": true, + "enabled": cfg.Reva.Frontend.ProjectSpaces, }, }, "version": map[string]interface{}{ diff --git a/storage/pkg/config/config.go b/storage/pkg/config/config.go index 6cd62c35d6..a2c738bfc7 100644 --- a/storage/pkg/config/config.go +++ b/storage/pkg/config/config.go @@ -155,6 +155,7 @@ type FrontendPort struct { ArchiverPrefix string `ocisConfig:"archiver_prefix"` DatagatewayPrefix string `ocisConfig:"data_gateway_prefix"` Favorites bool `ocisConfig:"favorites"` + ProjectSpaces bool `ocisConfig:"project_spaces"` OCDavInsecure bool `ocisConfig:"ocdav_insecure"` OCDavPrefix string `ocisConfig:"ocdav_prefix"` OCSPrefix string `ocisConfig:"ocs_prefix"` @@ -815,6 +816,10 @@ func structMappings(cfg *Config) []shared.EnvBinding { EnvVars: []string{"STORAGE_FRONTEND_FAVORITES"}, Destination: &cfg.Reva.Frontend.Favorites, }, + { + EnvVars: []string{"STORAGE_FRONTEND_PROJECT_SPACES"}, + Destination: &cfg.Reva.Frontend.ProjectSpaces, + }, { EnvVars: []string{"STORAGE_FRONTEND_OCDAV_PREFIX"}, Destination: &cfg.Reva.Frontend.OCDavPrefix, diff --git a/storage/pkg/config/defaultconfig.go b/storage/pkg/config/defaultconfig.go index 0f266d4d65..23602bbf16 100644 --- a/storage/pkg/config/defaultconfig.go +++ b/storage/pkg/config/defaultconfig.go @@ -239,6 +239,7 @@ func DefaultConfig() *Config { ArchiverPrefix: "archiver", DatagatewayPrefix: "data", Favorites: false, + ProjectSpaces: true, OCDavInsecure: false, // true? OCDavPrefix: "", OCSPrefix: "ocs",