From b6f03f9a6cc51f8c8c76a136d8f87d318b8147e7 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 3 May 2022 11:13:04 +0200 Subject: [PATCH] frontend config docs --- extensions/auth-basic/pkg/config/config.go | 2 +- extensions/auth-bearer/pkg/config/config.go | 5 +- extensions/auth-machine/pkg/config/config.go | 5 +- extensions/frontend/pkg/config/config.go | 69 ++++++++----------- .../pkg/config/defaults/defaultconfig.go | 5 -- extensions/gateway/pkg/config/config.go | 2 +- extensions/group/pkg/config/config.go | 3 +- extensions/ocdav/pkg/config/config.go | 2 +- extensions/sharing/pkg/config/config.go | 13 ++-- .../storage-metadata/pkg/config/config.go | 13 ++-- .../storage-publiclink/pkg/config/config.go | 7 +- .../storage-shares/pkg/config/config.go | 3 +- extensions/storage-users/pkg/config/config.go | 21 +++--- extensions/user/pkg/config/config.go | 9 +-- 14 files changed, 76 insertions(+), 83 deletions(-) diff --git a/extensions/auth-basic/pkg/config/config.go b/extensions/auth-basic/pkg/config/config.go index ad70ebbd7..03c747db7 100644 --- a/extensions/auth-basic/pkg/config/config.go +++ b/extensions/auth-basic/pkg/config/config.go @@ -18,7 +18,7 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` + SkipUserGroupsInToken bool `yaml:"-"` AuthProvider string `yaml:"auth_provider" env:"AUTH_BASIC_AUTH_PROVIDER" desc:"The auth provider which should be used by the service"` AuthProviders AuthProviders `yaml:"auth_providers"` diff --git a/extensions/auth-bearer/pkg/config/config.go b/extensions/auth-bearer/pkg/config/config.go index eb769e8be..a95532f1b 100644 --- a/extensions/auth-bearer/pkg/config/config.go +++ b/extensions/auth-bearer/pkg/config/config.go @@ -18,8 +18,9 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - OIDC OIDC `yaml:"oidc"` + SkipUserGroupsInToken bool `yaml:"-"` + + OIDC OIDC `yaml:"oidc"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/auth-machine/pkg/config/config.go b/extensions/auth-machine/pkg/config/config.go index 2479227df..1e79e1df4 100644 --- a/extensions/auth-machine/pkg/config/config.go +++ b/extensions/auth-machine/pkg/config/config.go @@ -18,8 +18,9 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;AUTH_MACHINE_API_KEY"` + SkipUserGroupsInToken bool `yaml:"-"` + + MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;AUTH_MACHINE_API_KEY"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/frontend/pkg/config/config.go b/extensions/frontend/pkg/config/config.go index 68bfe4cb1..b2968efde 100644 --- a/extensions/frontend/pkg/config/config.go +++ b/extensions/frontend/pkg/config/config.go @@ -23,19 +23,18 @@ type Config struct { Reva *Reva `yaml:"reva"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;FRONTEND_MACHINE_AUTH_API_KEY"` - SkipUserGroupsInToken bool `yaml:"skip_users_groups_in_token"` + SkipUserGroupsInToken bool `yaml:"-"` - EnableFavorites bool `yaml:"favorites"` + EnableFavorites bool `yaml:"enable_favorites" env:"FRONTEND_ENABLE_FAVORITES"` EnableProjectSpaces bool `yaml:"enable_project_spaces" env:"FRONTEND_ENABLE_PROJECT_SPACES" desc:"Indicates to clients that project spaces are supposed to be made available."` EnableShareJail bool `yaml:"enable_share_jail" env:"FRONTEND_ENABLE_SHARE_JAIL" desc:"Indicates to clients that the share jail is supposed to be used."` - UploadMaxChunkSize int `yaml:"upload_max_chunk_size"` - UploadHTTPMethodOverride string `yaml:"upload_http_method_override"` - DefaultUploadProtocol string `yaml:"default_upload_protocol"` + UploadMaxChunkSize int `yaml:"upload_max_chunk_size" env:"FRONTEND_UPLOAD_MAX_CHUNK_SIZE"` + UploadHTTPMethodOverride string `yaml:"upload_http_method_override" env:"FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE"` + DefaultUploadProtocol string `yaml:"default_upload_protocol" env:"FRONTEND_DEFAULT_UPLOAD_PROTOCOL"` PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL"` Archiver Archiver `yaml:"archiver"` - AppProvider AppProvider `yaml:"app_provider"` DataGateway DataGateway `yaml:"data_gateway"` OCS OCS `yaml:"ocs"` Checksums Checksums `yaml:"checksums"` @@ -52,7 +51,7 @@ type Tracing struct { Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;FRONTEND_TRACING_COLLECTOR"` } -type Logging struct { +type Log struct { Level string `yaml:"level" env:"OCIS_LOG_LEVEL;FRONTEND_LOG_LEVEL" desc:"The log level."` Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;FRONTEND_LOG_PRETTY" desc:"Activates pretty log output."` Color bool `yaml:"color" env:"OCIS_LOG_COLOR;FRONTEND_LOG_COLOR" desc:"Activates colorized log output."` @@ -71,9 +70,10 @@ type Debug struct { } type HTTPConfig struct { - Addr string `yaml:"addr" env:"FRONTEND_HTTP_ADDR" desc:"The address of the http service."` - Protocol string `yaml:"protocol" env:"FRONTEND_HTTP_PROTOCOL" desc:"The transport protocol of the http service."` - Prefix string `yaml:"prefix"` + Addr string `yaml:"addr" env:"FRONTEND_HTTP_ADDR" desc:"The address of the http service."` + Namespace string `yaml:"-"` + Protocol string `yaml:"protocol" env:"FRONTEND_HTTP_PROTOCOL" desc:"The transport protocol of the http service."` + Prefix string `yaml:"prefix" env:"FRONTEND_HTTP_PREFIX"` } // Middleware configures reva middlewares. @@ -87,51 +87,40 @@ type Auth struct { } type Archiver struct { - MaxNumFiles int64 `yaml:"max_num_files"` - MaxSize int64 `yaml:"max_size"` + MaxNumFiles int64 `yaml:"max_num_files" env:"FRONTEND_ARCHIVER_MAX_NUM_FILES"` + MaxSize int64 `yaml:"max_size" env:"FRONTEND_ARCHIVER_MAX_SIZE"` Prefix string `yaml:"-"` Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;FRONTEND_ARCHIVER_INSECURE"` } -type AppProvider struct { - ExternalAddr string `yaml:"external_addr"` - Driver string `yaml:"driver"` - // WopiDriver WopiDriver `yaml:"wopi_driver"` - AppsURL string `yaml:"-"` - OpenURL string `yaml:"-"` - NewURL string `yaml:"-"` - Prefix string `yaml:"-"` - Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;FRONTEND_APPPROVIDER_INSECURE"` -} - type DataGateway struct { - Prefix string + Prefix string `yaml:"prefix" env:"FRONTEND_DATA_GATEWAY_PREFIX"` } type OCS struct { - Prefix string `yaml:"prefix"` - SharePrefix string `yaml:"share_prefix"` - HomeNamespace string `yaml:"home_namespace"` - AdditionalInfoAttribute string `yaml:"additional_info_attribute"` - ResourceInfoCacheTTL int `yaml:"resource_info_cache_ttl"` - CacheWarmupDriver string `yaml:"cache_warmup_driver"` - CacheWarmupDrivers CacheWarmupDrivers + Prefix string `yaml:"prefix" env:"FRONTEND_OCS_PREFIX"` + SharePrefix string `yaml:"share_prefix" env:"FRONTEND_OCS_SHARE_PREFIX"` + HomeNamespace string `yaml:"home_namespace" env:"FRONTEND_OCS_HOME_NAMESPACE"` + AdditionalInfoAttribute string `yaml:"additional_info_attribute" env:"FRONTEND_OCS_ADDITIONAL_INFO_ATTRIBUTE"` + ResourceInfoCacheTTL int `yaml:"resource_info_cache_ttl" env:"FRONTEND_OCS_RESOURCE_INFO_CACHE_TTL"` + CacheWarmupDriver string `yaml:"cache_warmup_driver,omitempty"` // not supported by the oCIS product, therefore not part of docs + CacheWarmupDrivers CacheWarmupDrivers `yaml:"cache_warmup_drivers,omitempty"` // not supported by the oCIS product, therefore not part of docs } type CacheWarmupDrivers struct { - CBOX CBOXDriver + CBOX CBOXDriver `yaml:"cbox,omitempty"` } type CBOXDriver struct { - DBUsername string - DBPassword string - DBHost string - DBPort int - DBName string - Namespace string + DBUsername string `yaml:"db_username,omitempty"` + DBPassword string `yaml:"db_password,omitempty"` + DBHost string `yaml:"db_host,omitempty"` + DBPort int `yaml:"db_port,omitempty"` + DBName string `yaml:"db_name,omitempty"` + Namespace string `yaml:"namespace,omitempty"` } type Checksums struct { - SupportedTypes []string `yaml:"supported_types"` - PreferredUploadType string `yaml:"preferred_upload_type"` + SupportedTypes []string `yaml:"supported_types" env:"FRONTEND_CHECKSUMS_SUPPORTED_TYPES"` + PreferredUploadType string `yaml:"preferred_upload_type" env:"FRONTEND_CHECKSUMS_PREFERRED_UPLOAD_TYPES"` } diff --git a/extensions/frontend/pkg/config/defaults/defaultconfig.go b/extensions/frontend/pkg/config/defaults/defaultconfig.go index d9b05083c..eec799864 100644 --- a/extensions/frontend/pkg/config/defaults/defaultconfig.go +++ b/extensions/frontend/pkg/config/defaults/defaultconfig.go @@ -42,10 +42,6 @@ func DefaultConfig() *config.Config { SupportedTypes: []string{"sha1", "md5", "adler32"}, PreferredUploadType: "", }, - AppProvider: config.AppProvider{ - Prefix: "", - Insecure: false, - }, Archiver: config.Archiver{ Insecure: false, Prefix: "archiver", @@ -59,7 +55,6 @@ func DefaultConfig() *config.Config { Prefix: "ocs", SharePrefix: "/Shares", HomeNamespace: "/users/{{.Id.OpaqueId}}", - CacheWarmupDriver: "", AdditionalInfoAttribute: "{{.Mail}}", ResourceInfoCacheTTL: 0, }, diff --git a/extensions/gateway/pkg/config/config.go b/extensions/gateway/pkg/config/config.go index 285c9793c..02417ffea 100644 --- a/extensions/gateway/pkg/config/config.go +++ b/extensions/gateway/pkg/config/config.go @@ -19,7 +19,7 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool + SkipUserGroupsInToken bool `yaml:"-"` CommitShareToStorageGrant bool `yaml:"commit_share_to_storage_grant"` CommitShareToStorageRef bool `yaml:"commit_share_to_storage_ref"` diff --git a/extensions/group/pkg/config/config.go b/extensions/group/pkg/config/config.go index fc718d654..22cd62c98 100644 --- a/extensions/group/pkg/config/config.go +++ b/extensions/group/pkg/config/config.go @@ -18,7 +18,8 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` + SkipUserGroupsInToken bool `yaml:"-"` + GroupMembersCacheExpiration int `yaml:"group_members_cache_expiration"` Driver string `yaml:"driver"` Drivers Drivers `yaml:"drivers"` diff --git a/extensions/ocdav/pkg/config/config.go b/extensions/ocdav/pkg/config/config.go index 2ed551fe6..e68e1eb5a 100644 --- a/extensions/ocdav/pkg/config/config.go +++ b/extensions/ocdav/pkg/config/config.go @@ -18,7 +18,7 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` + SkipUserGroupsInToken bool `yaml:"-"` WebdavNamespace string `yaml:"webdav_namespace"` FilesNamespace string `yaml:"files_namespace"` diff --git a/extensions/sharing/pkg/config/config.go b/extensions/sharing/pkg/config/config.go index 24dc40c98..c3c0060f4 100644 --- a/extensions/sharing/pkg/config/config.go +++ b/extensions/sharing/pkg/config/config.go @@ -18,12 +18,13 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - UserSharingDriver string `yaml:"user_sharing_driver"` - UserSharingDrivers UserSharingDrivers `yaml:"user_sharin_drivers"` - PublicSharingDriver string `yaml:"public_sharing_driver"` - PublicSharingDrivers PublicSharingDrivers `yaml:"public_sharing_drivers"` - Events Events `yaml:"events"` + SkipUserGroupsInToken bool `yaml:"-"` + + UserSharingDriver string `yaml:"user_sharing_driver"` + UserSharingDrivers UserSharingDrivers `yaml:"user_sharin_drivers"` + PublicSharingDriver string `yaml:"public_sharing_driver"` + PublicSharingDrivers PublicSharingDrivers `yaml:"public_sharing_drivers"` + Events Events `yaml:"events"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/storage-metadata/pkg/config/config.go b/extensions/storage-metadata/pkg/config/config.go index 8f9017299..9a327cd18 100644 --- a/extensions/storage-metadata/pkg/config/config.go +++ b/extensions/storage-metadata/pkg/config/config.go @@ -21,12 +21,13 @@ type Config struct { MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"STORAGE_METADATA_MACHINE_AUTH_API_KEY"` MetadataUserID string `yaml:"metadata_user_id"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - Driver string `yaml:"driver" env:"STORAGE_METADATA_DRIVER" desc:"The driver which should be used by the service"` - Drivers Drivers `yaml:"drivers"` - DataServerURL string `yaml:"data_server_url"` - TempFolder string `yaml:"temp_folder"` - DataProviderInsecure bool `yaml:"data_provider_insecure" env:"OCIS_INSECURE;STORAGE_METADATA_DATAPROVIDER_INSECURE"` + SkipUserGroupsInToken bool `yaml:"-"` + + Driver string `yaml:"driver" env:"STORAGE_METADATA_DRIVER" desc:"The driver which should be used by the service"` + Drivers Drivers `yaml:"drivers"` + DataServerURL string `yaml:"data_server_url"` + TempFolder string `yaml:"temp_folder"` + DataProviderInsecure bool `yaml:"data_provider_insecure" env:"OCIS_INSECURE;STORAGE_METADATA_DATAPROVIDER_INSECURE"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/storage-publiclink/pkg/config/config.go b/extensions/storage-publiclink/pkg/config/config.go index e3cf134ab..9dc63e4bf 100644 --- a/extensions/storage-publiclink/pkg/config/config.go +++ b/extensions/storage-publiclink/pkg/config/config.go @@ -18,9 +18,10 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - AuthProvider AuthProvider `yaml:"auth_provider"` - StorageProvider StorageProvider `yaml:"storage_provider"` + SkipUserGroupsInToken bool `yaml:"-"` + + AuthProvider AuthProvider `yaml:"auth_provider"` + StorageProvider StorageProvider `yaml:"storage_provider"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/storage-shares/pkg/config/config.go b/extensions/storage-shares/pkg/config/config.go index ac68d6e9e..b3c9f908a 100644 --- a/extensions/storage-shares/pkg/config/config.go +++ b/extensions/storage-shares/pkg/config/config.go @@ -18,7 +18,8 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` + SkipUserGroupsInToken bool `yaml:"-"` + ReadOnly bool `yaml:"readonly"` SharesProviderEndpoint string `yaml:"shares_provider_endpoint"` diff --git a/extensions/storage-users/pkg/config/config.go b/extensions/storage-users/pkg/config/config.go index 732bc70c0..4b4c6dc30 100644 --- a/extensions/storage-users/pkg/config/config.go +++ b/extensions/storage-users/pkg/config/config.go @@ -19,16 +19,17 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - Driver string `yaml:"driver" env:"STORAGE_USERS_DRIVER" desc:"The storage driver which should be used by the service"` - Drivers Drivers `yaml:"drivers"` - DataServerURL string `yaml:"data_server_url"` - TempFolder string `yaml:"temp_folder"` - DataProviderInsecure bool `yaml:"data_provider_insecure" env:"OCIS_INSECURE;STORAGE_USERS_DATAPROVIDER_INSECURE"` - Events Events `yaml:"events"` - MountID string `yaml:"mount_id"` - ExposeDataServer bool `yaml:"expose_data_server"` - ReadOnly bool `yaml:"readonly"` + SkipUserGroupsInToken bool `yaml:"-"` + + Driver string `yaml:"driver" env:"STORAGE_USERS_DRIVER" desc:"The storage driver which should be used by the service"` + Drivers Drivers `yaml:"drivers"` + DataServerURL string `yaml:"data_server_url"` + TempFolder string `yaml:"temp_folder"` + DataProviderInsecure bool `yaml:"data_provider_insecure" env:"OCIS_INSECURE;STORAGE_USERS_DATAPROVIDER_INSECURE"` + Events Events `yaml:"events"` + MountID string `yaml:"mount_id"` + ExposeDataServer bool `yaml:"expose_data_server"` + ReadOnly bool `yaml:"readonly"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/extensions/user/pkg/config/config.go b/extensions/user/pkg/config/config.go index 7471b751b..bb304c83c 100644 --- a/extensions/user/pkg/config/config.go +++ b/extensions/user/pkg/config/config.go @@ -18,10 +18,11 @@ type Config struct { TokenManager *TokenManager `yaml:"token_manager"` Reva *Reva `yaml:"reva"` - SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token"` - UsersCacheExpiration int `yaml:"users_cache_expiration"` - Driver string `yaml:"driver"` - Drivers Drivers `yaml:"drivers"` + SkipUserGroupsInToken bool `yaml:"-"` + + UsersCacheExpiration int `yaml:"users_cache_expiration"` + Driver string `yaml:"driver"` + Drivers Drivers `yaml:"drivers"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"`