config

package
v1.1.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncPropagatorOptions

type AsyncPropagatorOptions struct {
	PropagationDelay time.Duration `` /* 325-byte string literal not displayed */
}

AsyncPropagatorOptions configures the async propagator

type CORS

type CORS struct {
	AllowedOrigins   []string `` /* 373-byte string literal not displayed */
	AllowedMethods   []string `` /* 377-byte string literal not displayed */
	AllowedHeaders   []string `` /* 379-byte string literal not displayed */
	AllowCredentials bool     `` /* 325-byte string literal not displayed */
	ExposedHeaders   []string `` /* 380-byte string literal not displayed */
	MaxAge           uint     `` /* 358-byte string literal not displayed */
}

CORS defines the available cors configuration.

type Config

type Config struct {
	Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
	Service Service         `yaml:"-"`
	Tracing *Tracing        `yaml:"tracing"`
	Log     *Log            `yaml:"log"`
	Debug   Debug           `yaml:"debug"`

	GRPC GRPCConfig `yaml:"grpc"`
	HTTP HTTPConfig `yaml:"http"`

	TokenManager *TokenManager `yaml:"token_manager"`
	Reva         *shared.Reva  `yaml:"reva"`

	SkipUserGroupsInToken   bool `` /* 190-byte string literal not displayed */
	GracefulShutdownTimeout int  `` /* 389-byte string literal not displayed */

	Driver         string  `` /* 581-byte string literal not displayed */
	Drivers        Drivers `yaml:"drivers"`
	DataServerURL  string  `` /* 225-byte string literal not displayed */
	DataGatewayURL string  `` /* 126-byte string literal not displayed */

	TransferExpires   int64             `` /* 160-byte string literal not displayed */
	Events            Events            `yaml:"events"`
	FilemetadataCache FilemetadataCache `yaml:"filemetadata_cache"`
	IDCache           IDCache           `yaml:"id_cache"`
	MountID           string            `yaml:"mount_id" env:"STORAGE_USERS_MOUNT_ID" desc:"Mount ID of this storage." introductionVersion:"1.0.0"`
	ExposeDataServer  bool              `` /* 231-byte string literal not displayed */
	ReadOnly          bool              `yaml:"readonly" env:"STORAGE_USERS_READ_ONLY" desc:"Set this storage to be read-only." introductionVersion:"1.0.0"`
	UploadExpiration  int64             `` /* 277-byte string literal not displayed */
	Tasks             Tasks             `yaml:"tasks"`
	ServiceAccount    ServiceAccount    `yaml:"service_account"`

	// CLI
	RevaGatewayGRPCAddr      string `` /* 159-byte string literal not displayed */
	MachineAuthAPIKey        string `` /* 242-byte string literal not displayed */
	CliMaxAttemptsRenameFile int    `` /* 264-byte string literal not displayed */

	Context context.Context `yaml:"-"`
}

Config is the configuration for the storage-users service

type Debug

type Debug struct {
	Addr   string `` /* 178-byte string literal not displayed */
	Token  string `yaml:"token" env:"STORAGE_USERS_DEBUG_TOKEN" desc:"Token to secure the metrics endpoint." introductionVersion:"1.0.0"`
	Pprof  bool   `` /* 127-byte string literal not displayed */
	Zpages bool   `` /* 160-byte string literal not displayed */
}

Debug is the configuration for the debug server

type DecomposedDriver

type DecomposedDriver struct {
	Propagator             string                 `` /* 254-byte string literal not displayed */
	AsyncPropagatorOptions AsyncPropagatorOptions `yaml:"async_propagator_options"`
	// Root is the absolute path to the location of the data
	Root                string `` /* 238-byte string literal not displayed */
	UserLayout          string `` /* 163-byte string literal not displayed */
	PermissionsEndpoint string `` /* 247-byte string literal not displayed */
	// PersonalSpaceAliasTemplate  contains the template used to construct
	// the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"`
	PersonalSpaceAliasTemplate string `` /* 183-byte string literal not displayed */
	PersonalSpacePathTemplate  string `` /* 196-byte string literal not displayed */
	// GeneralSpaceAliasTemplate contains the template used to construct
	// the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}`
	GeneralSpaceAliasTemplate string `` /* 180-byte string literal not displayed */
	GeneralSpacePathTemplate  string `` /* 194-byte string literal not displayed */
	// ShareFolder defines the name of the folder jailing all shares
	ShareFolder             string `` /* 137-byte string literal not displayed */
	MaxAcquireLockCycles    int    `` /* 358-byte string literal not displayed */
	LockCycleDurationFactor int    `` /* 314-byte string literal not displayed */
	MaxConcurrency          int    `` /* 334-byte string literal not displayed */
	AsyncUploads            bool   `yaml:"async_uploads" env:"OC_ASYNC_UPLOADS" desc:"Enable asynchronous file uploads." introductionVersion:"1.0.0"`
	MaxQuota                uint64 `` /* 296-byte string literal not displayed */
	DisableVersioning       bool   `` /* 236-byte string literal not displayed */
}

DecomposedDriver is the storage driver configuration when using 'decomposed' storage driver

type DecomposedS3Driver

type DecomposedS3Driver struct {
	Propagator             string                 `` /* 256-byte string literal not displayed */
	AsyncPropagatorOptions AsyncPropagatorOptions `yaml:"async_propagator_options"`
	// Root is the absolute path to the location of the data
	Root                  string `` /* 240-byte string literal not displayed */
	UserLayout            string `` /* 165-byte string literal not displayed */
	PermissionsEndpoint   string `` /* 249-byte string literal not displayed */
	Region                string `yaml:"region" env:"STORAGE_USERS_DECOMPOSEDS3_REGION" desc:"Region of the S3 bucket." introductionVersion:"1.0.0"`
	AccessKey             string `` /* 126-byte string literal not displayed */
	SecretKey             string `` /* 126-byte string literal not displayed */
	Endpoint              string `yaml:"endpoint" env:"STORAGE_USERS_DECOMPOSEDS3_ENDPOINT" desc:"Endpoint for the S3 bucket." introductionVersion:"1.0.0"`
	Bucket                string `yaml:"bucket" env:"STORAGE_USERS_DECOMPOSEDS3_BUCKET" desc:"Name of the S3 bucket." introductionVersion:"1.0.0"`
	DisableContentSha256  bool   `` /* 201-byte string literal not displayed */
	DisableMultipart      bool   `` /* 185-byte string literal not displayed */
	SendContentMd5        bool   `` /* 184-byte string literal not displayed */
	ConcurrentStreamParts bool   `` /* 195-byte string literal not displayed */
	NumThreads            uint   `` /* 184-byte string literal not displayed */
	PartSize              uint64 `` /* 266-byte string literal not displayed */
	// PersonalSpaceAliasTemplate  contains the template used to construct
	// the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"`
	PersonalSpaceAliasTemplate string `` /* 185-byte string literal not displayed */
	PersonalSpacePathTemplate  string `` /* 198-byte string literal not displayed */
	// GeneralSpaceAliasTemplate contains the template used to construct
	// the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}`
	GeneralSpaceAliasTemplate string `` /* 182-byte string literal not displayed */
	GeneralSpacePathTemplate  string `` /* 196-byte string literal not displayed */
	// ShareFolder defines the name of the folder jailing all shares
	ShareFolder             string `` /* 139-byte string literal not displayed */
	MaxAcquireLockCycles    int    `` /* 366-byte string literal not displayed */
	LockCycleDurationFactor int    `` /* 322-byte string literal not displayed */
	MaxConcurrency          int    `` /* 343-byte string literal not displayed */
	AsyncUploads            bool   `yaml:"async_uploads" env:"OC_ASYNC_UPLOADS" desc:"Enable asynchronous file uploads." introductionVersion:"1.0.0"`
	DisableVersioning       bool   `` /* 236-byte string literal not displayed */
}

DecomposedS3Driver is the storage driver configuration when using 'decomposeds3' storage driver

type Drivers

type Drivers struct {
	Decomposed   DecomposedDriver   `yaml:"decomposed"`
	DecomposedS3 DecomposedS3Driver `yaml:"decomposeds3"`
	OwnCloudSQL  OwnCloudSQLDriver  `yaml:"owncloudsql"`
	Posix        PosixDriver        `yaml:"posix"`

	S3    S3Driver    `yaml:",omitempty"` // not supported by the OpenCloud product, therefore not part of docs
	EOS   EOSDriver   `yaml:",omitempty"` // not supported by the OpenCloud product, therefore not part of docs
	Local LocalDriver `yaml:",omitempty"` // not supported by the OpenCloud product, therefore not part of docs
}

Drivers combine all storage driver configurations

type EOSDriver

type EOSDriver struct {
	// Root is the absolute path to the location of the data
	Root string `yaml:"root"`
	// ShadowNamespace for storing shadow data
	ShadowNamespace string `yaml:"shadow_namespace"`
	// UploadsNamespace for storing upload data
	UploadsNamespace string `yaml:"uploads_namespace"`
	// Location of the eos binary.
	// Default is /usr/bin/eos.
	EosBinary string `yaml:"eos_binary"`
	// Location of the xrdcopy binary.
	// Default is /usr/bin/xrdcopy.
	XrdcopyBinary string `yaml:"xrd_copy_binary"`
	// URL of the Master EOS MGM.
	// Default is root://eos-example.org
	MasterURL string `yaml:"master_url"`
	// URL of the Slave EOS MGM.
	// Default is root://eos-example.org
	SlaveURL string `yaml:"slave_url"`
	// Location on the local fs where to store reads.
	// Defaults to os.TempDir()
	CacheDirectory string `yaml:"cache_directory"`
	// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
	SecProtocol string `yaml:"sec_protocol"`
	// Keytab specifies the location of the keytab to use to authenticate to EOS.
	Keytab string `yaml:"keytab"`
	// SingleUsername is the username to use when SingleUserMode is enabled
	SingleUsername string `yaml:"single_username"`
	// Enables logging of the commands executed
	// Defaults to false
	EnableLogging bool `yaml:"enable_logging"`
	// ShowHiddenSysFiles shows internal EOS files like
	// .sys.v# and .sys.a# files.
	ShowHiddenSysFiles bool `yaml:"shadow_hidden_files"`
	// ForceSingleUserMode will force connections to EOS to use SingleUsername
	ForceSingleUserMode bool `yaml:"force_single_user_mode"`
	// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
	UseKeytab bool `yaml:"user_keytab"`
	// gateway service to use for uid lookups
	GatewaySVC string `yaml:"gateway_svc"`
	// ShareFolder defines the name of the folder jailing all shares
	ShareFolder string `yaml:"share_folder"`
	GRPCURI     string
	UserLayout  string
}

EOSDriver is the storage driver configuration when using 'eos' storage driver

type Events

type Events struct {
	Addr              string `` /* 251-byte string literal not displayed */
	ClusterID         string `` /* 293-byte string literal not displayed */
	TLSInsecure       bool   `` /* 153-byte string literal not displayed */
	TLSRootCaCertPath string `` /* 288-byte string literal not displayed */
	EnableTLS         bool   `` /* 263-byte string literal not displayed */
	NumConsumers      int    `` /* 396-byte string literal not displayed */
	AuthUsername      string `` /* 268-byte string literal not displayed */
	AuthPassword      string `` /* 268-byte string literal not displayed */
}

Events combines the configuration options for the event bus.

type FilemetadataCache

type FilemetadataCache struct {
	Store              string        `` /* 246-byte string literal not displayed */
	Nodes              []string      `` /* 382-byte string literal not displayed */
	Database           string        `yaml:"database" env:"OC_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"`
	TTL                time.Duration `` /* 276-byte string literal not displayed */
	DisablePersistence bool          `` /* 260-byte string literal not displayed */
	AuthUsername       string        `` /* 234-byte string literal not displayed */
	AuthPassword       string        `` /* 234-byte string literal not displayed */
}

FilemetadataCache holds cache config

type GRPCConfig

type GRPCConfig struct {
	Addr      string                 `yaml:"addr" env:"STORAGE_USERS_GRPC_ADDR" desc:"The bind address of the GRPC service." introductionVersion:"1.0.0"`
	TLS       *shared.GRPCServiceTLS `yaml:"tls"`
	Namespace string                 `yaml:"-"`
	Protocol  string                 `` /* 145-byte string literal not displayed */
}

GRPCConfig is the configuration for the grpc server

type HTTPConfig

type HTTPConfig struct {
	Addr      string `yaml:"addr" env:"STORAGE_USERS_HTTP_ADDR" desc:"The bind address of the HTTP service." introductionVersion:"1.0.0"`
	Namespace string `yaml:"-"`
	Protocol  string `` /* 128-byte string literal not displayed */
	Prefix    string
	CORS      CORS `yaml:"cors"`
}

HTTPConfig is the configuration for the http server

type IDCache

type IDCache struct {
	Store              string        `` /* 236-byte string literal not displayed */
	Nodes              []string      `` /* 372-byte string literal not displayed */
	Database           string        `yaml:"database" env:"OC_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"`
	TTL                time.Duration `` /* 368-byte string literal not displayed */
	DisablePersistence bool          `` /* 250-byte string literal not displayed */
	AuthUsername       string        `` /* 224-byte string literal not displayed */
	AuthPassword       string        `` /* 224-byte string literal not displayed */
}

IDCache holds cache config

type LocalDriver

type LocalDriver struct {
	// Root is the absolute path to the location of the data
	Root string `yaml:"root"`
	// ShareFolder defines the name of the folder jailing all shares
	ShareFolder string `yaml:"share_folder"`
	UserLayout  string `yaml:"user_layout"`
}

LocalDriver is the storage driver configuration when using 'local' storage driver

type Log

type Log struct {
	Level  string `` /* 184-byte string literal not displayed */
	Pretty bool   `yaml:"pretty" env:"OC_LOG_PRETTY;STORAGE_USERS_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
	Color  bool   `yaml:"color" env:"OC_LOG_COLOR;STORAGE_USERS_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
	File   string `` /* 152-byte string literal not displayed */
}

Log configures the logging

type OwnCloudSQLDriver

type OwnCloudSQLDriver struct {
	// Root is the absolute path to the location of the data
	Root string `` /* 245-byte string literal not displayed */
	// ShareFolder defines the name of the folder jailing all shares
	ShareFolder           string `` /* 138-byte string literal not displayed */
	UserLayout            string `` /* 173-byte string literal not displayed */
	UploadInfoDir         string `` /* 258-byte string literal not displayed */
	DBUsername            string `yaml:"db_username" env:"STORAGE_USERS_OWNCLOUDSQL_DB_USERNAME" desc:"Username for the database." introductionVersion:"1.0.0"`
	DBPassword            string `yaml:"db_password" env:"STORAGE_USERS_OWNCLOUDSQL_DB_PASSWORD" desc:"Password for the database." introductionVersion:"1.0.0"`
	DBHost                string `` /* 128-byte string literal not displayed */
	DBPort                int    `` /* 136-byte string literal not displayed */
	DBName                string `yaml:"db_name" env:"STORAGE_USERS_OWNCLOUDSQL_DB_NAME" desc:"Name of the database to be used." introductionVersion:"1.0.0"`
	UsersProviderEndpoint string `` /* 153-byte string literal not displayed */
}

OwnCloudSQLDriver is the storage driver configuration when using 'owncloudsql' storage driver

type PosixDriver

type PosixDriver struct {
	// Root is the absolute path to the location of the data
	Root                       string        `` /* 223-byte string literal not displayed */
	PersonalSpaceAliasTemplate string        `` /* 178-byte string literal not displayed */
	PersonalSpacePathTemplate  string        `` /* 191-byte string literal not displayed */
	GeneralSpaceAliasTemplate  string        `` /* 175-byte string literal not displayed */
	GeneralSpacePathTemplate   string        `` /* 189-byte string literal not displayed */
	PermissionsEndpoint        string        `` /* 251-byte string literal not displayed */
	AsyncUploads               bool          `yaml:"async_uploads" env:"OC_ASYNC_UPLOADS" desc:"Enable asynchronous file uploads." introductionVersion:"1.0.0"`
	ScanDebounceDelay          time.Duration `` /* 217-byte string literal not displayed */

	UseSpaceGroups bool `` /* 151-byte string literal not displayed */

	EnableFSRevisions bool `` /* 317-byte string literal not displayed */

	WatchFS                 bool   `` /* 238-byte string literal not displayed */
	WatchType               string `` /* 273-byte string literal not displayed */
	WatchPath               string `` /* 274-byte string literal not displayed */
	WatchFolderKafkaBrokers string `` /* 194-byte string literal not displayed */
}

PosixDriver is the storage driver configuration when using 'posix' storage driver

type PurgeTrashBin

type PurgeTrashBin struct {
	UserID               string        `` /* 313-byte string literal not displayed */
	PersonalDeleteBefore time.Duration `` /* 361-byte string literal not displayed */
	ProjectDeleteBefore  time.Duration `` /* 358-byte string literal not displayed */
}

PurgeTrashBin contains all necessary configurations to clean up the respective trash cans

type S3Driver

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"`
}

S3Driver is the storage driver configuration when using 's3' storage driver

type Service

type Service struct {
	Name string `` /* 253-byte string literal not displayed */
}

Service holds general service configuration

type ServiceAccount

type ServiceAccount struct {
	ServiceAccountID     string `` /* 236-byte string literal not displayed */
	ServiceAccountSecret string `` /* 161-byte string literal not displayed */
}

ServiceAccount is the configuration for the used service account

type Tasks

type Tasks struct {
	PurgeTrashBin PurgeTrashBin `yaml:"purge_trash_bin"`
}

Tasks wraps task configurations

type TokenManager

type TokenManager struct {
	JWTSecret string `` /* 141-byte string literal not displayed */
}

TokenManager is the config for using the reva token manager

type Tracing

type Tracing struct {
	Enabled   bool   `yaml:"enabled" env:"OC_TRACING_ENABLED;STORAGE_USERS_TRACING_ENABLED" desc:"Activates tracing." introductionVersion:"1.0.0"`
	Type      string `` /* 216-byte string literal not displayed */
	Endpoint  string `` /* 142-byte string literal not displayed */
	Collector string `` /* 262-byte string literal not displayed */
}

Tracing configures the tracing

func (Tracing) Convert

func (t Tracing) Convert() tracing.Config

Convert Tracing to the tracing package's Config struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL