diff --git a/changelog/unreleased/remove-useless-vars.md b/changelog/unreleased/remove-useless-vars.md new file mode 100644 index 000000000..9275ee14f --- /dev/null +++ b/changelog/unreleased/remove-useless-vars.md @@ -0,0 +1,5 @@ +Bugfix: Remove invalid environment variables + +We have removed two spaces related environment variables (whether project spaces and the share jail are enabled) and hardcoded the only allowed options. Misusing those variables would have resulted in invalid config. + +https://github.com/owncloud/ocis/pull/8303 diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index fa8c7b2fc..2c2aea74c 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -27,8 +27,6 @@ type Config struct { SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"FRONTEND_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token."` EnableFavorites bool `yaml:"enable_favorites" env:"FRONTEND_ENABLE_FAVORITES" desc:"Enables the support for favorites in the clients."` - EnableProjectSpaces bool `yaml:"enable_project_spaces" env:"FRONTEND_ENABLE_PROJECT_SPACES" desc:"Changing this value is NOT supported. Indicates to clients that project spaces are supposed to be made available."` - EnableShareJail bool `yaml:"enable_share_jail" env:"FRONTEND_ENABLE_SHARE_JAIL" desc:"Changing this value is NOT supported. Indicates to clients that the share jail is supposed to be used."` MaxQuota uint64 `yaml:"max_quota" env:"OCIS_SPACES_MAX_QUOTA;FRONTEND_MAX_QUOTA" desc:"Set the global max quota value in bytes. A value of 0 equals unlimited. The value is provided via capabilities."` UploadMaxChunkSize int `yaml:"upload_max_chunk_size" env:"FRONTEND_UPLOAD_MAX_CHUNK_SIZE" desc:"Sets the max chunk sizes in bytes for uploads via the clients."` UploadHTTPMethodOverride string `yaml:"upload_http_method_override" env:"FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE" desc:"Advise TUS to replace PATCH requests by POST requests."` diff --git a/services/frontend/pkg/config/defaults/defaultconfig.go b/services/frontend/pkg/config/defaults/defaultconfig.go index 1536d6f63..5a9b81c9a 100644 --- a/services/frontend/pkg/config/defaults/defaultconfig.go +++ b/services/frontend/pkg/config/defaults/defaultconfig.go @@ -81,8 +81,6 @@ func DefaultConfig() *config.Config { Reva: shared.DefaultRevaConfig(), PublicURL: "https://localhost:9200", EnableFavorites: false, - EnableProjectSpaces: true, - EnableShareJail: true, UploadMaxChunkSize: 1e+7, UploadHTTPMethodOverride: "", DefaultUploadProtocol: "tus", diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 93ab7833a..0b38abaab 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -286,9 +286,9 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string }, "spaces": map[string]interface{}{ "version": "1.0.0", - "enabled": cfg.EnableProjectSpaces || cfg.EnableShareJail, - "projects": cfg.EnableProjectSpaces, - "share_jail": cfg.EnableShareJail, + "enabled": true, + "projects": true, + "share_jail": true, "max_quota": cfg.MaxQuota, }, "search": map[string]interface{}{