config

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv added in v1.16.0

func GetEnv(cfg *Config) []string

GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list with all the environment variables an extension supports.

func StructMappings added in v1.16.0

func StructMappings(cfg *Config) []shared.EnvBinding

StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets us propagate changes easier.

Types

type AppProvider added in v1.12.0

type AppProvider struct {
	Port
	ExternalAddr string     `ocisConfig:"external_addr"`
	Driver       string     `ocisConfig:"driver"`
	WopiDriver   WopiDriver `ocisConfig:"wopi_driver"`
	AppsURL      string     `ocisConfig:"apps_url"`
	OpenURL      string     `ocisConfig:"open_url"`
	NewURL       string     `ocisConfig:"new_url"`
}

AppProvider defines the available app provider configuration

type AppRegistry added in v1.13.0

type AppRegistry struct {
	Driver        string `ocisConfig:"driver"`
	MimetypesJSON string `ocisConfig:"mime_types_json"`
}

AppRegistry defines the available app registry configuration

type Archiver added in v1.13.0

type Archiver struct {
	MaxNumFiles int64  `ocisConfig:"max_num_files"`
	MaxSize     int64  `ocisConfig:"max_size"`
	ArchiverURL string `ocisConfig:"archiver_url"`
}

Archiver defines the available archiver configuration.

type Asset

type Asset struct {
	Path string `ocisConfig:"path"`
}

Asset defines the available asset configuration.

type Auth

type Auth struct {
	CredentialsByUserAgent map[string]string `ocisConfig:"credentials_by_user_agenr"`
}

Auth configures reva http auth middleware.

type AuthMachineConfig added in v1.14.0

type AuthMachineConfig struct {
	MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"`
}

AuthMachineConfig defines the available configuration for the machine auth driver.

type Config

type Config struct {
	*shared.Commons

	File    string      `ocisConfig:"file"`
	Log     *shared.Log `ocisConfig:"log"`
	Debug   Debug       `ocisConfig:"debug"`
	Reva    Reva        `ocisConfig:"reva"`
	Tracing Tracing     `ocisConfig:"tracing"`
	Asset   Asset       `ocisConfig:"asset"`
}

Config combines all available configuration parts.

func New

func New() *Config

New initializes a new configuration with or without defaults.

type DataGatewayPort

type DataGatewayPort struct {
	Port
	PublicURL string `ocisConfig:""`
}

DataGatewayPort has a public url

type DataProvider added in v1.15.0

type DataProvider struct {
	Insecure bool `ocisConfig:"insecure"`
}

type Debug

type Debug struct {
	Addr   string `ocisConfig:"addr"`
	Token  string `ocisConfig:"token"`
	Pprof  bool   `ocisConfig:"pprof"`
	Zpages bool   `ocisConfig:"zpages"`
}

Debug defines the available debug configuration.

type DriverCommon

type DriverCommon struct {
	// Root is the absolute path to the location of the data
	Root string `ocisConfig:"root"`
	//ShareFolder defines the name of the folder jailing all shares
	ShareFolder string `ocisConfig:"share_folder"`
	// UserLayout contains the template used to construct
	// the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}`
	UserLayout string `ocisConfig:"user_layout"`
	// EnableHome enables the creation of home directories.
	EnableHome bool `ocisConfig:"enable_home"`
	// PersonalSpaceAliasTemplate  contains the template used to construct
	// the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"`
	PersonalSpaceAliasTemplate string `ocisConfig:"personalspacealias_template"`
	// GeneralSpaceAliasTemplate contains the template used to construct
	// the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}`
	GeneralSpaceAliasTemplate string `ocisConfig:"generalspacealias_template"`
}

DriverCommon defines common driver configuration options.

type DriverEOS

type DriverEOS struct {
	DriverCommon

	// ShadowNamespace for storing shadow data
	ShadowNamespace string `ocisConfig:"shadow_namespace"`

	// UploadsNamespace for storing upload data
	UploadsNamespace string `ocisConfig:"uploads_namespace"`

	// Location of the eos binary.
	// Default is /usr/bin/eos.
	EosBinary string `ocisConfig:"eos_binary"`

	// Location of the xrdcopy binary.
	// Default is /usr/bin/xrdcopy.
	XrdcopyBinary string `ocisConfig:"xrd_copy_binary"`

	// URL of the Master EOS MGM.
	// Default is root://eos-example.org
	MasterURL string `ocisConfig:"master_url"`

	// URI of the EOS MGM grpc server
	// Default is empty
	GrpcURI string `ocisConfig:"grpc_uri"`

	// URL of the Slave EOS MGM.
	// Default is root://eos-example.org
	SlaveURL string `ocisConfig:"slave_url"`

	// Location on the local fs where to store reads.
	// Defaults to os.TempDir()
	CacheDirectory string `ocisConfig:"cache_directory"`

	// Enables logging of the commands executed
	// Defaults to false
	EnableLogging bool `ocisConfig:"enable_logging"`

	// ShowHiddenSysFiles shows internal EOS files like
	// .sys.v# and .sys.a# files.
	ShowHiddenSysFiles bool `ocisConfig:"shadow_hidden_files"`

	// ForceSingleUserMode will force connections to EOS to use SingleUsername
	ForceSingleUserMode bool `ocisConfig:"force_single_user_mode"`

	// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
	UseKeytab bool `ocisConfig:"user_keytab"`

	// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
	SecProtocol string `ocisConfig:"sec_protocol"`

	// Keytab specifies the location of the keytab to use to authenticate to EOS.
	Keytab string `ocisConfig:"keytab"`

	// SingleUsername is the username to use when SingleUserMode is enabled
	SingleUsername string `ocisConfig:"single_username"`

	// gateway service to use for uid lookups
	GatewaySVC string `ocisConfig:"gateway_svc"`
}

DriverEOS defines the available EOS driver configuration.

type DriverOCIS

type DriverOCIS struct {
	DriverCommon
}

DriverOCIS defines the available oCIS storage driver configuration.

type DriverOwnCloudSQL

type DriverOwnCloudSQL struct {
	DriverCommon

	UploadInfoDir string `ocisConfig:"upload_info_dir"`
	DBUsername    string `ocisConfig:"db_username"`
	DBPassword    string `ocisConfig:"db_password"`
	DBHost        string `ocisConfig:"db_host"`
	DBPort        int    `ocisConfig:"db_port"`
	DBName        string `ocisConfig:"db_name"`
}

DriverOwnCloudSQL defines the available ownCloudSQL storage driver configuration.

type DriverS3

type DriverS3 struct {
	DriverCommon

	Region    string `ocisConfig:"region"`
	AccessKey string `ocisConfig:"access_key"`
	SecretKey string `ocisConfig:"secret_key"`
	Endpoint  string `ocisConfig:"endpoint"`
	Bucket    string `ocisConfig:"bucket"`
}

DriverS3 defines the available S3 storage driver configuration.

type DriverS3NG

type DriverS3NG struct {
	DriverCommon

	Region    string `ocisConfig:"region"`
	AccessKey string `ocisConfig:"access_key"`
	SecretKey string `ocisConfig:"secret_key"`
	Endpoint  string `ocisConfig:"endpoint"`
	Bucket    string `ocisConfig:"bucket"`
}

DriverS3NG defines the available s3ng storage driver configuration.

type Events added in v1.18.0

type Events struct {
	Address   string `ocisConfig:"address"`
	ClusterID string `ocisConfig:"cluster_id"`
}

type FrontendPort

type FrontendPort struct {
	Port

	AppProviderInsecure        bool       `ocisConfig:"app_provider_insecure"`
	AppProviderPrefix          string     `ocisConfig:"app_provider_prefix"`
	ArchiverInsecure           bool       `ocisConfig:"archiver_insecure"`
	ArchiverPrefix             string     `ocisConfig:"archiver_prefix"`
	DatagatewayPrefix          string     `ocisConfig:"data_gateway_prefix"`
	Favorites                  bool       `ocisConfig:"favorites"`
	ProjectSpaces              bool       `ocisConfig:"project_spaces"`
	OCDavInsecure              bool       `ocisConfig:"ocdav_insecure"`
	OCDavPrefix                string     `ocisConfig:"ocdav_prefix"`
	OCSPrefix                  string     `ocisConfig:"ocs_prefix"`
	OCSSharePrefix             string     `ocisConfig:"ocs_share_prefix"`
	OCSHomeNamespace           string     `ocisConfig:"ocs_home_namespace"`
	PublicURL                  string     `ocisConfig:"public_url"`
	OCSCacheWarmupDriver       string     `ocisConfig:"ocs_cache_warmup_driver"`
	OCSAdditionalInfoAttribute string     `ocisConfig:"ocs_additional_info_attribute"`
	OCSResourceInfoCacheTTL    int        `ocisConfig:"ocs_resource_info_cache_ttl"`
	Middleware                 Middleware `ocisConfig:"middleware"`
}

FrontendPort defines the available frontend configuration.

type Gateway

type Gateway struct {
	Port
	CommitShareToStorageGrant  bool   `ocisConfig:"commit_share_to_storage_grant"`
	CommitShareToStorageRef    bool   `ocisConfig:"commit_share_to_storage_ref"`
	DisableHomeCreationOnLogin bool   `ocisConfig:"disable_home_creation_on_login"`
	ShareFolder                string `ocisConfig:"share_folder"`
	LinkGrants                 string `ocisConfig:"link_grants"`
	HomeMapping                string `ocisConfig:"home_mapping"`
	EtagCacheTTL               int    `ocisConfig:"etag_cache_ttl"`
}

Gateway defines the available gateway configuration.

type Groups

type Groups struct {
	Port
	Driver                      string `ocisConfig:"driver"`
	JSON                        string `ocisConfig:"json"`
	GroupMembersCacheExpiration int    `ocisConfig:"group_members_cache_expiration"`
}

Groups defines the available groups configuration.

type LDAP

type LDAP struct {
	Hostname             string          `ocisConfig:"hostname"`
	Port                 int             `ocisConfig:"port"`
	CACert               string          `ocisConfig:"ca_cert"`
	Insecure             bool            `ocisConfig:"insecure"`
	BaseDN               string          `ocisConfig:"base_dn"`
	LoginFilter          string          `ocisConfig:"login_filter"`
	UserFilter           string          `ocisConfig:"user_filter"`
	UserAttributeFilter  string          `ocisConfig:"user_attribute_filter"`
	UserFindFilter       string          `ocisConfig:"user_find_filter"`
	UserGroupFilter      string          `ocisConfig:"user_group_filter"`
	GroupFilter          string          `ocisConfig:"group_filter"`
	GroupAttributeFilter string          `ocisConfig:"group_attribute_filter"`
	GroupFindFilter      string          `ocisConfig:"group_finder_filter"`
	GroupMemberFilter    string          `ocisConfig:"group_member_filter"`
	BindDN               string          `ocisConfig:"bind_dn"`
	BindPassword         string          `ocisConfig:"bind_password"`
	IDP                  string          `ocisConfig:"idp"`
	UserSchema           LDAPUserSchema  `ocisConfig:"user_schema"`
	GroupSchema          LDAPGroupSchema `ocisConfig:"group_schema"`
}

LDAP defines the available ldap configuration.

type LDAPGroupSchema

type LDAPGroupSchema struct {
	GID         string `ocisConfig:"gid"`
	Mail        string `ocisConfig:"mail"`
	DisplayName string `ocisConfig:"display_name"`
	CN          string `ocisConfig:"cn"`
	GIDNumber   string `ocisConfig:"gid_number"`
}

LDAPGroupSchema defines the available ldap group schema configuration.

type LDAPUserSchema

type LDAPUserSchema struct {
	UID         string `ocisConfig:"uid"`
	Mail        string `ocisConfig:"mail"`
	DisplayName string `ocisConfig:"display_name"`
	CN          string `ocisConfig:"cn"`
	UIDNumber   string `ocisConfig:"uid_number"`
	GIDNumber   string `ocisConfig:"gid_number"`
}

LDAPUserSchema defines the available ldap user schema configuration.

type Log

type Log struct {
	Level  string `ocisConfig:"level"`
	Pretty bool   `ocisConfig:"pretty"`
	Color  bool   `ocisConfig:"color"`
	File   string `ocisConfig:"file"`
}

Log defines the available logging configuration.

type Middleware

type Middleware struct {
	Auth Auth `ocisConfig:"auth"`
}

Middleware configures reva middlewares.

type OCDav

type OCDav struct {
	WebdavNamespace   string `ocisConfig:"webdav_namespace"`
	DavFilesNamespace string `ocisConfig:"dav_files_namespace"`
}

OCDav defines the available ocdav configuration.

type OIDC

type OIDC struct {
	Issuer   string `ocisConfig:"issuer"`
	Insecure bool   `ocisConfig:"insecure"`
	IDClaim  string `ocisConfig:"id_claim"`
	UIDClaim string `ocisConfig:"uid_claim"`
	GIDClaim string `ocisConfig:"gid_claim"`
}

OIDC defines the available OpenID Connect configuration.

type Port

type Port struct {
	// MaxCPUs can be a number or a percentage
	MaxCPUs  string `ocisConfig:"max_cpus"`
	LogLevel string `ocisConfig:"log_level"`
	// GRPCNetwork can be tcp, udp or unix
	GRPCNetwork string `ocisConfig:"grpc_network"`
	// GRPCAddr to listen on, hostname:port (0.0.0.0:9999 for all interfaces) or socket (/var/run/reva/sock)
	GRPCAddr string `ocisConfig:"grpc_addr"`
	// Protocol can be grpc or http
	// HTTPNetwork can be tcp, udp or unix
	HTTPNetwork string `ocisConfig:"http_network"`
	// HTTPAddr to listen on, hostname:port (0.0.0.0:9100 for all interfaces) or socket (/var/run/reva/sock)
	HTTPAddr string `ocisConfig:"http_addr"`
	// Protocol can be grpc or http
	Protocol string `ocisConfig:"protocol"`
	// Endpoint is used by the gateway and registries (eg localhost:9100 or cloud.example.com)
	Endpoint string `ocisConfig:"endpoint"`
	// DebugAddr for the debug endpoint to bind to
	DebugAddr string `ocisConfig:"debug_addr"`
	// Services can be used to give a list of services that should be started on this port
	Services []string `ocisConfig:"services"`
	// Config can be used to configure the reva instance.
	// Services and Protocol will be ignored if this is used
	Config map[string]interface{} `ocisConfig:"config"`

	// Context allows for context cancellation and propagation
	Context context.Context

	// Supervised is used when running under an oCIS runtime supervision tree
	Supervised bool // deprecated // TODO: delete me
}

Port defines the available port configuration.

type PublicStorage

type PublicStorage struct {
	StoragePort

	PublicShareProviderAddr string `ocisConfig:"public_share_provider_addr"`
	UserProviderAddr        string `ocisConfig:"user_provider_addr"`
}

PublicStorage configures a public storage provider

type Reva

type Reva struct {
	// JWTSecret used to sign jwt tokens between services
	JWTSecret             string          `ocisConfig:"jwt_secret"`
	SkipUserGroupsInToken bool            `ocisConfig:"skip_user_grooups_in_token"`
	TransferSecret        string          `ocisConfig:"transfer_secret"`
	TransferExpires       int             `ocisConfig:"transfer_expires"`
	OIDC                  OIDC            `ocisConfig:"oidc"`
	LDAP                  LDAP            `ocisConfig:"ldap"`
	UserGroupRest         UserGroupRest   `ocisConfig:"user_group_rest"`
	UserOwnCloudSQL       UserOwnCloudSQL `ocisConfig:"user_owncloud_sql"`
	OCDav                 OCDav           `ocisConfig:"ocdav"`
	Archiver              Archiver        `ocisConfig:"archiver"`
	UserStorage           StorageConfig   `ocisConfig:"user_storage"`
	MetadataStorage       StorageConfig   `ocisConfig:"metadata_storage"`
	// Ports are used to configure which services to start on which port
	Frontend          FrontendPort      `ocisConfig:"frontend"`
	DataGateway       DataGatewayPort   `ocisConfig:"data_gateway"`
	Gateway           Gateway           `ocisConfig:"gateway"`
	StorageRegistry   StorageRegistry   `ocisConfig:"storage_registry"`
	AppRegistry       AppRegistry       `ocisConfig:"app_registry"`
	Users             Users             `ocisConfig:"users"`
	Groups            Groups            `ocisConfig:"groups"`
	AuthProvider      Users             `ocisConfig:"auth_provider"`
	AuthBasic         Port              `ocisConfig:"auth_basic"`
	AuthBearer        Port              `ocisConfig:"auth_bearer"`
	AuthMachine       Port              `ocisConfig:"auth_machine"`
	AuthMachineConfig AuthMachineConfig `ocisConfig:"auth_machine_config"`
	Sharing           Sharing           `ocisConfig:"sharing"`
	StorageShares     StoragePort       `ocisConfig:"storage_shares"`
	StorageUsers      StoragePort       `ocisConfig:"storage_users"`
	StoragePublicLink PublicStorage     `ocisConfig:"storage_public_link"`
	StorageMetadata   StoragePort       `ocisConfig:"storage_metadata"`
	AppProvider       AppProvider       `ocisConfig:"app_provider"`
	Permissions       Port              `ocisConfig:"permissions"`
	// Configs can be used to configure the reva instance.
	// Services and Ports will be ignored if this is used
	Configs map[string]interface{} `ocisConfig:"configs"`
	// chunking and resumable upload config (TUS)
	UploadMaxChunkSize       int    `ocisConfig:"uppload_max_chunk_size"`
	UploadHTTPMethodOverride string `ocisConfig:"upload_http_method_override"`
	// checksumming capabilities
	ChecksumSupportedTypes      []string `ocisConfig:"checksum_supported_types"`
	ChecksumPreferredUploadType string   `ocisConfig:"checksum_preferred_upload_type"`
	DefaultUploadProtocol       string   `ocisConfig:"default_upload_protocol"`
}

Reva defines the available reva configuration.

type Sharing

type Sharing struct {
	Port
	UserDriver                       string `ocisConfig:"user_driver"`
	UserJSONFile                     string `ocisConfig:"user_json_file"`
	CS3ProviderAddr                  string `ocisConfig:"provider_addr"`
	CS3ServiceUser                   string `ocisConfig:"service_user_id"`
	CS3ServiceUserIdp                string `ocisConfig:"service_user_idp"`
	UserSQLUsername                  string `ocisConfig:"user_sql_username"`
	UserSQLPassword                  string `ocisConfig:"user_sql_password"`
	UserSQLHost                      string `ocisConfig:"user_sql_host"`
	UserSQLPort                      int    `ocisConfig:"user_sql_port"`
	UserSQLName                      string `ocisConfig:"user_sql_name"`
	PublicDriver                     string `ocisConfig:"public_driver"`
	PublicJSONFile                   string `ocisConfig:"public_json_file"`
	PublicPasswordHashCost           int    `ocisConfig:"public_password_hash_cost"`
	PublicEnableExpiredSharesCleanup bool   `ocisConfig:"public_enable_expired_shares_cleanup"`
	PublicJanitorRunInterval         int    `ocisConfig:"public_janitor_run_interval"`
	UserStorageMountID               string `ocisConfig:"user_storage_mount_id"`
	Events                           Events `ocisConfig:"events"`
}

Sharing defines the available sharing configuration.

type StorageConfig

type StorageConfig struct {
	EOS         DriverEOS         `ocisConfig:"eos"`
	Local       DriverCommon      `ocisConfig:"local"`
	OwnCloudSQL DriverOwnCloudSQL `ocisConfig:"owncloud_sql"`
	S3          DriverS3          `ocisConfig:"s3"`
	S3NG        DriverS3NG        `ocisConfig:"s3ng"`
	OCIS        DriverOCIS        `ocisConfig:"ocis"`
}

StorageConfig combines all available storage driver configuration parts.

type StoragePort

type StoragePort struct {
	Port
	Driver           string `ocisConfig:"driver"`
	MountID          string `ocisConfig:"mount_id"`
	AlternativeID    string `ocisConfig:"alternative_id"`
	ExposeDataServer bool   `ocisConfig:"expose_data_server"`
	// url the data gateway will use to route requests
	DataServerURL string `ocisConfig:"data_server_url"`

	// for HTTP ports with only one http service
	HTTPPrefix      string       `ocisConfig:"http_prefix"`
	TempFolder      string       `ocisConfig:"temp_folder"`
	ReadOnly        bool         `ocisConfig:"read_only"`
	DataProvider    DataProvider `ocisConfig:"data_provider"`
	GatewayEndpoint string       `ocisConfig:"gateway_endpoint"`
}

StoragePort defines the available storage configuration.

type StorageRegistry

type StorageRegistry struct {
	Driver string `ocisConfig:"driver"`
	// HomeProvider is the path in the global namespace that the static storage registry uses to determine the home storage
	HomeProvider string   `ocisConfig:"home_provider"`
	Rules        []string `ocisConfig:"rules"`
	JSON         string   `ocisConfig:"json"`
}

StorageRegistry defines the available storage registry configuration

type Tracing

type Tracing struct {
	Enabled   bool   `ocisConfig:"enabled"`
	Type      string `ocisConfig:"type"`
	Endpoint  string `ocisConfig:"endpoint"`
	Collector string `ocisConfig:"collector"`
	Service   string `ocisConfig:"service"`
}

Tracing defines the available tracing configuration.

type UserGroupRest

type UserGroupRest struct {
	ClientID          string `ocisConfig:"client_id"`
	ClientSecret      string `ocisConfig:"client_secret"`
	RedisAddress      string `ocisConfig:"redis_address"`
	RedisUsername     string `ocisConfig:"redis_username"`
	RedisPassword     string `ocisConfig:"redis_password"`
	IDProvider        string `ocisConfig:"idp_provider"`
	APIBaseURL        string `ocisConfig:"api_base_url"`
	OIDCTokenEndpoint string `ocisConfig:"oidc_token_endpoint"`
	TargetAPI         string `ocisConfig:"target_api"`
}

UserGroupRest defines the REST driver specification for user and group resolution.

type UserOwnCloudSQL added in v1.12.0

type UserOwnCloudSQL struct {
	DBUsername         string `ocisConfig:"db_username"`
	DBPassword         string `ocisConfig:"db_password"`
	DBHost             string `ocisConfig:"db_host"`
	DBPort             int    `ocisConfig:"db_port"`
	DBName             string `ocisConfig:"db_name"`
	Idp                string `ocisConfig:"idp"`
	Nobody             int64  `ocisConfig:"nobody"`
	JoinUsername       bool   `ocisConfig:"join_username"`
	JoinOwnCloudUUID   bool   `ocisConfig:"join_owncloud_uuid"`
	EnableMedialSearch bool   `ocisConfig:"enable_medial_search"`
}

UserOwnCloudSQL defines the available ownCloudSQL user provider configuration.

type Users

type Users struct {
	Port
	Driver                    string `ocisConfig:"driver"`
	JSON                      string `ocisConfig:"json"`
	UserGroupsCacheExpiration int    `ocisConfig:"user_groups_cache_expiration"`
}

Users defines the available users configuration.

type WopiDriver added in v1.12.0

type WopiDriver struct {
	AppAPIKey      string `ocisConfig:"app_api_key"`
	AppDesktopOnly bool   `ocisConfig:"app_desktop_only"`
	AppIconURI     string `ocisConfig:"app_icon_uri"`
	AppInternalURL string `ocisConfig:"app_internal_url"`
	AppName        string `ocisConfig:"app_name"`
	AppURL         string `ocisConfig:"app_url"`
	Insecure       bool   `ocisConfig:"insecure"`
	IopSecret      string `ocisConfig:"ipo_secret"`
	JWTSecret      string `ocisConfig:"jwt_secret"`
	WopiURL        string `ocisConfig:"wopi_url"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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