Skip to content

Commit

Permalink
Merge pull request #8303 from owncloud/remove-spaces-config-options
Browse files Browse the repository at this point in the history
fix: hardcode config for spaces which was not allowed to change
  • Loading branch information
micbar committed Feb 2, 2024
2 parents 10aa33c + 76aa0a0 commit e22dce4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions 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
2 changes: 0 additions & 2 deletions services/frontend/pkg/config/config.go
Expand Up @@ -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."`
Expand Down
2 changes: 0 additions & 2 deletions services/frontend/pkg/config/defaults/defaultconfig.go
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions services/frontend/pkg/revaconfig/config.go
Expand Up @@ -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{}{
Expand Down

0 comments on commit e22dce4

Please sign in to comment.