mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 09:52:23 -06:00
use yaml tag instead of ocisConfig
This commit is contained in:
@@ -8,78 +8,78 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
GRPC GRPC `ocisConfig:"grpc"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
GRPC GRPC `yaml:"grpc"`
|
||||
|
||||
TokenManager TokenManager `ocisConfig:"token_manager"`
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
|
||||
Asset Asset `ocisConfig:"asset"`
|
||||
Repo Repo `ocisConfig:"repo"`
|
||||
Index Index `ocisConfig:"index"`
|
||||
ServiceUser ServiceUser `ocisConfig:"service_user"`
|
||||
HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."`
|
||||
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."`
|
||||
Asset Asset `yaml:"asset"`
|
||||
Repo Repo `yaml:"repo"`
|
||||
Index Index `yaml:"index"`
|
||||
ServiceUser ServiceUser `yaml:"service_user"`
|
||||
HashDifficulty int `yaml:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."`
|
||||
DemoUsersAndGroups bool `yaml:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."`
|
||||
Path string `yaml:"path" env:"ACCOUNTS_ASSET_PATH" desc:"The path to the ui assets."`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."`
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;ACCOUNTS_JWT_SECRET" desc:"The secret to mint jwt tokens."`
|
||||
}
|
||||
|
||||
// Repo defines which storage implementation is to be used.
|
||||
type Repo struct {
|
||||
Backend string `ocisConfig:"backend" env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"`
|
||||
Disk Disk `ocisConfig:"disk"`
|
||||
CS3 CS3 `ocisConfig:"cs3"`
|
||||
Backend string `yaml:"backend" env:"ACCOUNTS_STORAGE_BACKEND" desc:"Defines which storage implementation is to be used"`
|
||||
Disk Disk `yaml:"disk"`
|
||||
CS3 CS3 `yaml:"cs3"`
|
||||
}
|
||||
|
||||
// Disk is the local disk implementation of the storage.
|
||||
type Disk struct {
|
||||
Path string `ocisConfig:"path" env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."`
|
||||
Path string `yaml:"path" env:"ACCOUNTS_STORAGE_DISK_PATH" desc:"The path where the accounts data is stored."`
|
||||
}
|
||||
|
||||
// CS3 is the cs3 implementation of the storage.
|
||||
type CS3 struct {
|
||||
ProviderAddr string `ocisConfig:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."`
|
||||
ProviderAddr string `yaml:"provider_addr" env:"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR" desc:"The address to the storage provider."`
|
||||
}
|
||||
|
||||
// ServiceUser defines the user required for EOS.
|
||||
type ServiceUser struct {
|
||||
UUID string `ocisConfig:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."`
|
||||
Username string `ocisConfig:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."`
|
||||
UID int64 `ocisConfig:"uid" env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."`
|
||||
GID int64 `ocisConfig:"gid" env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."`
|
||||
UUID string `yaml:"uuid" env:"ACCOUNTS_SERVICE_USER_UUID" desc:"The id of the accounts service user."`
|
||||
Username string `yaml:"username" env:"ACCOUNTS_SERVICE_USER_USERNAME" desc:"The username of the accounts service user."`
|
||||
UID int64 `yaml:"uid" env:"ACCOUNTS_SERVICE_USER_UID" desc:"The uid of the accounts service user."`
|
||||
GID int64 `yaml:"gid" env:"ACCOUNTS_SERVICE_USER_GID" desc:"The gid of the accounts service user."`
|
||||
}
|
||||
|
||||
// Index defines config for indexes.
|
||||
type Index struct {
|
||||
UID UIDBound `ocisConfig:"uid"`
|
||||
GID GIDBound `ocisConfig:"gid"`
|
||||
UID UIDBound `yaml:"uid"`
|
||||
GID GIDBound `yaml:"gid"`
|
||||
}
|
||||
|
||||
// GIDBound defines a lower and upper bound.
|
||||
type GIDBound struct {
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."`
|
||||
Lower int64 `yaml:"lower" env:"ACCOUNTS_GID_INDEX_LOWER_BOUND" desc:"The lowest possible gid value for the indexer."`
|
||||
Upper int64 `yaml:"upper" env:"ACCOUNTS_GID_INDEX_UPPER_BOUND" desc:"The highest possible gid value for the indexer."`
|
||||
}
|
||||
|
||||
// UIDBound defines a lower and upper bound.
|
||||
type UIDBound struct {
|
||||
Lower int64 `ocisConfig:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."`
|
||||
Upper int64 `ocisConfig:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."`
|
||||
Lower int64 `yaml:"lower" env:"ACCOUNTS_UID_INDEX_LOWER_BOUND" desc:"The lowest possible uid value for the indexer."`
|
||||
Upper int64 `yaml:"upper" env:"ACCOUNTS_UID_INDEX_UPPER_BOUND" desc:"The highest possible uid value for the indexer."`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"ACCOUNTS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"ACCOUNTS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"ACCOUNTS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"ACCOUNTS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"ACCOUNTS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"ACCOUNTS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"ACCOUNTS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."`
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
Addr string `yaml:"addr" env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."`
|
||||
Namespace string `yaml:"-"`
|
||||
Root string `yaml:"root" env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."`
|
||||
CacheTTL int `yaml:"cache_ttl" env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."`
|
||||
CORS CORS `yaml:"cors"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `ocisConfig:"allowed_origins"`
|
||||
AllowedMethods []string `ocisConfig:"allowed_methods"`
|
||||
AllowedHeaders []string `ocisConfig:"allowed_headers"`
|
||||
AllowCredentials bool `ocisConfig:"allowed_credentials"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
AllowedMethods []string `yaml:"allowed_methods"`
|
||||
AllowedHeaders []string `yaml:"allowed_headers"`
|
||||
AllowCredentials bool `yaml:"allowed_credentials"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Log defines the available log configuration.
|
||||
type Log struct {
|
||||
Level string `ocisConfig:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."`
|
||||
Pretty bool `ocisConfig:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."`
|
||||
Color bool `ocisConfig:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."`
|
||||
File string `ocisConfig:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."`
|
||||
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;ACCOUNTS_LOG_LEVEL" desc:"The log level."`
|
||||
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;ACCOUNTS_LOG_PRETTY" desc:"Activates pretty log output."`
|
||||
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;ACCOUNTS_LOG_COLOR" desc:"Activates colorized log output."`
|
||||
File string `yaml:"file" env:"OCIS_LOG_FILE;ACCOUNTS_LOG_FILE" desc:"The target log file."`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;ACCOUNTS_TRACING_ENABLED" desc:"Activates tracing."`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;ACCOUNTS_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;ACCOUNTS_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;ACCOUNTS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,30 +8,30 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
Events Events `ocisConfig:"events"`
|
||||
Auditlog Auditlog `ocisConfig:"auditlog"`
|
||||
Events Events `yaml:"events"`
|
||||
Auditlog Auditlog `yaml:"auditlog"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Events combines the configuration options for the event bus.
|
||||
type Events struct {
|
||||
Endpoint string `ocisConfig:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
|
||||
Cluster string `ocisConfig:"events_cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
|
||||
ConsumerGroup string `ocisConfig:"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:"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"`
|
||||
}
|
||||
|
||||
// Auditlog holds audit log information
|
||||
type Auditlog struct {
|
||||
LogToConsole bool `ocisConfig:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE" desc:"logs to Stdout if true"`
|
||||
LogToFile bool `ocisConfig:"log_to_file" env:"AUDIT_LOG_TO_FILE" desc:"logs to file if true"`
|
||||
FilePath string `ocisConfig:"filepath" env:"AUDIT_FILEPATH" desc:"filepath to the logfile. Mandatory if LogToFile is true"`
|
||||
Format string `ocisConfig:"format" env:"AUDIT_FORMAT" desc:"log format. using json is advised"`
|
||||
LogToConsole bool `yaml:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE" desc:"logs to Stdout if true"`
|
||||
LogToFile bool `yaml:"log_to_file" env:"AUDIT_LOG_TO_FILE" desc:"logs to file if true"`
|
||||
FilePath string `yaml:"filepath" env:"AUDIT_FILEPATH" desc:"filepath to the logfile. Mandatory if LogToFile is true"`
|
||||
Format string `yaml:"format" env:"AUDIT_FORMAT" desc:"log format. using json is advised"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"AUDIT_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"AUDIT_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"AUDIT_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"AUDIT_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"AUDIT_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"AUDIT_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"AUDIT_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"AUDIT_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -8,45 +8,45 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
Ldap Ldap `ocisConfig:"ldap"`
|
||||
Ldaps Ldaps `ocisConfig:"ldaps"`
|
||||
Ldap Ldap `yaml:"ldap"`
|
||||
Ldaps Ldaps `yaml:"ldaps"`
|
||||
|
||||
Backend Backend `ocisConfig:"backend"`
|
||||
Fallback FallbackBackend `ocisConfig:"fallback"`
|
||||
Backend Backend `yaml:"backend"`
|
||||
Fallback FallbackBackend `yaml:"fallback"`
|
||||
|
||||
RoleBundleUUID string `ocisConfig:"role_bundle_uuid" env:"GLAUTH_ROLE_BUNDLE_ID"`
|
||||
RoleBundleUUID string `yaml:"role_bundle_uuid" env:"GLAUTH_ROLE_BUNDLE_ID"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Backend defined the available backend configuration.
|
||||
type Backend struct {
|
||||
Datastore string `ocisConfig:"datastore"`
|
||||
BaseDN string `ocisConfig:"base_dn"`
|
||||
Insecure bool `ocisConfig:"insecure"`
|
||||
NameFormat string `ocisConfig:"name_format"`
|
||||
GroupFormat string `ocisConfig:"group_format"`
|
||||
Servers []string `ocisConfig:"servers"`
|
||||
SSHKeyAttr string `ocisConfig:"ssh_key_attr"`
|
||||
UseGraphAPI bool `ocisConfig:"use_graph_api"`
|
||||
Datastore string `yaml:"datastore"`
|
||||
BaseDN string `yaml:"base_dn"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
NameFormat string `yaml:"name_format"`
|
||||
GroupFormat string `yaml:"group_format"`
|
||||
Servers []string `yaml:"servers"`
|
||||
SSHKeyAttr string `yaml:"ssh_key_attr"`
|
||||
UseGraphAPI bool `yaml:"use_graph_api"`
|
||||
}
|
||||
|
||||
// FallbackBackend defined the available fallback backend configuration.
|
||||
type FallbackBackend struct {
|
||||
Datastore string `ocisConfig:"datastore"`
|
||||
BaseDN string `ocisConfig:"base_dn"`
|
||||
Insecure bool `ocisConfig:"insecure"`
|
||||
NameFormat string `ocisConfig:"name_format"`
|
||||
GroupFormat string `ocisConfig:"group_format"`
|
||||
Servers []string `ocisConfig:"servers"`
|
||||
SSHKeyAttr string `ocisConfig:"ssh_key_attr"`
|
||||
UseGraphAPI bool `ocisConfig:"use_graph_api"`
|
||||
Datastore string `yaml:"datastore"`
|
||||
BaseDN string `yaml:"base_dn"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
NameFormat string `yaml:"name_format"`
|
||||
GroupFormat string `yaml:"group_format"`
|
||||
Servers []string `yaml:"servers"`
|
||||
SSHKeyAttr string `yaml:"ssh_key_attr"`
|
||||
UseGraphAPI bool `yaml:"use_graph_api"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"GLAUTH_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"GLAUTH_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"GLAUTH_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"GLAUTH_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"GLAUTH_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"GLAUTH_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"GLAUTH_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"GLAUTH_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package config
|
||||
|
||||
// Ldap defines the available LDAP configuration.
|
||||
type Ldap struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"GLAUTH_LDAP_ENABLED"`
|
||||
Addr string `ocisConfig:"addr" env:"GLAUTH_LDAP_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Enabled bool `yaml:"enabled" env:"GLAUTH_LDAP_ENABLED"`
|
||||
Addr string `yaml:"addr" env:"GLAUTH_LDAP_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package config
|
||||
|
||||
// Ldaps defined the available LDAPS configuration.
|
||||
type Ldaps struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"GLAUTH_LDAPS_ENABLED"`
|
||||
Addr string `ocisConfig:"addr" env:"GLAUTH_LDAPS_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Cert string `ocisConfig:"cert" env:"GLAUTH_LDAPS_CERT"`
|
||||
Key string `ocisConfig:"key" env:"GLAUTH_LDAPS_KEY"`
|
||||
Enabled bool `yaml:"enabled" env:"GLAUTH_LDAPS_ENABLED"`
|
||||
Addr string `yaml:"addr" env:"GLAUTH_LDAPS_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
Cert string `yaml:"cert" env:"GLAUTH_LDAPS_CERT"`
|
||||
Key string `yaml:"key" env:"GLAUTH_LDAPS_KEY"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;GLAUTH_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;GLAUTH_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;GLAUTH_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;GLAUTH_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;GLAUTH_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;GLAUTH_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;GLAUTH_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;GLAUTH_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,25 +8,25 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
GraphExplorer GraphExplorer `ocisConfig:"graph_explorer"`
|
||||
GraphExplorer GraphExplorer `yaml:"graph_explorer"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// GraphExplorer defines the available graph-explorer configuration.
|
||||
type GraphExplorer struct {
|
||||
ClientID string `ocisConfig:"client_id" env:"GRAPH_EXPLORER_CLIENT_ID"`
|
||||
Issuer string `ocisConfig:"issuer" env:"OCIS_URL;GRAPH_EXPLORER_ISSUER"`
|
||||
GraphURLBase string `ocisConfig:"graph_url_base" env:"OCIS_URL;GRAPH_EXPLORER_GRAPH_URL_BASE"`
|
||||
GraphURLPath string `ocisConfig:"graph_url_path" env:"GRAPH_EXPLORER_GRAPH_URL_PATH"`
|
||||
ClientID string `yaml:"client_id" env:"GRAPH_EXPLORER_CLIENT_ID"`
|
||||
Issuer string `yaml:"issuer" env:"OCIS_URL;GRAPH_EXPLORER_ISSUER"`
|
||||
GraphURLBase string `yaml:"graph_url_base" env:"OCIS_URL;GRAPH_EXPLORER_GRAPH_URL_BASE"`
|
||||
GraphURLPath string `yaml:"graph_url_path" env:"GRAPH_EXPLORER_GRAPH_URL_PATH"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"GRAPH_EXPLORER_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"GRAPH_EXPLORER_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"GRAPH_EXPLORER_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"GRAPH_EXPLORER_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"GRAPH_EXPLORER_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"GRAPH_EXPLORER_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"GRAPH_EXPLORER_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"GRAPH_EXPLORER_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"GRAPH_EXPLORER_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"GRAPH_EXPLORER_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"GRAPH_EXPLORER_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"GRAPH_EXPLORER_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `ocisConfig:"allowed_origins"`
|
||||
AllowedMethods []string `ocisConfig:"allowed_methods"`
|
||||
AllowedHeaders []string `ocisConfig:"allowed_headers"`
|
||||
AllowCredentials bool `ocisConfig:"allowed_credentials"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
AllowedMethods []string `yaml:"allowed_methods"`
|
||||
AllowedHeaders []string `yaml:"allowed_headers"`
|
||||
AllowCredentials bool `yaml:"allowed_credentials"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;GRAPH_EXPLORER_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;GRAPH_EXPLORER_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;GRAPH_EXPLORER_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;GRAPH_EXPLORER_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;GRAPH_EXPLORER_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;GRAPH_EXPLORER_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;GRAPH_EXPLORER_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;GRAPH_EXPLORER_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,57 +8,57 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Reva Reva `ocisConfig:"reva"`
|
||||
TokenManager TokenManager `ocisConfig:"token_manager"`
|
||||
Reva Reva `yaml:"reva"`
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
|
||||
Spaces Spaces `ocisConfig:"spaces"`
|
||||
Identity Identity `ocisConfig:"identity"`
|
||||
Spaces Spaces `yaml:"spaces"`
|
||||
Identity Identity `yaml:"identity"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
type Spaces struct {
|
||||
WebDavBase string `ocisConfig:"webdav_base" env:"OCIS_URL;GRAPH_SPACES_WEBDAV_BASE"`
|
||||
WebDavPath string `ocisConfig:"webdav_path" env:"GRAPH_SPACES_WEBDAV_PATH"`
|
||||
DefaultQuota string `ocisConfig:"default_quota" env:"GRAPH_SPACES_DEFAULT_QUOTA"`
|
||||
Insecure bool `ocisConfig:"insecure" env:"OCIS_INSECURE;GRAPH_SPACES_INSECURE"`
|
||||
ExtendedSpacePropertiesCacheTTL int `ocisConfig:"extended_space_properties_cache_ttl" env:"GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL"`
|
||||
WebDavBase string `yaml:"webdav_base" env:"OCIS_URL;GRAPH_SPACES_WEBDAV_BASE"`
|
||||
WebDavPath string `yaml:"webdav_path" env:"GRAPH_SPACES_WEBDAV_PATH"`
|
||||
DefaultQuota string `yaml:"default_quota" env:"GRAPH_SPACES_DEFAULT_QUOTA"`
|
||||
Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;GRAPH_SPACES_INSECURE"`
|
||||
ExtendedSpacePropertiesCacheTTL int `yaml:"extended_space_properties_cache_ttl" env:"GRAPH_SPACES_EXTENDED_SPACE_PROPERTIES_CACHE_TTL"`
|
||||
}
|
||||
|
||||
type LDAP struct {
|
||||
URI string `ocisConfig:"uri" env:"GRAPH_LDAP_URI"`
|
||||
Insecure bool `ocisConfig:"insecure" env:"OCIS_INSECURE;GRAPH_LDAP_INSECURE"`
|
||||
BindDN string `ocisConfig:"bind_dn" env:"GRAPH_LDAP_BIND_DN"`
|
||||
BindPassword string `ocisConfig:"bind_password" env:"GRAPH_LDAP_BIND_PASSWORD"`
|
||||
UseServerUUID bool `ocisConfig:"use_server_uuid" env:"GRAPH_LDAP_SERVER_UUID"`
|
||||
WriteEnabled bool `ocisConfig:"write_enabled" env:"GRAPH_LDAP_SERVER_WRITE_ENABLED"`
|
||||
URI string `yaml:"uri" env:"GRAPH_LDAP_URI"`
|
||||
Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;GRAPH_LDAP_INSECURE"`
|
||||
BindDN string `yaml:"bind_dn" env:"GRAPH_LDAP_BIND_DN"`
|
||||
BindPassword string `yaml:"bind_password" env:"GRAPH_LDAP_BIND_PASSWORD"`
|
||||
UseServerUUID bool `yaml:"use_server_uuid" env:"GRAPH_LDAP_SERVER_UUID"`
|
||||
WriteEnabled bool `yaml:"write_enabled" env:"GRAPH_LDAP_SERVER_WRITE_ENABLED"`
|
||||
|
||||
UserBaseDN string `ocisConfig:"user_base_dn" env:"GRAPH_LDAP_USER_BASE_DN"`
|
||||
UserSearchScope string `ocisConfig:"user_search_scope" env:"GRAPH_LDAP_USER_SCOPE"`
|
||||
UserFilter string `ocisConfig:"user_filter" env:"GRAPH_LDAP_USER_FILTER"`
|
||||
UserEmailAttribute string `ocisConfig:"user_mail_attribute" env:"GRAPH_LDAP_USER_EMAIL_ATTRIBUTE"`
|
||||
UserDisplayNameAttribute string `ocisConfig:"user_displayname_attribute" env:"GRAPH_LDAP_USER_DISPLAYNAME_ATTRIBUTE"`
|
||||
UserNameAttribute string `ocisConfig:"user_name_attribute" env:"GRAPH_LDAP_USER_NAME_ATTRIBUTE"`
|
||||
UserIDAttribute string `ocisConfig:"user_id_attribute" env:"GRAPH_LDAP_USER_UID_ATTRIBUTE"`
|
||||
UserBaseDN string `yaml:"user_base_dn" env:"GRAPH_LDAP_USER_BASE_DN"`
|
||||
UserSearchScope string `yaml:"user_search_scope" env:"GRAPH_LDAP_USER_SCOPE"`
|
||||
UserFilter string `yaml:"user_filter" env:"GRAPH_LDAP_USER_FILTER"`
|
||||
UserEmailAttribute string `yaml:"user_mail_attribute" env:"GRAPH_LDAP_USER_EMAIL_ATTRIBUTE"`
|
||||
UserDisplayNameAttribute string `yaml:"user_displayname_attribute" env:"GRAPH_LDAP_USER_DISPLAYNAME_ATTRIBUTE"`
|
||||
UserNameAttribute string `yaml:"user_name_attribute" env:"GRAPH_LDAP_USER_NAME_ATTRIBUTE"`
|
||||
UserIDAttribute string `yaml:"user_id_attribute" env:"GRAPH_LDAP_USER_UID_ATTRIBUTE"`
|
||||
|
||||
GroupBaseDN string `ocisConfig:"group_base_dn" env:"GRAPH_LDAP_GROUP_BASE_DN"`
|
||||
GroupSearchScope string `ocisConfig:"group_search_scope" env:"GRAPH_LDAP_GROUP_SEARCH_SCOPE"`
|
||||
GroupFilter string `ocisConfig:"group_filter" env:"GRAPH_LDAP_GROUP_FILTER"`
|
||||
GroupNameAttribute string `ocisConfig:"group_name_attribute" env:"GRAPH_LDAP_GROUP_NAME_ATTRIBUTE"`
|
||||
GroupIDAttribute string `ocisConfig:"group_id_attribute" env:"GRAPH_LDAP_GROUP_ID_ATTRIBUTE"`
|
||||
GroupBaseDN string `yaml:"group_base_dn" env:"GRAPH_LDAP_GROUP_BASE_DN"`
|
||||
GroupSearchScope string `yaml:"group_search_scope" env:"GRAPH_LDAP_GROUP_SEARCH_SCOPE"`
|
||||
GroupFilter string `yaml:"group_filter" env:"GRAPH_LDAP_GROUP_FILTER"`
|
||||
GroupNameAttribute string `yaml:"group_name_attribute" env:"GRAPH_LDAP_GROUP_NAME_ATTRIBUTE"`
|
||||
GroupIDAttribute string `yaml:"group_id_attribute" env:"GRAPH_LDAP_GROUP_ID_ATTRIBUTE"`
|
||||
}
|
||||
|
||||
type Identity struct {
|
||||
Backend string `ocisConfig:"backend" env:"GRAPH_IDENTITY_BACKEND"`
|
||||
LDAP LDAP `ocisConfig:"ldap"`
|
||||
Backend string `yaml:"backend" env:"GRAPH_IDENTITY_BACKEND"`
|
||||
LDAP LDAP `yaml:"ldap"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"GRAPH_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"GRAPH_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"GRAPH_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"GRAPH_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"GRAPH_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"GRAPH_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"GRAPH_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"GRAPH_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"GRAPH_HTTP_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"GRAPH_HTTP_ROOT"`
|
||||
Addr string `yaml:"addr" env:"GRAPH_HTTP_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
Root string `yaml:"root" env:"GRAPH_HTTP_ROOT"`
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package config
|
||||
|
||||
// Reva defines all available REVA configuration.
|
||||
type Reva struct {
|
||||
Address string `ocisConfig:"address" env:"REVA_GATEWAY"`
|
||||
Address string `yaml:"address" env:"REVA_GATEWAY"`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;GRAPH_JWT_SECRET"`
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;GRAPH_JWT_SECRET"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;GRAPH_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;GRAPH_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;GRAPH_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;GRAPH_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;GRAPH_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;GRAPH_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;GRAPH_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;GRAPH_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,31 +8,31 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
IDM Settings `ocisConfig:"idm"`
|
||||
CreateDemoUsers bool `ocisConfig:"create_demo_users" env:"IDM_CREATE_DEMO_USERS;ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"Flag to enabe/disable the creation of the demo users"`
|
||||
IDM Settings `yaml:"idm"`
|
||||
CreateDemoUsers bool `yaml:"create_demo_users" env:"IDM_CREATE_DEMO_USERS;ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"Flag to enabe/disable the creation of the demo users"`
|
||||
|
||||
ServiceUserPasswords ServiceUserPasswords `ocisConfig:"service_user_passwords"`
|
||||
ServiceUserPasswords ServiceUserPasswords `yaml:"service_user_passwords"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
LDAPSAddr string `ocisConfig:"ldaps_addr" env:"IDM_LDAPS_ADDR" desc:"Listen address for the ldaps listener (ip-addr:port)"`
|
||||
Cert string `ocisConfig:"cert" env:"IDM_LDAPS_CERT" desc:"File name of the TLS server certificate for the ldaps listener"`
|
||||
Key string `ocisConfig:"cert" env:"IDM_LDAPS_KEY" desc:"File name for the TLS certificate key for the server certificate"`
|
||||
DatabasePath string `ocisConfig:"database" env:"IDM_DATABASE_PATH" desc:"Full path to the idm backend database"`
|
||||
LDAPSAddr string `yaml:"ldaps_addr" env:"IDM_LDAPS_ADDR" desc:"Listen address for the ldaps listener (ip-addr:port)"`
|
||||
Cert string `yaml:"cert" env:"IDM_LDAPS_CERT" desc:"File name of the TLS server certificate for the ldaps listener"`
|
||||
Key string `yaml:"key" env:"IDM_LDAPS_KEY" desc:"File name for the TLS certificate key for the server certificate"`
|
||||
DatabasePath string `yaml:"database" env:"IDM_DATABASE_PATH" desc:"Full path to the idm backend database"`
|
||||
}
|
||||
|
||||
type ServiceUserPasswords struct {
|
||||
IdmAdmin string `ocisConfig:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the \"idm\" service users. Either cleartext or an argon2id hash"`
|
||||
Reva string `ocisConfig:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the \"reva\" service users. Either cleartext or an argon2id hash"`
|
||||
Idp string `ocisConfig:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the \"idp\" service users. Either cleartext or an argon2id hash"`
|
||||
IdmAdmin string `yaml:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the \"idm\" service users. Either cleartext or an argon2id hash"`
|
||||
Reva string `yaml:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the \"reva\" service users. Either cleartext or an argon2id hash"`
|
||||
Idp string `yaml:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the \"idp\" service users. Either cleartext or an argon2id hash"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"IDM_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"IDM_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"IDM_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"IDM_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"IDM_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"IDM_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"IDM_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"IDM_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;IDM_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;IDM_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;IDM_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;IDM_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;IDM_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;IDM_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;IDM_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;IDM_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,94 +8,94 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Asset Asset `ocisConfig:"asset"`
|
||||
IDP Settings `ocisConfig:"idp"`
|
||||
Ldap Ldap `ocisConfig:"ldap"`
|
||||
Asset Asset `yaml:"asset"`
|
||||
IDP Settings `yaml:"idp"`
|
||||
Ldap Ldap `yaml:"ldap"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Ldap defines the available LDAP configuration.
|
||||
type Ldap struct {
|
||||
URI string `ocisConfig:"uri" env:"IDP_LDAP_URI"`
|
||||
URI string `yaml:"uri" env:"IDP_LDAP_URI"`
|
||||
|
||||
BindDN string `ocisConfig:"bind_dn" env:"IDP_LDAP_BIND_DN"`
|
||||
BindPassword string `ocisConfig:"bind_password" env:"IDP_LDAP_BIND_PASSWORD"`
|
||||
BindDN string `yaml:"bind_dn" env:"IDP_LDAP_BIND_DN"`
|
||||
BindPassword string `yaml:"bind_password" env:"IDP_LDAP_BIND_PASSWORD"`
|
||||
|
||||
BaseDN string `ocisConfig:"base_dn" env:"IDP_LDAP_BASE_DN"`
|
||||
Scope string `ocisConfig:"scope" env:"IDP_LDAP_SCOPE"`
|
||||
BaseDN string `yaml:"base_dn" env:"IDP_LDAP_BASE_DN"`
|
||||
Scope string `yaml:"scope" env:"IDP_LDAP_SCOPE"`
|
||||
|
||||
LoginAttribute string `ocisConfig:"login_attribute" env:"IDP_LDAP_LOGIN_ATTRIBUTE"`
|
||||
EmailAttribute string `ocisConfig:"email_attribute" env:"IDP_LDAP_EMAIL_ATTRIBUTE"`
|
||||
NameAttribute string `ocisConfig:"name_attribute" env:"IDP_LDAP_NAME_ATTRIBUTE"`
|
||||
UUIDAttribute string `ocisConfig:"uuid_attribute" env:"IDP_LDAP_UUID_ATTRIBUTE"`
|
||||
UUIDAttributeType string `ocisConfig:"uuid_attribute_type" env:"IDP_LDAP_UUID_ATTRIBUTE_TYPE"`
|
||||
LoginAttribute string `yaml:"login_attribute" env:"IDP_LDAP_LOGIN_ATTRIBUTE"`
|
||||
EmailAttribute string `yaml:"email_attribute" env:"IDP_LDAP_EMAIL_ATTRIBUTE"`
|
||||
NameAttribute string `yaml:"name_attribute" env:"IDP_LDAP_NAME_ATTRIBUTE"`
|
||||
UUIDAttribute string `yaml:"uuid_attribute" env:"IDP_LDAP_UUID_ATTRIBUTE"`
|
||||
UUIDAttributeType string `yaml:"uuid_attribute_type" env:"IDP_LDAP_UUID_ATTRIBUTE_TYPE"`
|
||||
|
||||
Filter string `ocisConfig:"filter" env:"IDP_LDAP_FILTER"`
|
||||
Filter string `yaml:"filter" env:"IDP_LDAP_FILTER"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"asset" env:"IDP_ASSET_PATH"`
|
||||
Path string `yaml:"asset" env:"IDP_ASSET_PATH"`
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
// don't change the order of elements in this struct
|
||||
// it needs to match github.com/libregraph/lico/bootstrap.Settings
|
||||
|
||||
Iss string `ocisConfig:"iss" env:"OCIS_URL;IDP_ISS"`
|
||||
Iss string `yaml:"iss" env:"OCIS_URL;IDP_ISS"`
|
||||
|
||||
IdentityManager string `ocisConfig:"identity_manager" env:"IDP_IDENTITY_MANAGER"`
|
||||
IdentityManager string `yaml:"identity_manager" env:"IDP_IDENTITY_MANAGER"`
|
||||
|
||||
URIBasePath string `ocisConfig:"uri_base_path" env:"IDP_URI_BASE_PATH"`
|
||||
URIBasePath string `yaml:"uri_base_path" env:"IDP_URI_BASE_PATH"`
|
||||
|
||||
SignInURI string `ocisConfig:"sign_in_uri" env:"IDP_SIGN_IN_URI"`
|
||||
SignedOutURI string `ocisConfig:"signed_out_uri" env:"IDP_SIGN_OUT_URI"`
|
||||
SignInURI string `yaml:"sign_in_uri" env:"IDP_SIGN_IN_URI"`
|
||||
SignedOutURI string `yaml:"signed_out_uri" env:"IDP_SIGN_OUT_URI"`
|
||||
|
||||
AuthorizationEndpointURI string `ocisConfig:"authorization_endpoint_uri" env:"IDP_ENDPOINT_URI"`
|
||||
EndsessionEndpointURI string `ocisConfig:"end_session_endpoint_uri" env:"IDP_ENDSESSION_ENDPOINT_URI"`
|
||||
AuthorizationEndpointURI string `yaml:"authorization_endpoint_uri" env:"IDP_ENDPOINT_URI"`
|
||||
EndsessionEndpointURI string `yaml:"end_session_endpoint_uri" env:"IDP_ENDSESSION_ENDPOINT_URI"`
|
||||
|
||||
Insecure bool `ocisConfig:"insecure" env:"IDP_INSECURE"`
|
||||
Insecure bool `yaml:"insecure" env:"IDP_INSECURE"`
|
||||
|
||||
TrustedProxy []string `ocisConfig:"trusted_proxy"` //TODO: how to configure this via env?
|
||||
TrustedProxy []string `yaml:"trusted_proxy"` //TODO: how to configure this via env?
|
||||
|
||||
AllowScope []string `ocisConfig:"allow_scope"` // TODO: is this even needed?
|
||||
AllowClientGuests bool `ocisConfig:"allow_client_guests" env:"IDP_ALLOW_CLIENT_GUESTS"`
|
||||
AllowDynamicClientRegistration bool `ocisConfig:"allow_dynamic_client_registration" env:"IDP_ALLOW_DYNAMIC_CLIENT_REGISTRATION"`
|
||||
AllowScope []string `yaml:"allow_scope"` // TODO: is this even needed?
|
||||
AllowClientGuests bool `yaml:"allow_client_guests" env:"IDP_ALLOW_CLIENT_GUESTS"`
|
||||
AllowDynamicClientRegistration bool `yaml:"allow_dynamic_client_registration" env:"IDP_ALLOW_DYNAMIC_CLIENT_REGISTRATION"`
|
||||
|
||||
EncryptionSecretFile string `ocisConfig:"encrypt_secret_file" env:"IDP_ENCRYPTION_SECRET"`
|
||||
EncryptionSecretFile string `yaml:"encrypt_secret_file" env:"IDP_ENCRYPTION_SECRET"`
|
||||
|
||||
Listen string
|
||||
|
||||
IdentifierClientDisabled bool `ocisConfig:"identifier_client_disabled" env:"IDP_DISABLE_IDENTIFIER_WEBAPP"`
|
||||
IdentifierClientPath string `ocisConfig:"identifier_client_path" env:"IDP_IDENTIFIER_CLIENT_PATH"`
|
||||
IdentifierRegistrationConf string `ocisConfig:"identifier_registration_conf" env:"IDP_IDENTIFIER_REGISTRATION_CONF"`
|
||||
IdentifierScopesConf string `ocisConfig:"identifier_scopes_conf" env:"IDP_IDENTIFIER_SCOPES_CONF"`
|
||||
IdentifierClientDisabled bool `yaml:"identifier_client_disabled" env:"IDP_DISABLE_IDENTIFIER_WEBAPP"`
|
||||
IdentifierClientPath string `yaml:"identifier_client_path" env:"IDP_IDENTIFIER_CLIENT_PATH"`
|
||||
IdentifierRegistrationConf string `yaml:"identifier_registration_conf" env:"IDP_IDENTIFIER_REGISTRATION_CONF"`
|
||||
IdentifierScopesConf string `yaml:"identifier_scopes_conf" env:"IDP_IDENTIFIER_SCOPES_CONF"`
|
||||
IdentifierDefaultBannerLogo string
|
||||
IdentifierDefaultSignInPageText string
|
||||
IdentifierDefaultUsernameHintText string
|
||||
IdentifierUILocales []string
|
||||
|
||||
SigningKid string `ocisConfig:"signing_kid" env:"IDP_SIGNING_KID"`
|
||||
SigningMethod string `ocisConfig:"signing_method" env:"IDP_SIGNING_METHOD"`
|
||||
SigningPrivateKeyFiles []string `ocisConfig:"signing_private_key_files"` // TODO: is this even needed?
|
||||
ValidationKeysPath string `ocisConfig:"validation_keys_path" env:"IDP_VALIDATION_KEYS_PATH"`
|
||||
SigningKid string `yaml:"signing_kid" env:"IDP_SIGNING_KID"`
|
||||
SigningMethod string `yaml:"signing_method" env:"IDP_SIGNING_METHOD"`
|
||||
SigningPrivateKeyFiles []string `yaml:"signing_private_key_files"` // TODO: is this even needed?
|
||||
ValidationKeysPath string `yaml:"validation_keys_path" env:"IDP_VALIDATION_KEYS_PATH"`
|
||||
|
||||
CookieBackendURI string
|
||||
CookieNames []string
|
||||
|
||||
AccessTokenDurationSeconds uint64 `ocisConfig:"access_token_duration_seconds" env:"IDP_ACCESS_TOKEN_EXPIRATION"`
|
||||
IDTokenDurationSeconds uint64 `ocisConfig:"id_token_duration_seconds" env:"IDP_ID_TOKEN_EXPIRATION"`
|
||||
RefreshTokenDurationSeconds uint64 `ocisConfig:"refresh_token_duration_seconds" env:"IDP_REFRESH_TOKEN_EXPIRATION"`
|
||||
DyamicClientSecretDurationSeconds uint64 `ocisConfig:"dynamic_client_secret_duration_seconds" env:""`
|
||||
AccessTokenDurationSeconds uint64 `yaml:"access_token_duration_seconds" env:"IDP_ACCESS_TOKEN_EXPIRATION"`
|
||||
IDTokenDurationSeconds uint64 `yaml:"id_token_duration_seconds" env:"IDP_ID_TOKEN_EXPIRATION"`
|
||||
RefreshTokenDurationSeconds uint64 `yaml:"refresh_token_duration_seconds" env:"IDP_REFRESH_TOKEN_EXPIRATION"`
|
||||
DyamicClientSecretDurationSeconds uint64 `yaml:"dynamic_client_secret_duration_seconds" env:""`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"IDP_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"IDP_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"IDP_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"IDP_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"IDP_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"IDP_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"IDP_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"IDP_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"IDP_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"IDP_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
TLSCert string `ocisConfig:"tls_cert" env:"IDP_TRANSPORT_TLS_CERT"`
|
||||
TLSKey string `ocisConfig:"tls_key" env:"IDP_TRANSPORT_TLS_KEY"`
|
||||
TLS bool `ocisConfig:"tls" env:"IDP_TLS"`
|
||||
Addr string `yaml:"addr" env:"IDP_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"IDP_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
TLSCert string `yaml:"tls_cert" env:"IDP_TRANSPORT_TLS_CERT"`
|
||||
TLSKey string `yaml:"tls_key" env:"IDP_TRANSPORT_TLS_KEY"`
|
||||
TLS bool `yaml:"tls" env:"IDP_TLS"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Log defines the available log configuration.
|
||||
type Log struct {
|
||||
Level string `ocisConfig:"level" env:"OCIS_LOG_LEVEL;IDP_LOG_LEVEL"`
|
||||
Pretty bool `ocisConfig:"pretty" env:"OCIS_LOG_PRETTY;IDP_LOG_PRETTY"`
|
||||
Color bool `ocisConfig:"color" env:"OCIS_LOG_COLOR;IDP_LOG_COLOR"`
|
||||
File string `ocisConfig:"file" env:"OCIS_LOG_FILE;IDP_LOG_FILE"`
|
||||
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;IDP_LOG_LEVEL"`
|
||||
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;IDP_LOG_PRETTY"`
|
||||
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;IDP_LOG_COLOR"`
|
||||
File string `yaml:"file" env:"OCIS_LOG_FILE;IDP_LOG_FILE"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
PasswordResetURI string `ocisConfig:"password_reset_uri" env:"IDP_PASSWORD_RESET_URI" desc:"The URI where a user can reset their password."`
|
||||
Name string `yaml:"-"`
|
||||
PasswordResetURI string `yaml:"password_reset_uri" env:"IDP_PASSWORD_RESET_URI" desc:"The URI where a user can reset their password."`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;IDP_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;IDP_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;IDP_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;IDP_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;IDP_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;IDP_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;IDP_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;IDP_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,22 +8,22 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
Nats Nats `ociConfig:"nats"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Nats is the nats config
|
||||
type Nats struct {
|
||||
Host string `ocisConfig:"host" env:"NATS_NATS_HOST"`
|
||||
Port int `ocisConfig:"port" env:"NATS_NATS_PORT"`
|
||||
ClusterID string `ocisConfig:"clusterid" env:"NATS_NATS_CLUSTER_ID"`
|
||||
StoreDir string `ocisConfig:"store_dir" env:"NATS_NATS_STORE_DIR"`
|
||||
Host string `yaml:"host" env:"NATS_NATS_HOST"`
|
||||
Port int `yaml:"port" env:"NATS_NATS_PORT"`
|
||||
ClusterID string `yaml:"clusterid" env:"NATS_NATS_CLUSTER_ID"`
|
||||
StoreDir string `yaml:"store_dir" env:"NATS_NATS_STORE_DIR"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"NATS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"NATS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"NATS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"NATS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"NATS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"NATS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"NATS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"NATS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -8,37 +8,37 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
Notifications Notifications `ocisConfig:"notifications"`
|
||||
Notifications Notifications `yaml:"notifications"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Notifications definces the config options for the notifications service.
|
||||
type Notifications struct {
|
||||
SMTP SMTP `ocisConfig:"SMTP"`
|
||||
Events Events `ocisConfig:"events"`
|
||||
RevaGateway string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY"`
|
||||
MachineAuthSecret string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY"`
|
||||
SMTP SMTP `yaml:"SMTP"`
|
||||
Events Events `yaml:"events"`
|
||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY;NOTIFICATIONS_REVA_GATEWAY"`
|
||||
MachineAuthSecret string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;NOTIFICATIONS_MACHINE_AUTH_API_KEY"`
|
||||
}
|
||||
|
||||
// SMTP combines the smtp configuration options.
|
||||
type SMTP struct {
|
||||
Host string `ocisConfig:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST"`
|
||||
Port string `ocisConfig:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT"`
|
||||
Sender string `ocisConfig:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER"`
|
||||
Password string `ocisConfig:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD"`
|
||||
Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST"`
|
||||
Port string `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT"`
|
||||
Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER"`
|
||||
Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD"`
|
||||
}
|
||||
|
||||
// Events combines the configuration options for the event bus.
|
||||
type Events struct {
|
||||
Endpoint string `ocisConfig:"events_endpoint" env:"NOTIFICATIONS_EVENTS_ENDPOINT"`
|
||||
Cluster string `ocisConfig:"events_cluster" env:"NOTIFICATIONS_EVENTS_CLUSTER"`
|
||||
ConsumerGroup string `ocisConfig:"events_group" env:"NOTIFICATIONS_EVENTS_GROUP"`
|
||||
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"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"NOTIFICATIONS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"NOTIFICATIONS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"NOTIFICATIONS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"NOTIFICATIONS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"NOTIFICATIONS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"NOTIFICATIONS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"NOTIFICATIONS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"NOTIFICATIONS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -8,31 +8,31 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
TokenManager TokenManager `ocisConfig:"token_manager"`
|
||||
Reva Reva `ocisConfig:"reva"`
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
Reva Reva `yaml:"reva"`
|
||||
|
||||
IdentityManagement IdentityManagement `ocisConfig:"identity_management"`
|
||||
IdentityManagement IdentityManagement `yaml:"identity_management"`
|
||||
|
||||
AccountBackend string `ocisConfig:"account_backend" env:"OCS_ACCOUNT_BACKEND_TYPE"`
|
||||
StorageUsersDriver string `ocisConfig:"storage_users_driver" env:"STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER"`
|
||||
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY"`
|
||||
AccountBackend string `yaml:"account_backend" env:"OCS_ACCOUNT_BACKEND_TYPE"`
|
||||
StorageUsersDriver string `yaml:"storage_users_driver" env:"STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// IdentityManagement keeps track of the OIDC address. This is because Reva requisite of uniqueness for users
|
||||
// is based in the combination of IDP hostname + UserID. For more information see:
|
||||
// https://github.com/cs3org/reva/blob/4fd0229f13fae5bc9684556a82dbbd0eced65ef9/pkg/storage/utils/decomposedfs/node/node.go#L856-L865
|
||||
type IdentityManagement struct {
|
||||
Address string `ocisConfig:"address" env:"OCIS_URL;OCS_IDM_ADDRESS"`
|
||||
Address string `yaml:"address" env:"OCIS_URL;OCS_IDM_ADDRESS"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"OCS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"OCS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"OCS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"OCS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"OCS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"OCS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"OCS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"OCS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"OCS_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"OCS_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
Addr string `yaml:"addr" env:"OCS_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"OCS_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
CORS CORS `yaml:"cors"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `ocisConfig:"allowed_origins"`
|
||||
AllowedMethods []string `ocisConfig:"allowed_methods"`
|
||||
AllowedHeaders []string `ocisConfig:"allowed_headers"`
|
||||
AllowCredentials bool `ocisConfig:"allowed_credentials"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
AllowedMethods []string `yaml:"allowed_methods"`
|
||||
AllowedHeaders []string `yaml:"allowed_headers"`
|
||||
AllowCredentials bool `yaml:"allowed_credentials"`
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package config
|
||||
|
||||
// Reva defines all available REVA configuration.
|
||||
type Reva struct {
|
||||
Address string `ocisConfig:"address" env:"REVA_GATEWAY"`
|
||||
Address string `yaml:"address" env:"REVA_GATEWAY"`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"`
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;OCS_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCS_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,47 +8,47 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Reva Reva `ocisConfig:"reva"`
|
||||
Reva Reva `yaml:"reva"`
|
||||
|
||||
Policies []Policy `ocisConfig:"policies"`
|
||||
OIDC OIDC `ocisConfig:"oidc"`
|
||||
TokenManager TokenManager `ocisConfig:"token_manager"`
|
||||
PolicySelector *PolicySelector `ocisConfig:"policy_selector"`
|
||||
PreSignedURL PreSignedURL `ocisConfig:"pre_signed_url"`
|
||||
AccountBackend string `ocisConfig:"account_backend" env:"PROXY_ACCOUNT_BACKEND_TYPE"`
|
||||
UserOIDCClaim string `ocisConfig:"user_oidc_claim" env:"PROXY_USER_OIDC_CLAIM"`
|
||||
UserCS3Claim string `ocisConfig:"user_cs3_claim" env:"PROXY_USER_CS3_CLAIM"`
|
||||
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;PROXY_MACHINE_AUTH_API_KEY"`
|
||||
AutoprovisionAccounts bool `ocisConfig:"auto_provision_accounts" env:"PROXY_AUTOPROVISION_ACCOUNTS"`
|
||||
EnableBasicAuth bool `ocisConfig:"enable_basic_auth" env:"PROXY_ENABLE_BASIC_AUTH"`
|
||||
InsecureBackends bool `ocisConfig:"insecure_backends" env:"PROXY_INSECURE_BACKENDS"`
|
||||
AuthMiddleware AuthMiddleware `ocisConfig:"auth_middleware"`
|
||||
Policies []Policy `yaml:"policies"`
|
||||
OIDC OIDC `yaml:"oidc"`
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
PolicySelector *PolicySelector `yaml:"policy_selector"`
|
||||
PreSignedURL PreSignedURL `yaml:"pre_signed_url"`
|
||||
AccountBackend string `yaml:"account_backend" env:"PROXY_ACCOUNT_BACKEND_TYPE"`
|
||||
UserOIDCClaim string `yaml:"user_oidc_claim" env:"PROXY_USER_OIDC_CLAIM"`
|
||||
UserCS3Claim string `yaml:"user_cs3_claim" env:"PROXY_USER_CS3_CLAIM"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;PROXY_MACHINE_AUTH_API_KEY"`
|
||||
AutoprovisionAccounts bool `yaml:"auto_provision_accounts" env:"PROXY_AUTOPROVISION_ACCOUNTS"`
|
||||
EnableBasicAuth bool `yaml:"enable_basic_auth" env:"PROXY_ENABLE_BASIC_AUTH"`
|
||||
InsecureBackends bool `yaml:"insecure_backends" env:"PROXY_INSECURE_BACKENDS"`
|
||||
AuthMiddleware AuthMiddleware `yaml:"auth_middleware"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Policy enables us to use multiple directors.
|
||||
type Policy struct {
|
||||
Name string `ocisConfig:"name"`
|
||||
Routes []Route `ocisConfig:"routes"`
|
||||
Name string `yaml:"name"`
|
||||
Routes []Route `yaml:"routes"`
|
||||
}
|
||||
|
||||
// Route define forwarding routes
|
||||
type Route struct {
|
||||
Type RouteType `ocisConfig:"type"`
|
||||
Endpoint string `ocisConfig:"endpoint"`
|
||||
Backend string `ocisConfig:"backend"`
|
||||
ApacheVHost bool `ocisConfig:"apache-vhost"`
|
||||
Type RouteType `yaml:"type"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Backend string `yaml:"backend"`
|
||||
ApacheVHost bool `yaml:"apache-vhost"`
|
||||
}
|
||||
|
||||
// RouteType defines the type of a route
|
||||
@@ -72,72 +72,72 @@ var (
|
||||
|
||||
// AuthMiddleware configures the proxy http auth middleware.
|
||||
type AuthMiddleware struct {
|
||||
CredentialsByUserAgent map[string]string `ocisConfig:"credentials_by_user_agent"`
|
||||
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agent"`
|
||||
}
|
||||
|
||||
// OIDC is the config for the OpenID-Connect middleware. If set the proxy will try to authenticate every request
|
||||
// with the configured oidc-provider
|
||||
type OIDC struct {
|
||||
Issuer string `ocisConfig:"issuer" env:"OCIS_URL;PROXY_OIDC_ISSUER"`
|
||||
Insecure bool `ocisConfig:"insecure" env:"OCIS_INSECURE;PROXY_OIDC_INSECURE"`
|
||||
UserinfoCache UserinfoCache `ocisConfig:"user_info_cache"`
|
||||
Issuer string `yaml:"issuer" env:"OCIS_URL;PROXY_OIDC_ISSUER"`
|
||||
Insecure bool `yaml:"insecure" env:"OCIS_INSECURE;PROXY_OIDC_INSECURE"`
|
||||
UserinfoCache UserinfoCache `yaml:"user_info_cache"`
|
||||
}
|
||||
|
||||
// UserinfoCache is a TTL cache configuration.
|
||||
type UserinfoCache struct {
|
||||
Size int `ocisConfig:"size" env:"PROXY_OIDC_USERINFO_CACHE_SIZE"`
|
||||
TTL int `ocisConfig:"ttl" env:"PROXY_OIDC_USERINFO_CACHE_TTL"`
|
||||
Size int `yaml:"size" env:"PROXY_OIDC_USERINFO_CACHE_SIZE"`
|
||||
TTL int `yaml:"ttl" env:"PROXY_OIDC_USERINFO_CACHE_TTL"`
|
||||
}
|
||||
|
||||
// PolicySelector is the toplevel-configuration for different selectors
|
||||
type PolicySelector struct {
|
||||
Static *StaticSelectorConf `ocisConfig:"static"`
|
||||
Migration *MigrationSelectorConf `ocisConfig:"migration"`
|
||||
Claims *ClaimsSelectorConf `ocisConfig:"claims"`
|
||||
Regex *RegexSelectorConf `ocisConfig:"regex"`
|
||||
Static *StaticSelectorConf `yaml:"static"`
|
||||
Migration *MigrationSelectorConf `yaml:"migration"`
|
||||
Claims *ClaimsSelectorConf `yaml:"claims"`
|
||||
Regex *RegexSelectorConf `yaml:"regex"`
|
||||
}
|
||||
|
||||
// StaticSelectorConf is the config for the static-policy-selector
|
||||
type StaticSelectorConf struct {
|
||||
Policy string `ocisConfig:"policy"`
|
||||
Policy string `yaml:"policy"`
|
||||
}
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;PROXY_JWT_SECRET"`
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;PROXY_JWT_SECRET"`
|
||||
}
|
||||
|
||||
// PreSignedURL is the config for the presigned url middleware
|
||||
type PreSignedURL struct {
|
||||
AllowedHTTPMethods []string `ocisConfig:"allowed_http_methods"`
|
||||
Enabled bool `ocisConfig:"enabled" env:"PROXY_ENABLE_PRESIGNEDURLS"`
|
||||
AllowedHTTPMethods []string `yaml:"allowed_http_methods"`
|
||||
Enabled bool `yaml:"enabled" env:"PROXY_ENABLE_PRESIGNEDURLS"`
|
||||
}
|
||||
|
||||
// MigrationSelectorConf is the config for the migration-selector
|
||||
type MigrationSelectorConf struct {
|
||||
AccFoundPolicy string `ocisConfig:"acc_found_policy"`
|
||||
AccNotFoundPolicy string `ocisConfig:"acc_not_found_policy"`
|
||||
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
|
||||
AccFoundPolicy string `yaml:"acc_found_policy"`
|
||||
AccNotFoundPolicy string `yaml:"acc_not_found_policy"`
|
||||
UnauthenticatedPolicy string `yaml:"unauthenticated_policy"`
|
||||
}
|
||||
|
||||
// ClaimsSelectorConf is the config for the claims-selector
|
||||
type ClaimsSelectorConf struct {
|
||||
DefaultPolicy string `ocisConfig:"default_policy"`
|
||||
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
|
||||
SelectorCookieName string `ocisConfig:"selector_cookie_name"`
|
||||
DefaultPolicy string `yaml:"default_policy"`
|
||||
UnauthenticatedPolicy string `yaml:"unauthenticated_policy"`
|
||||
SelectorCookieName string `yaml:"selector_cookie_name"`
|
||||
}
|
||||
|
||||
// RegexSelectorConf is the config for the regex-selector
|
||||
type RegexSelectorConf struct {
|
||||
DefaultPolicy string `ocisConfig:"default_policy"`
|
||||
MatchesPolicies []RegexRuleConf `ocisConfig:"matches_policies"`
|
||||
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
|
||||
SelectorCookieName string `ocisConfig:"selector_cookie_name"`
|
||||
DefaultPolicy string `yaml:"default_policy"`
|
||||
MatchesPolicies []RegexRuleConf `yaml:"matches_policies"`
|
||||
UnauthenticatedPolicy string `yaml:"unauthenticated_policy"`
|
||||
SelectorCookieName string `yaml:"selector_cookie_name"`
|
||||
}
|
||||
|
||||
type RegexRuleConf struct {
|
||||
Priority int `ocisConfig:"priority"`
|
||||
Property string `ocisConfig:"property"`
|
||||
Match string `ocisConfig:"match"`
|
||||
Policy string `ocisConfig:"policy"`
|
||||
Priority int `yaml:"priority"`
|
||||
Property string `yaml:"property"`
|
||||
Match string `yaml:"match"`
|
||||
Policy string `yaml:"policy"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"PROXY_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"PROXY_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"PROXY_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"PROXY_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"PROXY_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"PROXY_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"PROXY_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"PROXY_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"PROXY_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"PROXY_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
TLSCert string `ocisConfig:"tls_cert" env:"PROXY_TRANSPORT_TLS_CERT"`
|
||||
TLSKey string `ocisConfig:"tls_key" env:"PROXY_TRANSPORT_TLS_KEY"`
|
||||
TLS bool `ocisConfig:"tls" env:"PROXY_TLS"`
|
||||
Addr string `yaml:"addr" env:"PROXY_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"PROXY_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
TLSCert string `yaml:"tls_cert" env:"PROXY_TRANSPORT_TLS_CERT"`
|
||||
TLSKey string `yaml:"tls_key" env:"PROXY_TRANSPORT_TLS_KEY"`
|
||||
TLS bool `yaml:"tls" env:"PROXY_TLS"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Reva defines all available REVA configuration.
|
||||
type Reva struct {
|
||||
Address string `ocisConfig:"address" env:"REVA_GATEWAY"`
|
||||
Address string `yaml:"address" env:"REVA_GATEWAY"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;PROXY_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;PROXY_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;PROXY_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;PROXY_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;PROXY_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;PROXY_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;PROXY_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;PROXY_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,38 +8,38 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
GRPC GRPC `ocisConfig:"grpc"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
GRPC GRPC `yaml:"grpc"`
|
||||
|
||||
StoreType string `ocisConfig:"store_type" env:"SETTINGS_STORE_TYPE"`
|
||||
DataPath string `ocisConfig:"data_path" env:"SETTINGS_DATA_PATH"`
|
||||
Metadata Metadata `ocisConfig:"metadata_config"`
|
||||
StoreType string `yaml:"store_type" env:"SETTINGS_STORE_TYPE"`
|
||||
DataPath string `yaml:"data_path" env:"SETTINGS_DATA_PATH"`
|
||||
Metadata Metadata `yaml:"metadata_config"`
|
||||
|
||||
Asset Asset `ocisConfig:"asset"`
|
||||
TokenManager TokenManager `ocisConfig:"token_manager"`
|
||||
Asset Asset `yaml:"asset"`
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"path" env:"SETTINGS_ASSET_PATH"`
|
||||
Path string `yaml:"path" env:"SETTINGS_ASSET_PATH"`
|
||||
}
|
||||
|
||||
// Metadata configures the metadata store to use
|
||||
type Metadata struct {
|
||||
GatewayAddress string `ocisConfig:"gateway_addr" env:"STORAGE_GATEWAY_GRPC_ADDR"`
|
||||
StorageAddress string `ocisConfig:"storage_addr" env:"STORAGE_GRPC_ADDR"`
|
||||
GatewayAddress string `yaml:"gateway_addr" env:"STORAGE_GATEWAY_GRPC_ADDR"`
|
||||
StorageAddress string `yaml:"storage_addr" env:"STORAGE_GRPC_ADDR"`
|
||||
|
||||
ServiceUserID string `ocisConfig:"service_user_id" env:"METADATA_SERVICE_USER_UUID"`
|
||||
ServiceUserIDP string `ocisConfig:"service_user_idp" env:"OCIS_URL;METADATA_SERVICE_USER_IDP"`
|
||||
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
ServiceUserID string `yaml:"service_user_id" env:"METADATA_SERVICE_USER_UUID"`
|
||||
ServiceUserIDP string `yaml:"service_user_idp" env:"OCIS_URL;METADATA_SERVICE_USER_IDP"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"SETTINGS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"SETTINGS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"SETTINGS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"SETTINGS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"SETTINGS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"SETTINGS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"SETTINGS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"SETTINGS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"SETTINGS_GRPC_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"SETTINGS_GRPC_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"SETTINGS_HTTP_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"SETTINGS_HTTP_ROOT"`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"SETTINGS_CACHE_TTL"`
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
Addr string `yaml:"addr" env:"SETTINGS_HTTP_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
Root string `yaml:"root" env:"SETTINGS_HTTP_ROOT"`
|
||||
CacheTTL int `yaml:"cache_ttl" env:"SETTINGS_CACHE_TTL"`
|
||||
CORS CORS `yaml:"cors"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `ocisConfig:"allowed_origins"`
|
||||
AllowedMethods []string `ocisConfig:"allowed_methods"`
|
||||
AllowedHeaders []string `ocisConfig:"allowed_headers"`
|
||||
AllowCredentials bool `ocisConfig:"allowed_credentials"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
AllowedMethods []string `yaml:"allowed_methods"`
|
||||
AllowedHeaders []string `yaml:"allowed_headers"`
|
||||
AllowCredentials bool `yaml:"allowed_credentials"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;SETTINGS_JWT_SECRET"`
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;SETTINGS_JWT_SECRET"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;SETTINGS_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;SETTINGS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;SETTINGS_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;SETTINGS_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;SETTINGS_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;SETTINGS_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;SETTINGS_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;SETTINGS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,123 +8,123 @@ import (
|
||||
|
||||
// Log defines the available logging configuration.
|
||||
type Log struct {
|
||||
Level string `ocisConfig:"level"`
|
||||
Pretty bool `ocisConfig:"pretty"`
|
||||
Color bool `ocisConfig:"color"`
|
||||
File string `ocisConfig:"file"`
|
||||
Level string `yaml:"level"`
|
||||
Pretty bool `yaml:"pretty"`
|
||||
Color bool `yaml:"color"`
|
||||
File string `yaml:"file"`
|
||||
}
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr"`
|
||||
Token string `ocisConfig:"token"`
|
||||
Pprof bool `ocisConfig:"pprof"`
|
||||
Zpages bool `ocisConfig:"zpages"`
|
||||
Addr string `yaml:"addr"`
|
||||
Token string `yaml:"token"`
|
||||
Pprof bool `yaml:"pprof"`
|
||||
Zpages bool `yaml:"zpages"`
|
||||
}
|
||||
|
||||
// Gateway defines the available gateway configuration.
|
||||
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"`
|
||||
CommitShareToStorageGrant bool `yaml:"commit_share_to_storage_grant"`
|
||||
CommitShareToStorageRef bool `yaml:"commit_share_to_storage_ref"`
|
||||
DisableHomeCreationOnLogin bool `yaml:"disable_home_creation_on_login"`
|
||||
ShareFolder string `yaml:"share_folder"`
|
||||
LinkGrants string `yaml:"link_grants"`
|
||||
HomeMapping string `yaml:"home_mapping"`
|
||||
EtagCacheTTL int `yaml:"etag_cache_ttl"`
|
||||
}
|
||||
|
||||
// StorageRegistry defines the available storage registry configuration
|
||||
type StorageRegistry struct {
|
||||
Driver string `ocisConfig:"driver"`
|
||||
Driver string `yaml:"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"`
|
||||
HomeProvider string `yaml:"home_provider"`
|
||||
Rules []string `yaml:"rules"`
|
||||
JSON string `yaml:"json"`
|
||||
}
|
||||
|
||||
// AppRegistry defines the available app registry configuration
|
||||
type AppRegistry struct {
|
||||
Driver string `ocisConfig:"driver"`
|
||||
MimetypesJSON string `ocisConfig:"mime_types_json"`
|
||||
Driver string `yaml:"driver"`
|
||||
MimetypesJSON string `yaml:"mime_types_json"`
|
||||
}
|
||||
|
||||
// AppProvider defines the available app provider configuration
|
||||
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"`
|
||||
ExternalAddr string `yaml:"external_addr"`
|
||||
Driver string `yaml:"driver"`
|
||||
WopiDriver WopiDriver `yaml:"wopi_driver"`
|
||||
AppsURL string `yaml:"apps_url"`
|
||||
OpenURL string `yaml:"open_url"`
|
||||
NewURL string `yaml:"new_url"`
|
||||
}
|
||||
|
||||
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"`
|
||||
AppAPIKey string `yaml:"app_api_key"`
|
||||
AppDesktopOnly bool `yaml:"app_desktop_only"`
|
||||
AppIconURI string `yaml:"app_icon_uri"`
|
||||
AppInternalURL string `yaml:"app_internal_url"`
|
||||
AppName string `yaml:"app_name"`
|
||||
AppURL string `yaml:"app_url"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
IopSecret string `yaml:"ipo_secret"`
|
||||
JWTSecret string `yaml:"jwt_secret"`
|
||||
WopiURL string `yaml:"wopi_url"`
|
||||
}
|
||||
|
||||
// Sharing defines the available sharing configuration.
|
||||
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"`
|
||||
UserDriver string `yaml:"user_driver"`
|
||||
UserJSONFile string `yaml:"user_json_file"`
|
||||
CS3ProviderAddr string `yaml:"provider_addr"`
|
||||
CS3ServiceUser string `yaml:"service_user_id"`
|
||||
CS3ServiceUserIdp string `yaml:"service_user_idp"`
|
||||
UserSQLUsername string `yaml:"user_sql_username"`
|
||||
UserSQLPassword string `yaml:"user_sql_password"`
|
||||
UserSQLHost string `yaml:"user_sql_host"`
|
||||
UserSQLPort int `yaml:"user_sql_port"`
|
||||
UserSQLName string `yaml:"user_sql_name"`
|
||||
PublicDriver string `yaml:"public_driver"`
|
||||
PublicJSONFile string `yaml:"public_json_file"`
|
||||
PublicPasswordHashCost int `yaml:"public_password_hash_cost"`
|
||||
PublicEnableExpiredSharesCleanup bool `yaml:"public_enable_expired_shares_cleanup"`
|
||||
PublicJanitorRunInterval int `yaml:"public_janitor_run_interval"`
|
||||
UserStorageMountID string `yaml:"user_storage_mount_id"`
|
||||
Events Events `yaml:"events"`
|
||||
}
|
||||
|
||||
type Events struct {
|
||||
Address string `ocisConfig:"address"`
|
||||
ClusterID string `ocisConfig:"cluster_id"`
|
||||
Address string `yaml:"address"`
|
||||
ClusterID string `yaml:"cluster_id"`
|
||||
}
|
||||
|
||||
// Port defines the available port configuration.
|
||||
type Port struct {
|
||||
// MaxCPUs can be a number or a percentage
|
||||
MaxCPUs string `ocisConfig:"max_cpus"`
|
||||
LogLevel string `ocisConfig:"log_level"`
|
||||
MaxCPUs string `yaml:"max_cpus"`
|
||||
LogLevel string `yaml:"log_level"`
|
||||
// GRPCNetwork can be tcp, udp or unix
|
||||
GRPCNetwork string `ocisConfig:"grpc_network"`
|
||||
GRPCNetwork string `yaml:"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"`
|
||||
GRPCAddr string `yaml:"grpc_addr"`
|
||||
// Protocol can be grpc or http
|
||||
// HTTPNetwork can be tcp, udp or unix
|
||||
HTTPNetwork string `ocisConfig:"http_network"`
|
||||
HTTPNetwork string `yaml:"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"`
|
||||
HTTPAddr string `yaml:"http_addr"`
|
||||
// Protocol can be grpc or http
|
||||
Protocol string `ocisConfig:"protocol"`
|
||||
Protocol string `yaml:"protocol"`
|
||||
// Endpoint is used by the gateway and registries (eg localhost:9100 or cloud.example.com)
|
||||
Endpoint string `ocisConfig:"endpoint"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
// DebugAddr for the debug endpoint to bind to
|
||||
DebugAddr string `ocisConfig:"debug_addr"`
|
||||
DebugAddr string `yaml:"debug_addr"`
|
||||
// Services can be used to give a list of services that should be started on this port
|
||||
Services []string `ocisConfig:"services"`
|
||||
Services []string `yaml:"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"`
|
||||
Config map[string]interface{} `yaml:"config"`
|
||||
|
||||
// Context allows for context cancellation and propagation
|
||||
Context context.Context
|
||||
@@ -136,120 +136,120 @@ type Port struct {
|
||||
// Users defines the available users configuration.
|
||||
type Users struct {
|
||||
Port
|
||||
Driver string `ocisConfig:"driver"`
|
||||
JSON string `ocisConfig:"json"`
|
||||
UserGroupsCacheExpiration int `ocisConfig:"user_groups_cache_expiration"`
|
||||
Driver string `yaml:"driver"`
|
||||
JSON string `yaml:"json"`
|
||||
UserGroupsCacheExpiration int `yaml:"user_groups_cache_expiration"`
|
||||
}
|
||||
|
||||
// AuthMachineConfig defines the available configuration for the machine auth driver.
|
||||
type AuthMachineConfig struct {
|
||||
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key"`
|
||||
}
|
||||
|
||||
// Groups defines the available groups configuration.
|
||||
type Groups struct {
|
||||
Port
|
||||
Driver string `ocisConfig:"driver"`
|
||||
JSON string `ocisConfig:"json"`
|
||||
GroupMembersCacheExpiration int `ocisConfig:"group_members_cache_expiration"`
|
||||
Driver string `yaml:"driver"`
|
||||
JSON string `yaml:"json"`
|
||||
GroupMembersCacheExpiration int `yaml:"group_members_cache_expiration"`
|
||||
}
|
||||
|
||||
// FrontendPort defines the available frontend configuration.
|
||||
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"`
|
||||
AppProviderInsecure bool `yaml:"app_provider_insecure"`
|
||||
AppProviderPrefix string `yaml:"app_provider_prefix"`
|
||||
ArchiverInsecure bool `yaml:"archiver_insecure"`
|
||||
ArchiverPrefix string `yaml:"archiver_prefix"`
|
||||
DatagatewayPrefix string `yaml:"data_gateway_prefix"`
|
||||
Favorites bool `yaml:"favorites"`
|
||||
ProjectSpaces bool `yaml:"project_spaces"`
|
||||
OCDavInsecure bool `yaml:"ocdav_insecure"`
|
||||
OCDavPrefix string `yaml:"ocdav_prefix"`
|
||||
OCSPrefix string `yaml:"ocs_prefix"`
|
||||
OCSSharePrefix string `yaml:"ocs_share_prefix"`
|
||||
OCSHomeNamespace string `yaml:"ocs_home_namespace"`
|
||||
PublicURL string `yaml:"public_url"`
|
||||
OCSCacheWarmupDriver string `yaml:"ocs_cache_warmup_driver"`
|
||||
OCSAdditionalInfoAttribute string `yaml:"ocs_additional_info_attribute"`
|
||||
OCSResourceInfoCacheTTL int `yaml:"ocs_resource_info_cache_ttl"`
|
||||
Middleware Middleware `yaml:"middleware"`
|
||||
}
|
||||
|
||||
// Middleware configures reva middlewares.
|
||||
type Middleware struct {
|
||||
Auth Auth `ocisConfig:"auth"`
|
||||
Auth Auth `yaml:"auth"`
|
||||
}
|
||||
|
||||
// Auth configures reva http auth middleware.
|
||||
type Auth struct {
|
||||
CredentialsByUserAgent map[string]string `ocisConfig:"credentials_by_user_agenr"`
|
||||
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agenr"`
|
||||
}
|
||||
|
||||
// DataGatewayPort has a public url
|
||||
type DataGatewayPort struct {
|
||||
Port
|
||||
PublicURL string `ocisConfig:""`
|
||||
PublicURL string `yaml:""`
|
||||
}
|
||||
|
||||
type DataProvider struct {
|
||||
Insecure bool `ocisConfig:"insecure"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
}
|
||||
|
||||
// StoragePort defines the available storage configuration.
|
||||
type StoragePort struct {
|
||||
Port
|
||||
Driver string `ocisConfig:"driver"`
|
||||
MountID string `ocisConfig:"mount_id"`
|
||||
AlternativeID string `ocisConfig:"alternative_id"`
|
||||
ExposeDataServer bool `ocisConfig:"expose_data_server"`
|
||||
Driver string `yaml:"driver"`
|
||||
MountID string `yaml:"mount_id"`
|
||||
AlternativeID string `yaml:"alternative_id"`
|
||||
ExposeDataServer bool `yaml:"expose_data_server"`
|
||||
// url the data gateway will use to route requests
|
||||
DataServerURL string `ocisConfig:"data_server_url"`
|
||||
DataServerURL string `yaml:"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"`
|
||||
HTTPPrefix string `yaml:"http_prefix"`
|
||||
TempFolder string `yaml:"temp_folder"`
|
||||
ReadOnly bool `yaml:"read_only"`
|
||||
DataProvider DataProvider `yaml:"data_provider"`
|
||||
GatewayEndpoint string `yaml:"gateway_endpoint"`
|
||||
}
|
||||
|
||||
// PublicStorage configures a public storage provider
|
||||
type PublicStorage struct {
|
||||
StoragePort
|
||||
|
||||
PublicShareProviderAddr string `ocisConfig:"public_share_provider_addr"`
|
||||
UserProviderAddr string `ocisConfig:"user_provider_addr"`
|
||||
PublicShareProviderAddr string `yaml:"public_share_provider_addr"`
|
||||
UserProviderAddr string `yaml:"user_provider_addr"`
|
||||
}
|
||||
|
||||
// StorageConfig combines all available storage driver configuration parts.
|
||||
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"`
|
||||
EOS DriverEOS `yaml:"eos"`
|
||||
Local DriverCommon `yaml:"local"`
|
||||
OwnCloudSQL DriverOwnCloudSQL `yaml:"owncloud_sql"`
|
||||
S3 DriverS3 `yaml:"s3"`
|
||||
S3NG DriverS3NG `yaml:"s3ng"`
|
||||
OCIS DriverOCIS `yaml:"ocis"`
|
||||
}
|
||||
|
||||
// DriverCommon defines common driver configuration options.
|
||||
type DriverCommon struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `ocisConfig:"root"`
|
||||
Root string `yaml:"root"`
|
||||
//ShareFolder defines the name of the folder jailing all shares
|
||||
ShareFolder string `ocisConfig:"share_folder"`
|
||||
ShareFolder string `yaml:"share_folder"`
|
||||
// UserLayout contains the template used to construct
|
||||
// the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}`
|
||||
UserLayout string `ocisConfig:"user_layout"`
|
||||
UserLayout string `yaml:"user_layout"`
|
||||
// EnableHome enables the creation of home directories.
|
||||
EnableHome bool `ocisConfig:"enable_home"`
|
||||
EnableHome bool `yaml:"enable_home"`
|
||||
// PersonalSpaceAliasTemplate contains the template used to construct
|
||||
// the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"`
|
||||
PersonalSpaceAliasTemplate string `ocisConfig:"personalspacealias_template"`
|
||||
PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template"`
|
||||
// GeneralSpaceAliasTemplate contains the template used to construct
|
||||
// the general space alias, eg: `{{.SpaceType}}/{{.SpaceName | replace " " "-" | lower}}`
|
||||
GeneralSpaceAliasTemplate string `ocisConfig:"generalspacealias_template"`
|
||||
GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template"`
|
||||
}
|
||||
|
||||
// DriverEOS defines the available EOS driver configuration.
|
||||
@@ -257,60 +257,60 @@ type DriverEOS struct {
|
||||
DriverCommon
|
||||
|
||||
// ShadowNamespace for storing shadow data
|
||||
ShadowNamespace string `ocisConfig:"shadow_namespace"`
|
||||
ShadowNamespace string `yaml:"shadow_namespace"`
|
||||
|
||||
// UploadsNamespace for storing upload data
|
||||
UploadsNamespace string `ocisConfig:"uploads_namespace"`
|
||||
UploadsNamespace string `yaml:"uploads_namespace"`
|
||||
|
||||
// Location of the eos binary.
|
||||
// Default is /usr/bin/eos.
|
||||
EosBinary string `ocisConfig:"eos_binary"`
|
||||
EosBinary string `yaml:"eos_binary"`
|
||||
|
||||
// Location of the xrdcopy binary.
|
||||
// Default is /usr/bin/xrdcopy.
|
||||
XrdcopyBinary string `ocisConfig:"xrd_copy_binary"`
|
||||
XrdcopyBinary string `yaml:"xrd_copy_binary"`
|
||||
|
||||
// URL of the Master EOS MGM.
|
||||
// Default is root://eos-example.org
|
||||
MasterURL string `ocisConfig:"master_url"`
|
||||
MasterURL string `yaml:"master_url"`
|
||||
|
||||
// URI of the EOS MGM grpc server
|
||||
// Default is empty
|
||||
GrpcURI string `ocisConfig:"grpc_uri"`
|
||||
GrpcURI string `yaml:"grpc_uri"`
|
||||
|
||||
// URL of the Slave EOS MGM.
|
||||
// Default is root://eos-example.org
|
||||
SlaveURL string `ocisConfig:"slave_url"`
|
||||
SlaveURL string `yaml:"slave_url"`
|
||||
|
||||
// Location on the local fs where to store reads.
|
||||
// Defaults to os.TempDir()
|
||||
CacheDirectory string `ocisConfig:"cache_directory"`
|
||||
CacheDirectory string `yaml:"cache_directory"`
|
||||
|
||||
// Enables logging of the commands executed
|
||||
// Defaults to false
|
||||
EnableLogging bool `ocisConfig:"enable_logging"`
|
||||
EnableLogging bool `yaml:"enable_logging"`
|
||||
|
||||
// ShowHiddenSysFiles shows internal EOS files like
|
||||
// .sys.v# and .sys.a# files.
|
||||
ShowHiddenSysFiles bool `ocisConfig:"shadow_hidden_files"`
|
||||
ShowHiddenSysFiles bool `yaml:"shadow_hidden_files"`
|
||||
|
||||
// ForceSingleUserMode will force connections to EOS to use SingleUsername
|
||||
ForceSingleUserMode bool `ocisConfig:"force_single_user_mode"`
|
||||
ForceSingleUserMode bool `yaml:"force_single_user_mode"`
|
||||
|
||||
// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
|
||||
UseKeytab bool `ocisConfig:"user_keytab"`
|
||||
UseKeytab bool `yaml:"user_keytab"`
|
||||
|
||||
// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
|
||||
SecProtocol string `ocisConfig:"sec_protocol"`
|
||||
SecProtocol string `yaml:"sec_protocol"`
|
||||
|
||||
// Keytab specifies the location of the keytab to use to authenticate to EOS.
|
||||
Keytab string `ocisConfig:"keytab"`
|
||||
Keytab string `yaml:"keytab"`
|
||||
|
||||
// SingleUsername is the username to use when SingleUserMode is enabled
|
||||
SingleUsername string `ocisConfig:"single_username"`
|
||||
SingleUsername string `yaml:"single_username"`
|
||||
|
||||
// gateway service to use for uid lookups
|
||||
GatewaySVC string `ocisConfig:"gateway_svc"`
|
||||
GatewaySVC string `yaml:"gateway_svc"`
|
||||
}
|
||||
|
||||
// DriverOCIS defines the available oCIS storage driver configuration.
|
||||
@@ -322,198 +322,198 @@ type DriverOCIS struct {
|
||||
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"`
|
||||
UploadInfoDir string `yaml:"upload_info_dir"`
|
||||
DBUsername string `yaml:"db_username"`
|
||||
DBPassword string `yaml:"db_password"`
|
||||
DBHost string `yaml:"db_host"`
|
||||
DBPort int `yaml:"db_port"`
|
||||
DBName string `yaml:"db_name"`
|
||||
}
|
||||
|
||||
// DriverS3 defines the available S3 storage driver configuration.
|
||||
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"`
|
||||
Region string `yaml:"region"`
|
||||
AccessKey string `yaml:"access_key"`
|
||||
SecretKey string `yaml:"secret_key"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Bucket string `yaml:"bucket"`
|
||||
}
|
||||
|
||||
// DriverS3NG defines the available s3ng storage driver configuration.
|
||||
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"`
|
||||
Region string `yaml:"region"`
|
||||
AccessKey string `yaml:"access_key"`
|
||||
SecretKey string `yaml:"secret_key"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Bucket string `yaml:"bucket"`
|
||||
}
|
||||
|
||||
// OIDC defines the available OpenID Connect configuration.
|
||||
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"`
|
||||
Issuer string `yaml:"issuer"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
IDClaim string `yaml:"id_claim"`
|
||||
UIDClaim string `yaml:"uid_claim"`
|
||||
GIDClaim string `yaml:"gid_claim"`
|
||||
}
|
||||
|
||||
// LDAP defines the available ldap configuration.
|
||||
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"`
|
||||
Hostname string `yaml:"hostname"`
|
||||
Port int `yaml:"port"`
|
||||
CACert string `yaml:"ca_cert"`
|
||||
Insecure bool `yaml:"insecure"`
|
||||
BaseDN string `yaml:"base_dn"`
|
||||
LoginFilter string `yaml:"login_filter"`
|
||||
UserFilter string `yaml:"user_filter"`
|
||||
UserAttributeFilter string `yaml:"user_attribute_filter"`
|
||||
UserFindFilter string `yaml:"user_find_filter"`
|
||||
UserGroupFilter string `yaml:"user_group_filter"`
|
||||
GroupFilter string `yaml:"group_filter"`
|
||||
GroupAttributeFilter string `yaml:"group_attribute_filter"`
|
||||
GroupFindFilter string `yaml:"group_finder_filter"`
|
||||
GroupMemberFilter string `yaml:"group_member_filter"`
|
||||
BindDN string `yaml:"bind_dn"`
|
||||
BindPassword string `yaml:"bind_password"`
|
||||
IDP string `yaml:"idp"`
|
||||
UserSchema LDAPUserSchema `yaml:"user_schema"`
|
||||
GroupSchema LDAPGroupSchema `yaml:"group_schema"`
|
||||
}
|
||||
|
||||
// UserGroupRest defines the REST driver specification for user and group resolution.
|
||||
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"`
|
||||
ClientID string `yaml:"client_id"`
|
||||
ClientSecret string `yaml:"client_secret"`
|
||||
RedisAddress string `yaml:"redis_address"`
|
||||
RedisUsername string `yaml:"redis_username"`
|
||||
RedisPassword string `yaml:"redis_password"`
|
||||
IDProvider string `yaml:"idp_provider"`
|
||||
APIBaseURL string `yaml:"api_base_url"`
|
||||
OIDCTokenEndpoint string `yaml:"oidc_token_endpoint"`
|
||||
TargetAPI string `yaml:"target_api"`
|
||||
}
|
||||
|
||||
// UserOwnCloudSQL defines the available ownCloudSQL user provider configuration.
|
||||
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"`
|
||||
DBUsername string `yaml:"db_username"`
|
||||
DBPassword string `yaml:"db_password"`
|
||||
DBHost string `yaml:"db_host"`
|
||||
DBPort int `yaml:"db_port"`
|
||||
DBName string `yaml:"db_name"`
|
||||
Idp string `yaml:"idp"`
|
||||
Nobody int64 `yaml:"nobody"`
|
||||
JoinUsername bool `yaml:"join_username"`
|
||||
JoinOwnCloudUUID bool `yaml:"join_owncloud_uuid"`
|
||||
EnableMedialSearch bool `yaml:"enable_medial_search"`
|
||||
}
|
||||
|
||||
// LDAPUserSchema defines the available ldap user schema configuration.
|
||||
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"`
|
||||
UID string `yaml:"uid"`
|
||||
Mail string `yaml:"mail"`
|
||||
DisplayName string `yaml:"display_name"`
|
||||
CN string `yaml:"cn"`
|
||||
UIDNumber string `yaml:"uid_number"`
|
||||
GIDNumber string `yaml:"gid_number"`
|
||||
}
|
||||
|
||||
// LDAPGroupSchema defines the available ldap group schema configuration.
|
||||
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"`
|
||||
GID string `yaml:"gid"`
|
||||
Mail string `yaml:"mail"`
|
||||
DisplayName string `yaml:"display_name"`
|
||||
CN string `yaml:"cn"`
|
||||
GIDNumber string `yaml:"gid_number"`
|
||||
}
|
||||
|
||||
// OCDav defines the available ocdav configuration.
|
||||
type OCDav struct {
|
||||
WebdavNamespace string `ocisConfig:"webdav_namespace"`
|
||||
DavFilesNamespace string `ocisConfig:"dav_files_namespace"`
|
||||
WebdavNamespace string `yaml:"webdav_namespace"`
|
||||
DavFilesNamespace string `yaml:"dav_files_namespace"`
|
||||
}
|
||||
|
||||
// Archiver defines the available archiver configuration.
|
||||
type Archiver struct {
|
||||
MaxNumFiles int64 `ocisConfig:"max_num_files"`
|
||||
MaxSize int64 `ocisConfig:"max_size"`
|
||||
ArchiverURL string `ocisConfig:"archiver_url"`
|
||||
MaxNumFiles int64 `yaml:"max_num_files"`
|
||||
MaxSize int64 `yaml:"max_size"`
|
||||
ArchiverURL string `yaml:"archiver_url"`
|
||||
}
|
||||
|
||||
// Reva defines the available reva configuration.
|
||||
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"`
|
||||
JWTSecret string `yaml:"jwt_secret"`
|
||||
SkipUserGroupsInToken bool `yaml:"skip_user_grooups_in_token"`
|
||||
TransferSecret string `yaml:"transfer_secret"`
|
||||
TransferExpires int `yaml:"transfer_expires"`
|
||||
OIDC OIDC `yaml:"oidc"`
|
||||
LDAP LDAP `yaml:"ldap"`
|
||||
UserGroupRest UserGroupRest `yaml:"user_group_rest"`
|
||||
UserOwnCloudSQL UserOwnCloudSQL `yaml:"user_owncloud_sql"`
|
||||
OCDav OCDav `yaml:"ocdav"`
|
||||
Archiver Archiver `yaml:"archiver"`
|
||||
UserStorage StorageConfig `yaml:"user_storage"`
|
||||
MetadataStorage StorageConfig `yaml:"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"`
|
||||
Frontend FrontendPort `yaml:"frontend"`
|
||||
DataGateway DataGatewayPort `yaml:"data_gateway"`
|
||||
Gateway Gateway `yaml:"gateway"`
|
||||
StorageRegistry StorageRegistry `yaml:"storage_registry"`
|
||||
AppRegistry AppRegistry `yaml:"app_registry"`
|
||||
Users Users `yaml:"users"`
|
||||
Groups Groups `yaml:"groups"`
|
||||
AuthProvider Users `yaml:"auth_provider"`
|
||||
AuthBasic Port `yaml:"auth_basic"`
|
||||
AuthBearer Port `yaml:"auth_bearer"`
|
||||
AuthMachine Port `yaml:"auth_machine"`
|
||||
AuthMachineConfig AuthMachineConfig `yaml:"auth_machine_config"`
|
||||
Sharing Sharing `yaml:"sharing"`
|
||||
StorageShares StoragePort `yaml:"storage_shares"`
|
||||
StorageUsers StoragePort `yaml:"storage_users"`
|
||||
StoragePublicLink PublicStorage `yaml:"storage_public_link"`
|
||||
StorageMetadata StoragePort `yaml:"storage_metadata"`
|
||||
AppProvider AppProvider `yaml:"app_provider"`
|
||||
Permissions Port `yaml:"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"`
|
||||
Configs map[string]interface{} `yaml:"configs"`
|
||||
// chunking and resumable upload config (TUS)
|
||||
UploadMaxChunkSize int `ocisConfig:"uppload_max_chunk_size"`
|
||||
UploadHTTPMethodOverride string `ocisConfig:"upload_http_method_override"`
|
||||
UploadMaxChunkSize int `yaml:"uppload_max_chunk_size"`
|
||||
UploadHTTPMethodOverride string `yaml:"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"`
|
||||
ChecksumSupportedTypes []string `yaml:"checksum_supported_types"`
|
||||
ChecksumPreferredUploadType string `yaml:"checksum_preferred_upload_type"`
|
||||
DefaultUploadProtocol string `yaml:"default_upload_protocol"`
|
||||
}
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled"`
|
||||
Type string `ocisConfig:"type"`
|
||||
Endpoint string `ocisConfig:"endpoint"`
|
||||
Collector string `ocisConfig:"collector"`
|
||||
Service string `ocisConfig:"service"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
Type string `yaml:"type"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Collector string `yaml:"collector"`
|
||||
Service string `yaml:"service"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"path"`
|
||||
Path string `yaml:"path"`
|
||||
}
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
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"`
|
||||
File string `yaml:"file"`
|
||||
Log *shared.Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
Reva Reva `yaml:"reva"`
|
||||
Tracing Tracing `yaml:"tracing"`
|
||||
Asset Asset `yaml:"asset"`
|
||||
}
|
||||
|
||||
// New initializes a new configuration with or without defaults.
|
||||
|
||||
@@ -8,17 +8,17 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
GRPC GRPC `ocisConfig:"grpc"`
|
||||
GRPC GRPC `yaml:"grpc"`
|
||||
|
||||
Datapath string `ocisConfig:"data_path" env:"STORE_DATA_PATH"`
|
||||
Datapath string `yaml:"data_path" env:"STORE_DATA_PATH"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"STORE_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"STORE_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"STORE_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"STORE_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"STORE_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"STORE_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"STORE_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"STORE_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"STORE_GRPC_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"STORE_GRPC_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;STORE_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;STORE_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;STORE_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;STORE_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;STORE_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;STORE_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;STORE_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;STORE_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,40 +8,40 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
GRPC GRPC `ocisConfig:"grpc"`
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
GRPC GRPC `yaml:"grpc"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Thumbnail Thumbnail `ocisConfig:"thumbnail"`
|
||||
Thumbnail Thumbnail `yaml:"thumbnail"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// FileSystemStorage defines the available filesystem storage configuration.
|
||||
type FileSystemStorage struct {
|
||||
RootDirectory string `ocisConfig:"root_directory" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"`
|
||||
RootDirectory string `yaml:"root_directory" env:"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"`
|
||||
}
|
||||
|
||||
// FileSystemSource defines the available filesystem source configuration.
|
||||
type FileSystemSource struct {
|
||||
BasePath string `ocisConfig:"base_path"`
|
||||
BasePath string `yaml:"base_path"`
|
||||
}
|
||||
|
||||
// Thumbnail defines the available thumbnail related configuration.
|
||||
type Thumbnail struct {
|
||||
Resolutions []string `ocisConfig:"resolutions"`
|
||||
FileSystemStorage FileSystemStorage `ocisConfig:"filesystem_storage"`
|
||||
WebdavAllowInsecure bool `ocisConfig:"webdav_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
||||
CS3AllowInsecure bool `ocisConfig:"cs3_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
||||
RevaGateway string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY"` //TODO: use REVA config
|
||||
FontMapFile string `ocisConfig:"font_map_file" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
||||
TransferTokenSecret string `ocisConfig:"transfer_token" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
||||
DataEndpoint string `ocisConfig:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT"`
|
||||
Resolutions []string `yaml:"resolutions"`
|
||||
FileSystemStorage FileSystemStorage `yaml:"filesystem_storage"`
|
||||
WebdavAllowInsecure bool `yaml:"webdav_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_WEBDAVSOURCE_INSECURE"`
|
||||
CS3AllowInsecure bool `yaml:"cs3_allow_insecure" env:"OCIS_INSECURE;THUMBNAILS_CS3SOURCE_INSECURE"`
|
||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY"` //TODO: use REVA config
|
||||
FontMapFile string `yaml:"font_map_file" env:"THUMBNAILS_TXT_FONTMAP_FILE"`
|
||||
TransferTokenSecret string `yaml:"transfer_token" env:"THUMBNAILS_TRANSFER_TOKEN"`
|
||||
DataEndpoint string `yaml:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"THUMBNAILS_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"THUMBNAILS_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"THUMBNAILS_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"THUMBNAILS_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"THUMBNAILS_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"THUMBNAILS_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ package config
|
||||
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_GRPC_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_GRPC_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"THUMBNAILS_HTTP_ADDR"`
|
||||
Root string `ocisConfig:"root" env:"THUMBNAILS_HTTP_ROOT"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_HTTP_ADDR"`
|
||||
Root string `yaml:"root" env:"THUMBNAILS_HTTP_ROOT"`
|
||||
Namespace string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;THUMBNAILS_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;THUMBNAILS_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;THUMBNAILS_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;THUMBNAILS_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;THUMBNAILS_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;THUMBNAILS_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;THUMBNAILS_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;THUMBNAILS_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,46 +8,46 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
Asset Asset `ocisConfig:"asset"`
|
||||
File string `ocisConfig:"file" env:"WEB_UI_CONFIG"` // TODO: rename this to a more self explaining string
|
||||
Web Web `ocisConfig:"web"`
|
||||
Asset Asset `yaml:"asset"`
|
||||
File string `yaml:"file" env:"WEB_UI_CONFIG"` // TODO: rename this to a more self explaining string
|
||||
Web Web `yaml:"web"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
type Asset struct {
|
||||
Path string `ocisConfig:"path" env:"WEB_ASSET_PATH"`
|
||||
Path string `yaml:"path" env:"WEB_ASSET_PATH"`
|
||||
}
|
||||
|
||||
// WebConfig defines the available web configuration for a dynamically rendered config.json.
|
||||
type WebConfig struct {
|
||||
Server string `json:"server,omitempty" ocisConfig:"server" env:"OCIS_URL;WEB_UI_CONFIG_SERVER"`
|
||||
Theme string `json:"theme,omitempty" ocisConfig:"theme" env:""`
|
||||
Version string `json:"version,omitempty" ocisConfig:"version" env:"WEB_UI_CONFIG_VERSION"`
|
||||
OpenIDConnect OIDC `json:"openIdConnect,omitempty" ocisConfig:"oids"`
|
||||
Apps []string `json:"apps" ocisConfig:"apps"`
|
||||
ExternalApps []ExternalApp `json:"external_apps,omitempty" ocisConfig:"external_apps"`
|
||||
Options map[string]interface{} `json:"options,omitempty" ocisConfig:"options"`
|
||||
Server string `json:"server,omitempty" yaml:"server" env:"OCIS_URL;WEB_UI_CONFIG_SERVER"`
|
||||
Theme string `json:"theme,omitempty" yaml:"theme" env:""`
|
||||
Version string `json:"version,omitempty" yaml:"version" env:"WEB_UI_CONFIG_VERSION"`
|
||||
OpenIDConnect OIDC `json:"openIdConnect,omitempty" yaml:"oids"`
|
||||
Apps []string `json:"apps" yaml:"apps"`
|
||||
ExternalApps []ExternalApp `json:"external_apps,omitempty" yaml:"external_apps"`
|
||||
Options map[string]interface{} `json:"options,omitempty" yaml:"options"`
|
||||
}
|
||||
|
||||
// OIDC defines the available oidc configuration
|
||||
type OIDC struct {
|
||||
MetadataURL string `json:"metadata_url,omitempty" ocisConfig:"metadata_url" env:"WEB_OIDC_METADATA_URL"`
|
||||
Authority string `json:"authority,omitempty" ocisConfig:"authority" env:"OCIS_URL;WEB_OIDC_AUTHORITY"`
|
||||
ClientID string `json:"client_id,omitempty" ocisConfig:"client_id" env:"WEB_OIDC_CLIENT_ID"`
|
||||
ResponseType string `json:"response_type,omitempty" ocisConfig:"response_type" env:"WEB_OIDC_RESPONSE_TYPE"`
|
||||
Scope string `json:"scope,omitempty" ocisConfig:"scope" env:"WEB_OIDC_SCOPE"`
|
||||
MetadataURL string `json:"metadata_url,omitempty" yaml:"metadata_url" env:"WEB_OIDC_METADATA_URL"`
|
||||
Authority string `json:"authority,omitempty" yaml:"authority" env:"OCIS_URL;WEB_OIDC_AUTHORITY"`
|
||||
ClientID string `json:"client_id,omitempty" yaml:"client_id" env:"WEB_OIDC_CLIENT_ID"`
|
||||
ResponseType string `json:"response_type,omitempty" yaml:"response_type" env:"WEB_OIDC_RESPONSE_TYPE"`
|
||||
Scope string `json:"scope,omitempty" yaml:"scope" env:"WEB_OIDC_SCOPE"`
|
||||
}
|
||||
|
||||
// ExternalApp defines an external web app.
|
||||
@@ -59,21 +59,21 @@ type OIDC struct {
|
||||
// }
|
||||
// }
|
||||
type ExternalApp struct {
|
||||
ID string `json:"id,omitempty" ocisConfig:"id"`
|
||||
Path string `json:"path,omitempty" ocisConfig:"path"`
|
||||
ID string `json:"id,omitempty" yaml:"id"`
|
||||
Path string `json:"path,omitempty" yaml:"path"`
|
||||
// Config is completely dynamic, because it depends on the extension
|
||||
Config map[string]interface{} `json:"config,omitempty" ocisConfig:"config"`
|
||||
Config map[string]interface{} `json:"config,omitempty" yaml:"config"`
|
||||
}
|
||||
|
||||
// ExternalAppConfig defines an external web app configuration.
|
||||
type ExternalAppConfig struct {
|
||||
URL string `json:"url,omitempty" ocisConfig:"url" env:""`
|
||||
URL string `json:"url,omitempty" yaml:"url" env:""`
|
||||
}
|
||||
|
||||
// Web defines the available web configuration.
|
||||
type Web struct {
|
||||
Path string `ocisConfig:"path" env:"WEB_UI_PATH"`
|
||||
ThemeServer string `ocisConfig:"theme_server" env:"OCIS_URL;WEB_UI_THEME_SERVER"` // used to build Theme in WebConfig
|
||||
ThemePath string `ocisConfig:"theme_path" env:"WEB_UI_THEME_PATH"` // used to build Theme in WebConfig
|
||||
Config WebConfig `ocisConfig:"config"`
|
||||
Path string `yaml:"path" env:"WEB_UI_PATH"`
|
||||
ThemeServer string `yaml:"theme_server" env:"OCIS_URL;WEB_UI_THEME_SERVER"` // used to build Theme in WebConfig
|
||||
ThemePath string `yaml:"theme_path" env:"WEB_UI_THEME_PATH"` // used to build Theme in WebConfig
|
||||
Config WebConfig `yaml:"config"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"WEB_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"WEB_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"WEB_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"WEB_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"WEB_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"WEB_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"WEB_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"WEB_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"WEB_HTTP_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"WEB_HTTP_ROOT"`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"WEB_CACHE_TTL"`
|
||||
Addr string `yaml:"addr" env:"WEB_HTTP_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
Root string `yaml:"root" env:"WEB_HTTP_ROOT"`
|
||||
CacheTTL int `yaml:"cache_ttl" env:"WEB_CACHE_TTL"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;WEB_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;WEB_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEB_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;WEB_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;WEB_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;WEB_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEB_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;WEB_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
@@ -8,19 +8,19 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
*shared.Commons `yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTP `ocisConfig:"http"`
|
||||
HTTP HTTP `yaml:"http"`
|
||||
|
||||
OcisPublicURL string `ocisConfig:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL"`
|
||||
WebdavNamespace string `ocisConfig:"webdav_namespace" env:"STORAGE_WEBDAV_NAMESPACE"` //TODO: prevent this cross config
|
||||
RevaGateway string `ocisConfig:"reva_gateway" env:"REVA_GATEWAY"`
|
||||
OcisPublicURL string `yaml:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL"`
|
||||
WebdavNamespace string `yaml:"webdav_namespace" env:"STORAGE_WEBDAV_NAMESPACE"` //TODO: prevent this cross config
|
||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"WEBDAV_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"WEBDAV_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"WEBDAV_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"WEBDAV_DEBUG_ZPAGES"`
|
||||
Addr string `yaml:"addr" env:"WEBDAV_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"WEBDAV_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"WEBDAV_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"WEBDAV_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@ package config
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `ocisConfig:"allowed_origins"`
|
||||
AllowedMethods []string `ocisConfig:"allowed_methods"`
|
||||
AllowedHeaders []string `ocisConfig:"allowed_headers"`
|
||||
AllowCredentials bool `ocisConfig:"allow_credentials"`
|
||||
AllowedOrigins []string `yaml:"allowed_origins"`
|
||||
AllowedMethods []string `yaml:"allowed_methods"`
|
||||
AllowedHeaders []string `yaml:"allowed_headers"`
|
||||
AllowCredentials bool `yaml:"allow_credentials"`
|
||||
}
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"WEBDAV_HTTP_ADDR"`
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"WEBDAV_HTTP_ROOT"`
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
Addr string `yaml:"addr" env:"WEBDAV_HTTP_ADDR"`
|
||||
Namespace string `yaml:"-"`
|
||||
Root string `yaml:"root" env:"WEBDAV_HTTP_ROOT"`
|
||||
CORS CORS `yaml:"cors"`
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package config
|
||||
|
||||
// Tracing defines the available tracing configuration.
|
||||
type Tracing struct {
|
||||
Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;WEBDAV_TRACING_ENABLED"`
|
||||
Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;WEBDAV_TRACING_TYPE"`
|
||||
Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEBDAV_TRACING_ENDPOINT"`
|
||||
Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;WEBDAV_TRACING_COLLECTOR"`
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;WEBDAV_TRACING_ENABLED"`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;WEBDAV_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;WEBDAV_TRACING_ENDPOINT"`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;WEBDAV_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user