From fd44da4629e25fe86890fb35cf91f36f5d430d6d Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 3 May 2022 14:55:07 +0200 Subject: [PATCH] storage-users config docs --- extensions/audit/pkg/config/config.go | 6 +- extensions/graph/pkg/config/config.go | 4 +- extensions/notifications/pkg/config/config.go | 6 +- extensions/search/pkg/config/config.go | 6 +- extensions/sharing/pkg/config/config.go | 4 +- extensions/storage-users/pkg/config/config.go | 155 +++++++++--------- 6 files changed, 90 insertions(+), 91 deletions(-) diff --git a/extensions/audit/pkg/config/config.go b/extensions/audit/pkg/config/config.go index b14a78a75..6d2111289 100644 --- a/extensions/audit/pkg/config/config.go +++ b/extensions/audit/pkg/config/config.go @@ -23,9 +23,9 @@ type Config struct { // Events combines the configuration options for the event bus. type Events struct { - Endpoint string `yaml:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"` - Cluster string `yaml:"events_cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` - ConsumerGroup string `yaml:"events_group" env:"AUDIT_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one vopy of an event"` + Endpoint string `yaml:"endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"` + Cluster string `yaml:"cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` + ConsumerGroup string `yaml:"group" env:"AUDIT_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one copy of an event"` } // Auditlog holds audit log information diff --git a/extensions/graph/pkg/config/config.go b/extensions/graph/pkg/config/config.go index d147eaa30..c109a402c 100644 --- a/extensions/graph/pkg/config/config.go +++ b/extensions/graph/pkg/config/config.go @@ -68,6 +68,6 @@ type Identity struct { // Events combines the configuration options for the event bus. type Events struct { - Endpoint string `yaml:"events_endpoint" env:"GRAPH_EVENTS_ENDPOINT" desc:"the address of the streaming service"` - Cluster string `yaml:"events_cluster" env:"GRAPH_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` + Endpoint string `yaml:"endpoint" env:"GRAPH_EVENTS_ENDPOINT" desc:"the address of the streaming service"` + Cluster string `yaml:"cluster" env:"GRAPH_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` } diff --git a/extensions/notifications/pkg/config/config.go b/extensions/notifications/pkg/config/config.go index 36ff2e6c8..dc49e46cc 100644 --- a/extensions/notifications/pkg/config/config.go +++ b/extensions/notifications/pkg/config/config.go @@ -39,7 +39,7 @@ type SMTP struct { // Events combines the configuration options for the event bus. type Events struct { - Endpoint string `yaml:"events_endpoint" env:"NOTIFICATIONS_EVENTS_ENDPOINT"` - Cluster string `yaml:"events_cluster" env:"NOTIFICATIONS_EVENTS_CLUSTER"` - ConsumerGroup string `yaml:"events_group" env:"NOTIFICATIONS_EVENTS_GROUP"` + Endpoint string `yaml:"endpoint" env:"NOTIFICATIONS_EVENTS_ENDPOINT"` + Cluster string `yaml:"cluster" env:"NOTIFICATIONS_EVENTS_CLUSTER"` + ConsumerGroup string `yaml:"group" env:"NOTIFICATIONS_EVENTS_GROUP"` } diff --git a/extensions/search/pkg/config/config.go b/extensions/search/pkg/config/config.go index 7c7ac33ff..b1396872e 100644 --- a/extensions/search/pkg/config/config.go +++ b/extensions/search/pkg/config/config.go @@ -29,7 +29,7 @@ type Config struct { // Events combines the configuration options for the event bus. type Events struct { - Endpoint string `yaml:"events_endpoint" env:"SEARCH_EVENTS_ENDPOINT" desc:"the address of the streaming service"` - Cluster string `yaml:"events_cluster" env:"SEARCH_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` - ConsumerGroup string `yaml:"events_group" env:"SEARCH_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one copy of an event"` + Endpoint string `yaml:"endpoint" env:"SEARCH_EVENTS_ENDPOINT" desc:"the address of the streaming service"` + Cluster string `yaml:"cluster" env:"SEARCH_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` + ConsumerGroup string `yaml:"group" env:"SEARCH_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one copy of an event"` } diff --git a/extensions/sharing/pkg/config/config.go b/extensions/sharing/pkg/config/config.go index 149b91f07..430354daa 100644 --- a/extensions/sharing/pkg/config/config.go +++ b/extensions/sharing/pkg/config/config.go @@ -119,6 +119,6 @@ type PublicSharingCS3Driver struct { } type Events struct { - Addr string `yaml:"addr" env:"SHARING_EVENTS_ADDR"` - ClusterID string `yaml:"cluster_id" env:"SHARING_EVENTS_CLUSTER_ID"` + Addr string `yaml:"endpoint" env:"SHARING_EVENTS_ENDPOINT" desc:"the address of the streaming service"` + ClusterID string `yaml:"cluster" env:"SHARING_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` } diff --git a/extensions/storage-users/pkg/config/config.go b/extensions/storage-users/pkg/config/config.go index 4b4c6dc30..7dd56e44e 100644 --- a/extensions/storage-users/pkg/config/config.go +++ b/extensions/storage-users/pkg/config/config.go @@ -23,13 +23,13 @@ type Config struct { 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"` + DataServerURL string `yaml:"data_server_url" env:"STORAGE_USERS_DATA_SERVER_URL"` + TempFolder string `yaml:"temp_folder" env:"STORAGE_USERS_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"` + MountID string `yaml:"mount_id" env:"STORAGE_USERS_MOUNT_ID"` + ExposeDataServer bool `yaml:"expose_data_server" env:"STORAGE_USERS_EXPOSE_DATA_SERVER"` + ReadOnly bool `yaml:"readonly" env:"STORAGE_USERS_READ_ONLY"` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` @@ -73,14 +73,78 @@ type HTTPConfig struct { } type Drivers struct { - EOS EOSDriver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs - Local LocalDriver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs - OCIS OCISDriver - S3 S3Driver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs - S3NG S3NGDriver - OwnCloudSQL OwnCloudSQLDriver + OCIS OCISDriver `yaml:"ocis"` + S3NG S3NGDriver `yaml:"s3ng"` + OwnCloudSQL OwnCloudSQLDriver `yaml:"owncloud_sql"` + + S3 S3Driver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs + EOS EOSDriver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs + Local LocalDriver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs } +type OCISDriver struct { + // Root is the absolute path to the location of the data + Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT"` + UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_OCIS_USER_LAYOUT"` + PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_OCIS_PERMISSIONS_ENDPOINT"` + // PersonalSpaceAliasTemplate contains the template used to construct + // the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"` + PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template" env:"STORAGE_USERS_OCIS_PERSONAL_SPACE_ALIAS_TEMPLATE"` + // GeneralSpaceAliasTemplate contains the template used to construct + // the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}` + GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template" env:"STORAGE_USERS_OCIS_GENERAL_SPACE_ALIAS_TEMPLATE"` + //ShareFolder defines the name of the folder jailing all shares + ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_OCIS_SHARE_FOLDER"` +} + +type S3NGDriver struct { + // Root is the absolute path to the location of the data + Root string `yaml:"root" env:"STORAGE_USERS_S3NG_ROOT"` + UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_S3NG_USER_LAYOUT"` + PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_S3NG_USERS_PROVIDER_ENDPOINT"` + Region string `yaml:"region" env:"STORAGE_USERS_S3NG_REGION"` + AccessKey string `yaml:"access_key" env:"STORAGE_USERS_S3NG_ACCESS_KEY"` + SecretKey string `yaml:"secret_key" env:"STORAGE_USERS_S3NG_SECRET_KEY"` + Endpoint string `yaml:"endpoint" env:"STORAGE_USERS_S3NG_ENDPOINT"` + Bucket string `yaml:"bucket" env:"STORAGE_USERS_S3NG_BUCKET"` + // PersonalSpaceAliasTemplate contains the template used to construct + // the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"` + PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template" env:"STORAGE_USERS_S3NG_PERSONAL_SPACE_ALIAS_TEMPLATE"` + // GeneralSpaceAliasTemplate contains the template used to construct + // the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}` + GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template" env:"STORAGE_USERS_S3NG_GENERAL_SPACE_ALIAS_TEMPLATE"` + //ShareFolder defines the name of the folder jailing all shares + ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_S3NG_SHARE_FOLDER"` +} + +type OwnCloudSQLDriver struct { + // Root is the absolute path to the location of the data + Root string `yaml:"root" env:"STORAGE_USERS_OWNCLOUDSQL_DATADIR"` + //ShareFolder defines the name of the folder jailing all shares + ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_OWNCLOUDSQL_SHARE_FOLDER"` + UserLayout string `env:"STORAGE_USERS_OWNCLOUDSQL_LAYOUT"` + UploadInfoDir string `yaml:"upload_info_dir" env:"STORAGE_USERS_UPLOADINFO_DIR"` + DBUsername string `yaml:"db_username" env:"STORAGE_USERS_OWNCLOUDSQL_DB_USERNAME"` + DBPassword string `yaml:"db_password" env:"STORAGE_USERS_OWNCLOUDSQL_DB_PASSWORD"` + DBHost string `yaml:"db_host" env:"STORAGE_USERS_OWNCLOUDSQL_DB_HOST"` + DBPort int `yaml:"db_port" env:"STORAGE_USERS_OWNCLOUDSQL_DB_PORT"` + DBName string `yaml:"db_name" env:"STORAGE_USERS_OWNCLOUDSQL_DB_NAME"` + UsersProviderEndpoint string `yaml:"users_provider_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_OWNCLOUDSQL_USERS_PROVIDER_ENDPOINT"` +} + +type Events struct { + Addr string `yaml:"endpoint" env:"STORAGE_USERS_EVENTS_ENDPOINT" desc:"the address of the streaming service"` + ClusterID string `yaml:"cluster" env:"STORAGE_USERS_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"` +} +type S3Driver struct { + // Root is the absolute path to the location of the data + Root string `yaml:"root"` + Region string `yaml:"region"` + AccessKey string `yaml:"access_key"` + SecretKey string `yaml:"secret_key"` + Endpoint string `yaml:"endpoint"` + Bucket string `yaml:"bucket"` +} type EOSDriver struct { // Root is the absolute path to the location of the data Root string `yaml:"root"` @@ -129,73 +193,8 @@ type EOSDriver struct { type LocalDriver struct { // Root is the absolute path to the location of the data - Root string `yaml:"root" env:"STORAGE_USERS_LOCAL_ROOT"` + Root string `yaml:"root"` //ShareFolder defines the name of the folder jailing all shares ShareFolder string `yaml:"share_folder"` - UserLayout string -} - -type OCISDriver struct { - // Root is the absolute path to the location of the data - Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT"` - UserLayout string - PermissionsEndpoint string - // PersonalSpaceAliasTemplate contains the template used to construct - // the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"` - PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template"` - // GeneralSpaceAliasTemplate contains the template used to construct - // the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}` - GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template"` - //ShareFolder defines the name of the folder jailing all shares - ShareFolder string `yaml:"share_folder"` -} - -type S3Driver struct { - // Root is the absolute path to the location of the data - Root string `yaml:"root"` - Region string `yaml:"region"` - AccessKey string `yaml:"access_key"` - SecretKey string `yaml:"secret_key"` - Endpoint string `yaml:"endpoint"` - Bucket string `yaml:"bucket"` -} - -type S3NGDriver struct { - // Root is the absolute path to the location of the data - Root string `yaml:"root"` - UserLayout string - PermissionsEndpoint string - Region string `yaml:"region"` - AccessKey string `yaml:"access_key"` - SecretKey string `yaml:"secret_key"` - Endpoint string `yaml:"endpoint"` - Bucket string `yaml:"bucket"` - // PersonalSpaceAliasTemplate contains the template used to construct - // the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"` - PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template"` - // GeneralSpaceAliasTemplate contains the template used to construct - // the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}` - GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template"` - //ShareFolder defines the name of the folder jailing all shares - ShareFolder string `yaml:"share_folder"` -} - -type OwnCloudSQLDriver struct { - // Root is the absolute path to the location of the data - Root string `yaml:"root" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DATADIR"` - //ShareFolder defines the name of the folder jailing all shares - ShareFolder string `yaml:"share_folder" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_SHARE_FOLDER"` - UserLayout string `env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_LAYOUT"` - UploadInfoDir string `yaml:"upload_info_dir" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_UPLOADINFO_DIR"` - DBUsername string `yaml:"db_username" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DBUSERNAME"` - DBPassword string `yaml:"db_password" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DBPASSWORD"` - DBHost string `yaml:"db_host" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DBHOST"` - DBPort int `yaml:"db_port" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DBPORT"` - DBName string `yaml:"db_name" env:"STORAGE_USERS_DRIVER_OWNCLOUDSQL_DBNAME"` - UsersProviderEndpoint string -} - -type Events struct { - Addr string - ClusterID string + UserLayout string `yaml:"user_layout"` }