use ocisConfig as struct tagname to bind config files to strucg attributes

This commit is contained in:
A.Unger
2021-11-19 09:28:23 +01:00
parent c427e623ef
commit 24347180fa
15 changed files with 777 additions and 774 deletions
+64 -64
View File
@@ -12,132 +12,132 @@ import (
// LDAP defines the available ldap configuration.
type LDAP struct {
Hostname string `mapstructure:"hostname"`
Port int `mapstructure:"port"`
BaseDN string `mapstructure:"base_dn"`
UserFilter string `mapstructure:"user_filter"`
GroupFilter string `mapstructure:"group_filter"`
BindDN string `mapstructure:"bind_dn"`
BindPassword string `mapstructure:"bind_password"`
IDP string `mapstructure:"idp"`
Schema LDAPSchema `mapstructure:"schema"`
Hostname string `ocisConfig:"hostname"`
Port int `ocisConfig:"port"`
BaseDN string `ocisConfig:"base_dn"`
UserFilter string `ocisConfig:"user_filter"`
GroupFilter string `ocisConfig:"group_filter"`
BindDN string `ocisConfig:"bind_dn"`
BindPassword string `ocisConfig:"bind_password"`
IDP string `ocisConfig:"idp"`
Schema LDAPSchema `ocisConfig:"schema"`
}
// LDAPSchema defines the available ldap schema configuration.
type LDAPSchema struct {
AccountID string `mapstructure:"account_id"`
Identities string `mapstructure:"identities"`
Username string `mapstructure:"username"`
DisplayName string `mapstructure:"display_name"`
Mail string `mapstructure:"mail"`
Groups string `mapstructure:"groups"`
AccountID string `ocisConfig:"account_id"`
Identities string `ocisConfig:"identities"`
Username string `ocisConfig:"username"`
DisplayName string `ocisConfig:"display_name"`
Mail string `ocisConfig:"mail"`
Groups string `ocisConfig:"groups"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `mapstructure:"allowed_origins"`
AllowedMethods []string `mapstructure:"allowed_methods"`
AllowedHeaders []string `mapstructure:"allowed_headers"`
AllowCredentials bool `mapstructure:"allowed_credentials"`
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allowed_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Namespace string `mapstructure:"namespace"`
Root string `mapstructure:"root"`
CacheTTL int `mapstructure:"cache_ttl"`
CORS CORS `mapstructure:"cors"`
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
Root string `ocisConfig:"root"`
CacheTTL int `ocisConfig:"cache_ttl"`
CORS CORS `ocisConfig:"cors"`
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string `mapstructure:"addr"`
Namespace string `mapstructure:"namespace"`
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
}
// Server configures a server.
type Server struct {
Version string `mapstructure:"version"`
Name string `mapstructure:"name"`
HashDifficulty int `mapstructure:"hash_difficulty"`
DemoUsersAndGroups bool `mapstructure:"demo_users_and_groups"`
Version string `ocisConfig:"version"`
Name string `ocisConfig:"name"`
HashDifficulty int `ocisConfig:"hash_difficulty"`
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups"`
}
// Asset defines the available asset configuration.
type Asset struct {
Path string `mapstructure:"path"`
Path string `ocisConfig:"path"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `mapstructure:"jwt_secret"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
// Repo defines which storage implementation is to be used.
type Repo struct {
Backend string `mapstructure:"backend"`
Disk Disk `mapstructure:"disk"`
CS3 CS3 `mapstructure:"cs3"`
Backend string `ocisConfig:"backend"`
Disk Disk `ocisConfig:"disk"`
CS3 CS3 `ocisConfig:"cs3"`
}
// Disk is the local disk implementation of the storage.
type Disk struct {
Path string `mapstructure:"path"`
Path string `ocisConfig:"path"`
}
// CS3 is the cs3 implementation of the storage.
type CS3 struct {
ProviderAddr string `mapstructure:"provider_addr"`
DataURL string `mapstructure:"data_url"`
DataPrefix string `mapstructure:"data_prefix"`
JWTSecret string `mapstructure:"jwt_secret"`
ProviderAddr string `ocisConfig:"provider_addr"`
DataURL string `ocisConfig:"data_url"`
DataPrefix string `ocisConfig:"data_prefix"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
// ServiceUser defines the user required for EOS.
type ServiceUser struct {
UUID string `mapstructure:"uuid"`
Username string `mapstructure:"username"`
UID int64 `mapstructure:"uid"`
GID int64 `mapstructure:"gid"`
UUID string `ocisConfig:"uuid"`
Username string `ocisConfig:"username"`
UID int64 `ocisConfig:"uid"`
GID int64 `ocisConfig:"gid"`
}
// Index defines config for indexes.
type Index struct {
UID Bound `mapstructure:"uid"`
GID Bound `mapstructure:"gid"`
UID Bound `ocisConfig:"uid"`
GID Bound `ocisConfig:"gid"`
}
// Bound defines a lower and upper bound.
type Bound struct {
Lower int64 `mapstructure:"lower"`
Upper int64 `mapstructure:"upper"`
Lower int64 `ocisConfig:"lower"`
Upper int64 `ocisConfig:"upper"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Config merges all Account config parameters.
type Config struct {
*shared.Commons
LDAP LDAP `mapstructure:"ldap"`
HTTP HTTP `mapstructure:"http"`
GRPC GRPC `mapstructure:"grpc"`
Server Server `mapstructure:"server"`
Asset Asset `mapstructure:"asset"`
Log *shared.Log `mapstructure:"log"`
TokenManager TokenManager `mapstructure:"token_manager"`
Repo Repo `mapstructure:"repo"`
Index Index `mapstructure:"index"`
ServiceUser ServiceUser `mapstructure:"service_user"`
Tracing Tracing `mapstructure:"tracing"`
LDAP LDAP `ocisConfig:"ldap"`
HTTP HTTP `ocisConfig:"http"`
GRPC GRPC `ocisConfig:"grpc"`
Server Server `ocisConfig:"server"`
Asset Asset `ocisConfig:"asset"`
Log *shared.Log `ocisConfig:"log"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Repo Repo `ocisConfig:"repo"`
Index Index `ocisConfig:"index"`
ServiceUser ServiceUser `ocisConfig:"service_user"`
Tracing Tracing `ocisConfig:"tracing"`
Context context.Context
Supervised bool
+37 -37
View File
@@ -11,69 +11,69 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Namespace string `mapstructure:"namespace"`
Root string `mapstructure:"root"`
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
Root string `ocisConfig:"root"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Ldap defined the available LDAP configuration.
type Ldap struct {
Enabled bool `mapstructure:"enabled"`
Addr string `mapstructure:"addr"`
Enabled bool `ocisConfig:"enabled"`
Addr string `ocisConfig:"addr"`
}
// Ldaps defined the available LDAPS configuration.
type Ldaps struct {
Addr string `mapstructure:"addr"`
Enabled bool `mapstructure:"enabled"`
Cert string `mapstructure:"cert"`
Key string `mapstructure:"key"`
Addr string `ocisConfig:"addr"`
Enabled bool `ocisConfig:"enabled"`
Cert string `ocisConfig:"cert"`
Key string `ocisConfig:"key"`
}
// Backend defined the available backend configuration.
type Backend struct {
Datastore string `mapstructure:"datastore"`
BaseDN string `mapstructure:"base_dn"`
Insecure bool `mapstructure:"insecure"`
NameFormat string `mapstructure:"name_format"`
GroupFormat string `mapstructure:"group_format"`
Servers []string `mapstructure:"servers"`
SSHKeyAttr string `mapstructure:"ssh_key_attr"`
UseGraphAPI bool `mapstructure:"use_graph_api"`
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"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Tracing Tracing `mapstructure:"tracing"`
Ldap Ldap `mapstructure:"ldap"`
Ldaps Ldaps `mapstructure:"ldaps"`
Backend Backend `mapstructure:"backend"`
Fallback Backend `mapstructure:"fallback"`
Version string `mapstructure:"version"`
RoleBundleUUID string `mapstructure:"role_bundle_uuid"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Tracing Tracing `ocisConfig:"tracing"`
Ldap Ldap `ocisConfig:"ldap"`
Ldaps Ldaps `ocisConfig:"ldaps"`
Backend Backend `ocisConfig:"backend"`
Fallback Backend `ocisConfig:"fallback"`
Version string `ocisConfig:"version"`
RoleBundleUUID string `ocisConfig:"role_bundle_uuid"`
Context context.Context
Supervised bool
+25 -25
View File
@@ -8,51 +8,51 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
Namespace string `mapstructure:"namespace"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
Namespace string `ocisConfig:"namespace"`
}
// Server configures a server.
type Server struct {
Version string `mapstructure:"version"`
Name string `mapstructure:"name"`
Version string `ocisConfig:"version"`
Name string `ocisConfig:"name"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// GraphExplorer defines the available graph-explorer configuration.
type GraphExplorer struct {
ClientID string `mapstructure:"client_id"`
Issuer string `mapstructure:"issuer"`
GraphURLBase string `mapstructure:"graph_url_base"`
GraphURLPath string `mapstructure:"graph_url_path"`
ClientID string `ocisConfig:"client_id"`
Issuer string `ocisConfig:"issuer"`
GraphURLBase string `ocisConfig:"graph_url_base"`
GraphURLPath string `ocisConfig:"graph_url_path"`
}
// Config combines all available configuration parts.
type Config struct {
File string `mapstructure:"file"`
Log shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Server Server `mapstructure:"server"`
Tracing Tracing `mapstructure:"tracing"`
GraphExplorer GraphExplorer `mapstructure:"graph_explorer"`
File string `ocisConfig:"file"`
Log shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Server Server `ocisConfig:"server"`
Tracing Tracing `ocisConfig:"tracing"`
GraphExplorer GraphExplorer `ocisConfig:"graph_explorer"`
Context context.Context
Supervised bool
+28 -28
View File
@@ -8,63 +8,63 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Namespace string `mapstructure:"namespace"`
Root string `mapstructure:"root"`
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
Root string `ocisConfig:"root"`
}
// Server configures a server.
type Server struct {
Version string `mapstructure:"version"`
Name string `mapstructure:"name"`
Version string `ocisConfig:"version"`
Name string `ocisConfig:"name"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Reva defines all available REVA configuration.
type Reva struct {
Address string `mapstructure:"address"`
Address string `ocisConfig:"address"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `mapstructure:"jwt_secret"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
type Spaces struct {
WebDavBase string `mapstructure:"webdav_base"`
WebDavPath string `mapstructure:"webdav_path"`
DefaultQuota string `mapstructure:"default_quota"`
WebDavBase string `ocisConfig:"webdav_base"`
WebDavPath string `ocisConfig:"webdav_path"`
DefaultQuota string `ocisConfig:"default_quota"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Server Server `mapstructure:"server"`
Tracing Tracing `mapstructure:"tracing"`
Reva Reva `mapstructure:"reva"`
TokenManager TokenManager `mapstructure:"token_manager"`
Spaces Spaces `mapstructure:"spaces"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Server Server `ocisConfig:"server"`
Tracing Tracing `ocisConfig:"tracing"`
Reva Reva `ocisConfig:"reva"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Spaces Spaces `ocisConfig:"spaces"`
Context context.Context
Supervised bool
+69 -69
View File
@@ -11,104 +11,104 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
TLSCert string `mapstructure:"tls_cert"`
TLSKey string `mapstructure:"tls_key"`
TLS bool `mapstructure:"tls"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
TLSCert string `ocisConfig:"tls_cert"`
TLSKey string `ocisConfig:"tls_key"`
TLS bool `ocisConfig:"tls"`
}
// Ldap defines the available LDAP configuration.
type Ldap struct {
URI string `mapstructure:"uri"`
BindDN string `mapstructure:"bind_dn"`
BindPassword string `mapstructure:"bind_password"`
BaseDN string `mapstructure:"base_dn"`
Scope string `mapstructure:"scope"`
LoginAttribute string `mapstructure:"login_attribute"`
EmailAttribute string `mapstructure:"email_attribute"`
NameAttribute string `mapstructure:"name_attribute"`
UUIDAttribute string `mapstructure:"uuid_attribute"`
UUIDAttributeType string `mapstructure:"uuid_attribute_type"`
Filter string `mapstructure:"filter"`
URI string `ocisConfig:"uri"`
BindDN string `ocisConfig:"bind_dn"`
BindPassword string `ocisConfig:"bind_password"`
BaseDN string `ocisConfig:"base_dn"`
Scope string `ocisConfig:"scope"`
LoginAttribute string `ocisConfig:"login_attribute"`
EmailAttribute string `ocisConfig:"email_attribute"`
NameAttribute string `ocisConfig:"name_attribute"`
UUIDAttribute string `ocisConfig:"uuid_attribute"`
UUIDAttributeType string `ocisConfig:"uuid_attribute_type"`
Filter string `ocisConfig:"filter"`
}
// Service defines the available service configuration.
type Service struct {
Name string `mapstructure:"name"`
Namespace string `mapstructure:"namespace"`
Version string `mapstructure:"version"`
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Asset defines the available asset configuration.
type Asset struct {
Path string `mapstructure:"asset"`
Path string `ocisConfig:"asset"`
}
type Settings struct {
Iss string `mapstructure:"iss"`
IdentityManager string `mapstructure:"identity_manager"`
URIBasePath string `mapstructure:"uri_base_path"`
SignInURI string `mapstructure:"sign_in_uri"`
SignedOutURI string `mapstructure:"signed_out_uri"`
AuthorizationEndpointURI string `mapstructure:"authorization_endpoint_uri"`
EndsessionEndpointURI string `mapstructure:"end_session_endpoint_uri"`
Insecure bool `mapstructure:"insecure"`
TrustedProxy []string `mapstructure:"trusted_proxy"`
AllowScope []string `mapstructure:"allow_scope"`
AllowClientGuests bool `mapstructure:"allow_client_guests"`
AllowDynamicClientRegistration bool `mapstructure:"allow_dynamic_client_registration"`
EncryptionSecretFile string `mapstructure:"encrypt_secret_file"`
Listen string `mapstructure:"listen"`
IdentifierClientDisabled bool `mapstructure:"identifier_client_disabled"`
IdentifierClientPath string `mapstructure:"identifier_client_path"`
IdentifierRegistrationConf string `mapstructure:"identifier_registration_conf"`
IdentifierScopesConf string `mapstructure:"identifier_scopes_conf"`
IdentifierDefaultBannerLogo string `mapstructure:"identifier_default_banner_logo"`
IdentifierDefaultSignInPageText string `mapstructure:"identifier_default_sign_in_page_text"`
IdentifierDefaultUsernameHintText string `mapstructure:"identifier_default_username_hint_text"`
SigningKid string `mapstructure:"sign_in_kid"`
SigningMethod string `mapstructure:"sign_in_method"`
SigningPrivateKeyFiles []string `mapstructure:"sign_in_private_key_files"`
ValidationKeysPath string `mapstructure:"validation_keys_path"`
CookieBackendURI string `mapstructure:"cookie_backend_uri"`
CookieNames []string `mapstructure:"cookie_names"`
AccessTokenDurationSeconds uint64 `mapstructure:"access_token_duration_seconds"`
IDTokenDurationSeconds uint64 `mapstructure:"id_token_duration_seconds"`
RefreshTokenDurationSeconds uint64 `mapstructure:"refresh_token_duration_seconds"`
DyamicClientSecretDurationSeconds uint64 `mapstructure:"dynamic_client_secret_duration_seconds"`
Iss string `ocisConfig:"iss"`
IdentityManager string `ocisConfig:"identity_manager"`
URIBasePath string `ocisConfig:"uri_base_path"`
SignInURI string `ocisConfig:"sign_in_uri"`
SignedOutURI string `ocisConfig:"signed_out_uri"`
AuthorizationEndpointURI string `ocisConfig:"authorization_endpoint_uri"`
EndsessionEndpointURI string `ocisConfig:"end_session_endpoint_uri"`
Insecure bool `ocisConfig:"insecure"`
TrustedProxy []string `ocisConfig:"trusted_proxy"`
AllowScope []string `ocisConfig:"allow_scope"`
AllowClientGuests bool `ocisConfig:"allow_client_guests"`
AllowDynamicClientRegistration bool `ocisConfig:"allow_dynamic_client_registration"`
EncryptionSecretFile string `ocisConfig:"encrypt_secret_file"`
Listen string `ocisConfig:"listen"`
IdentifierClientDisabled bool `ocisConfig:"identifier_client_disabled"`
IdentifierClientPath string `ocisConfig:"identifier_client_path"`
IdentifierRegistrationConf string `ocisConfig:"identifier_registration_conf"`
IdentifierScopesConf string `ocisConfig:"identifier_scopes_conf"`
IdentifierDefaultBannerLogo string `ocisConfig:"identifier_default_banner_logo"`
IdentifierDefaultSignInPageText string `ocisConfig:"identifier_default_sign_in_page_text"`
IdentifierDefaultUsernameHintText string `ocisConfig:"identifier_default_username_hint_text"`
SigningKid string `ocisConfig:"sign_in_kid"`
SigningMethod string `ocisConfig:"sign_in_method"`
SigningPrivateKeyFiles []string `ocisConfig:"sign_in_private_key_files"`
ValidationKeysPath string `ocisConfig:"validation_keys_path"`
CookieBackendURI string `ocisConfig:"cookie_backend_uri"`
CookieNames []string `ocisConfig:"cookie_names"`
AccessTokenDurationSeconds uint64 `ocisConfig:"access_token_duration_seconds"`
IDTokenDurationSeconds uint64 `ocisConfig:"id_token_duration_seconds"`
RefreshTokenDurationSeconds uint64 `ocisConfig:"refresh_token_duration_seconds"`
DyamicClientSecretDurationSeconds uint64 `ocisConfig:"dynamic_client_secret_duration_seconds"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Tracing Tracing `mapstructure:"tracing"`
Asset Asset `mapstructure:"asset"`
IDP Settings `mapstructure:"idp"`
Ldap Ldap `mapstructure:"ldap"`
Service Service `mapstructure:"service"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Tracing Tracing `ocisConfig:"tracing"`
Asset Asset `ocisConfig:"asset"`
IDP Settings `ocisConfig:"idp"`
Ldap Ldap `ocisConfig:"ldap"`
Service Service `ocisConfig:"service"`
Context context.Context
Supervised bool
+39 -39
View File
@@ -20,35 +20,35 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string `mapstructure:"addr"`
Addr string `ocisConfig:"addr"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `mapstructure:"jwt_secret"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
const (
@@ -63,41 +63,41 @@ type Mode int
// Runtime configures the oCIS runtime when running in supervised mode.
type Runtime struct {
Port string `mapstructure:"port"`
Host string `mapstructure:"host"`
Extensions string `mapstructure:"extensions"`
Port string `ocisConfig:"port"`
Host string `ocisConfig:"host"`
Extensions string `ocisConfig:"extensions"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons `mapstructure:"shared"`
*shared.Commons `ocisConfig:"shared"`
Mode Mode // DEPRECATED
File string
OcisURL string `mapstructure:"ocis_url"`
OcisURL string `ocisConfig:"ocis_url"`
Registry string `mapstructure:"registry"`
Log shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
GRPC GRPC `mapstructure:"grpc"`
Tracing Tracing `mapstructure:"tracing"`
TokenManager TokenManager `mapstructure:"token_manager"`
Runtime Runtime `mapstructure:"runtime"`
Registry string `ocisConfig:"registry"`
Log shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
GRPC GRPC `ocisConfig:"grpc"`
Tracing Tracing `ocisConfig:"tracing"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Runtime Runtime `ocisConfig:"runtime"`
Accounts *accounts.Config `mapstructure:"accounts"`
GLAuth *glauth.Config `mapstructure:"glauth"`
Graph *graph.Config `mapstructure:"graph"`
GraphExplorer *graphExplorer.Config `mapstructure:"graph_explorer"`
IDP *idp.Config `mapstructure:"idp"`
OCS *ocs.Config `mapstructure:"ocs"`
Web *web.Config `mapstructure:"web"`
Proxy *proxy.Config `mapstructure:"proxy"`
Settings *settings.Config `mapstructure:"settings"`
Storage *storage.Config `mapstructure:"storage"`
Store *store.Config `mapstructure:"store"`
Thumbnails *thumbnails.Config `mapstructure:"thumbnails"`
WebDAV *webdav.Config `mapstructure:"webdav"`
Accounts *accounts.Config `ocisConfig:"accounts"`
GLAuth *glauth.Config `ocisConfig:"glauth"`
Graph *graph.Config `ocisConfig:"graph"`
GraphExplorer *graphExplorer.Config `ocisConfig:"graph_explorer"`
IDP *idp.Config `ocisConfig:"idp"`
OCS *ocs.Config `ocisConfig:"ocs"`
Web *web.Config `ocisConfig:"web"`
Proxy *proxy.Config `ocisConfig:"proxy"`
Settings *settings.Config `ocisConfig:"settings"`
Storage *storage.Config `ocisConfig:"storage"`
Store *store.Config `ocisConfig:"store"`
Thumbnails *thumbnails.Config `ocisConfig:"thumbnails"`
WebDAV *webdav.Config `ocisConfig:"webdav"`
}
// New initializes a new configuration with or without defaults.
+3
View File
@@ -69,6 +69,9 @@ func sanitizeExtensions(set []string, ext []string, f func(a, b string) bool) []
func BindSourcesToStructs(extension string, dst interface{}) (*gofig.Config, error) {
sources := DefaultConfigSources(extension, supportedExtensions)
cnf := gofig.NewWithOptions(extension, gofig.ParseEnv)
cnf.WithOptions(func(options *gofig.Options) {
options.DecoderConfig.TagName = "ocisConfig"
})
cnf.AddDriver(gooyaml.Driver)
cnf.AddDriver(goojson.Driver)
_ = cnf.LoadFiles(sources...)
+34 -34
View File
@@ -8,76 +8,76 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `mapstructure:"allowed_origins"`
AllowedMethods []string `mapstructure:"allowed_methods"`
AllowedHeaders []string `mapstructure:"allowed_headers"`
AllowCredentials bool `mapstructure:"allow_credentials"`
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allow_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
CORS CORS `mapstructure:"cors"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
CORS CORS `ocisConfig:"cors"`
}
// Service defines the available service configuration.
type Service struct {
Name string `mapstructure:"name"`
Namespace string `mapstructure:"namespace"`
Version string `mapstructure:"version"`
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Reva defines all available REVA configuration.
type Reva struct {
Address string `mapstructure:"address"`
Address string `ocisConfig:"address"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `mapstructure:"jwt_secret"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
// 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 `mapstructure:"address"`
Address string `ocisConfig:"address"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Tracing Tracing `mapstructure:"tracing"`
TokenManager TokenManager `mapstructure:"token_manager"`
Service Service `mapstructure:"service"`
AccountBackend string `mapstructure:"account_backend"`
Reva Reva `mapstructure:"reva"`
StorageUsersDriver string `mapstructure:"storage_users_driver"`
MachineAuthAPIKey string `mapstructure:"machine_auth_api_key"`
IdentityManagement IdentityManagement `mapstructure:"identity_management"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Tracing Tracing `ocisConfig:"tracing"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Service Service `ocisConfig:"service"`
AccountBackend string `ocisConfig:"account_backend"`
Reva Reva `ocisConfig:"reva"`
StorageUsersDriver string `ocisConfig:"storage_users_driver"`
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"`
IdentityManagement IdentityManagement `ocisConfig:"identity_management"`
Context context.Context
Supervised bool
+76 -76
View File
@@ -10,57 +10,57 @@ import (
// Log defines the available logging configuration.
type Log struct {
Level string `mapstructure:"level"`
Pretty bool `mapstructure:"pretty"`
Color bool `mapstructure:"color"`
File string `mapstructure:"file"`
Level string `ocisConfig:"level"`
Pretty bool `ocisConfig:"pretty"`
Color bool `ocisConfig:"color"`
File string `ocisConfig:"file"`
}
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
TLSCert string `mapstructure:"tls_cert"`
TLSKey string `mapstructure:"tls_key"`
TLS bool `mapstructure:"tls"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
TLSCert string `ocisConfig:"tls_cert"`
TLSKey string `ocisConfig:"tls_key"`
TLS bool `ocisConfig:"tls"`
}
// Service defines the available service configuration.
type Service struct {
Name string `mapstructure:"name"`
Namespace string `mapstructure:"namespace"`
Version string `mapstructure:"version"`
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Policy enables us to use multiple directors.
type Policy struct {
Name string `mapstructure:"name"`
Routes []Route `mapstructure:"routes"`
Name string `ocisConfig:"name"`
Routes []Route `ocisConfig:"routes"`
}
// Route define forwarding routes
type Route struct {
Type RouteType `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Backend string `mapstructure:"backend"`
ApacheVHost bool `mapstructure:"apache-vhost"`
Type RouteType `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Backend string `ocisConfig:"backend"`
ApacheVHost bool `ocisConfig:"apache-vhost"`
}
// RouteType defines the type of a route
@@ -84,48 +84,48 @@ var (
// Reva defines all available REVA configuration.
type Reva struct {
Address string `mapstructure:"address"`
Middleware Middleware `mapstructure:"middleware"`
Address string `ocisConfig:"address"`
Middleware Middleware `ocisConfig:"middleware"`
}
// Middleware configures proxy middlewares.
type Middleware struct {
Auth Auth `mapstructure:"middleware"`
Auth Auth `ocisConfig:"middleware"`
}
// Auth configures proxy http auth middleware.
type Auth struct {
CredentialsByUserAgent map[string]string `mapstructure:""`
CredentialsByUserAgent map[string]string `ocisConfig:""`
}
// Cache is a TTL cache configuration.
type Cache struct {
Size int `mapstructure:"size"`
TTL int `mapstructure:"ttl"`
Size int `ocisConfig:"size"`
TTL int `ocisConfig:"ttl"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Service Service `mapstructure:"service"`
Tracing Tracing `mapstructure:"tracing"`
Policies []Policy `mapstructure:"policies"`
OIDC OIDC `mapstructure:"oidc"`
TokenManager TokenManager `mapstructure:"token_manager"`
PolicySelector *PolicySelector `mapstructure:"policy_selector"`
Reva Reva `mapstructure:"reva"`
PreSignedURL PreSignedURL `mapstructure:"pre_signed_url"`
AccountBackend string `mapstructure:"account_backend"`
UserOIDCClaim string `mapstructure:"user_oidc_claim"`
UserCS3Claim string `mapstructure:"user_cs3_claim"`
MachineAuthAPIKey string `mapstructure:"machine_auth_api_key"`
AutoprovisionAccounts bool `mapstructure:"auto_provision_accounts"`
EnableBasicAuth bool `mapstructure:"enable_basic_auth"`
InsecureBackends bool `mapstructure:"insecure_backends"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Service Service `ocisConfig:"service"`
Tracing Tracing `ocisConfig:"tracing"`
Policies []Policy `ocisConfig:"policies"`
OIDC OIDC `ocisConfig:"oidc"`
TokenManager TokenManager `ocisConfig:"token_manager"`
PolicySelector *PolicySelector `ocisConfig:"policy_selector"`
Reva Reva `ocisConfig:"reva"`
PreSignedURL PreSignedURL `ocisConfig:"pre_signed_url"`
AccountBackend string `ocisConfig:"account_backend"`
UserOIDCClaim string `ocisConfig:"user_oidc_claim"`
UserCS3Claim string `ocisConfig:"user_cs3_claim"`
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"`
AutoprovisionAccounts bool `ocisConfig:"auto_provision_accounts"`
EnableBasicAuth bool `ocisConfig:"enable_basic_auth"`
InsecureBackends bool `ocisConfig:"insecure_backends"`
Context context.Context
Supervised bool
@@ -134,62 +134,62 @@ type Config struct {
// 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 `mapstructure:"issuer"`
Insecure bool `mapstructure:"insecure"`
UserinfoCache Cache `mapstructure:"user_info_cache"`
Issuer string `ocisConfig:"issuer"`
Insecure bool `ocisConfig:"insecure"`
UserinfoCache Cache `ocisConfig:"user_info_cache"`
}
// PolicySelector is the toplevel-configuration for different selectors
type PolicySelector struct {
Static *StaticSelectorConf `mapstructure:"static"`
Migration *MigrationSelectorConf `mapstructure:"migration"`
Claims *ClaimsSelectorConf `mapstructure:"claims"`
Regex *RegexSelectorConf `mapstructure:"regex"`
Static *StaticSelectorConf `ocisConfig:"static"`
Migration *MigrationSelectorConf `ocisConfig:"migration"`
Claims *ClaimsSelectorConf `ocisConfig:"claims"`
Regex *RegexSelectorConf `ocisConfig:"regex"`
}
// StaticSelectorConf is the config for the static-policy-selector
type StaticSelectorConf struct {
Policy string `mapstructure:"policy"`
Policy string `ocisConfig:"policy"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string `mapstructure:"jwt_secret"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
// PreSignedURL is the config for the presigned url middleware
type PreSignedURL struct {
AllowedHTTPMethods []string `mapstructure:"allowed_http_methods"`
Enabled bool `mapstructure:"enabled"`
AllowedHTTPMethods []string `ocisConfig:"allowed_http_methods"`
Enabled bool `ocisConfig:"enabled"`
}
// MigrationSelectorConf is the config for the migration-selector
type MigrationSelectorConf struct {
AccFoundPolicy string `mapstructure:"acc_found_policy"`
AccNotFoundPolicy string `mapstructure:"acc_not_found_policy"`
UnauthenticatedPolicy string `mapstructure:"unauthenticated_policy"`
AccFoundPolicy string `ocisConfig:"acc_found_policy"`
AccNotFoundPolicy string `ocisConfig:"acc_not_found_policy"`
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
}
// ClaimsSelectorConf is the config for the claims-selector
type ClaimsSelectorConf struct {
DefaultPolicy string `mapstructure:"default_policy"`
UnauthenticatedPolicy string `mapstructure:"unauthenticated_policy"`
SelectorCookieName string `mapstructure:"selector_cookie_name"`
DefaultPolicy string `ocisConfig:"default_policy"`
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
SelectorCookieName string `ocisConfig:"selector_cookie_name"`
}
// RegexSelectorConf is the config for the regex-selector
type RegexSelectorConf struct {
DefaultPolicy string `mapstructure:"default_policy"`
MatchesPolicies []RegexRuleConf `mapstructure:"matches_policies"`
UnauthenticatedPolicy string `mapstructure:"unauthenticated_policy"`
SelectorCookieName string `mapstructure:"selector_cookie_name"`
DefaultPolicy string `ocisConfig:"default_policy"`
MatchesPolicies []RegexRuleConf `ocisConfig:"matches_policies"`
UnauthenticatedPolicy string `ocisConfig:"unauthenticated_policy"`
SelectorCookieName string `ocisConfig:"selector_cookie_name"`
}
type RegexRuleConf struct {
Priority int `mapstructure:"priority"`
Property string `mapstructure:"property"`
Match string `mapstructure:"match"`
Policy string `mapstructure:"policy"`
Priority int `ocisConfig:"priority"`
Property string `ocisConfig:"property"`
Match string `ocisConfig:"match"`
Policy string `ocisConfig:"policy"`
}
// New initializes a new configuration
+34 -34
View File
@@ -11,74 +11,74 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string
Token string
Pprof bool
Zpages bool
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
AllowCredentials bool
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allow_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Namespace string
Root string
CacheTTL int
CORS CORS
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
Root string `ocisConfig:"root"`
CacheTTL int `ocisConfig:"cache_ttl"`
CORS CORS `ocisConfig:"cors"`
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string
Namespace string
Addr string `ocisConfig:"grpc"`
Namespace string `ocisConfig:"namespace"`
}
// Service provides configuration options for the service
type Service struct {
Name string
Version string
DataPath string
Name string `ocisConfig:"name"`
Version string `ocisConfig:"version"`
DataPath string `ocisConfig:"data_path"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool
Type string
Endpoint string
Collector string
Service string
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Asset undocumented
type Asset struct {
Path string
Path string `ocisConfig:"asset"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string
JWTSecret string `ocisConfig:"jwt_secret"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string
Service Service
Log *shared.Log
Debug Debug
HTTP HTTP
GRPC GRPC
Tracing Tracing
Asset Asset
TokenManager TokenManager
File string `ocisConfig:"file"`
Service Service `ocisConfig:"service"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
GRPC GRPC `ocisConfig:"grpc"`
Tracing Tracing `ocisConfig:"tracing"`
Asset Asset `ocisConfig:"asset"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Context context.Context
Supervised bool
+252 -252
View File
@@ -12,113 +12,113 @@ import (
// Log defines the available logging configuration.
type Log struct {
Level string `mapstructure:"level"`
Pretty bool `mapstructure:"pretty"`
Color bool `mapstructure:"color"`
File string `mapstructure:"file"`
Level string `ocisConfig:"level"`
Pretty bool `ocisConfig:"pretty"`
Color bool `ocisConfig:"color"`
File string `ocisConfig:"file"`
}
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// Gateway defines the available gateway configuration.
type Gateway struct {
Port
CommitShareToStorageGrant bool `mapstructure:"commit_share_to_storage_grant"`
CommitShareToStorageRef bool `mapstructure:"commit_share_to_storage_ref"`
DisableHomeCreationOnLogin bool `mapstructure:"disable_home_creation_on_login"`
ShareFolder string `mapstructure:"share_folder"`
LinkGrants string `mapstructure:"link_grants"`
HomeMapping string `mapstructure:"home_mapping"`
EtagCacheTTL int `mapstructure:"etag_cache_ttl"`
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"`
}
// StorageRegistry defines the available storage registry configuration
type StorageRegistry struct {
Driver string `mapstructure:"driver"`
Driver string `ocisConfig:"driver"`
// HomeProvider is the path in the global namespace that the static storage registry uses to determine the home storage
HomeProvider string `mapstructure:"home_provider"`
Rules []string `mapstructure:"rules"`
JSON string `mapstructure:"json"`
HomeProvider string `ocisConfig:"home_provider"`
Rules []string `ocisConfig:"rules"`
JSON string `ocisConfig:"json"`
}
// AppRegistry defines the available app registry configuration
type AppRegistry struct {
Driver string `mapstructure:"driver"`
MimetypesJSON string `mapstructure:"mime_types_json"`
Driver string `ocisConfig:"driver"`
MimetypesJSON string `ocisConfig:"mime_types_json"`
}
// AppProvider defines the available app provider configuration
type AppProvider struct {
Port
ExternalAddr string `mapstructure:"external_addr"`
Driver string `mapstructure:"driver"`
WopiDriver WopiDriver `mapstructure:"wopi_driver"`
AppsURL string `mapstructure:"apps_url"`
OpenURL string `mapstructure:"open_url"`
ExternalAddr string `ocisConfig:"external_addr"`
Driver string `ocisConfig:"driver"`
WopiDriver WopiDriver `ocisConfig:"wopi_driver"`
AppsURL string `ocisConfig:"apps_url"`
OpenURL string `ocisConfig:"open_url"`
}
type WopiDriver struct {
AppAPIKey string `mapstructure:"app_api_key"`
AppDesktopOnly bool `mapstructure:"app_desktop_only"`
AppIconURI string `mapstructure:"app_icon_uri"`
AppInternalURL string `mapstructure:"app_internal_url"`
AppName string `mapstructure:"app_name"`
AppURL string `mapstructure:"app_url"`
Insecure bool `mapstructure:"insecure"`
IopSecret string `mapstructure:"ipo_secret"`
JWTSecret string `mapstructure:"jwt_secret"`
WopiURL string `mapstructure:"wopi_url"`
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"`
}
// Sharing defines the available sharing configuration.
type Sharing struct {
Port
UserDriver string `mapstructure:"user_driver"`
UserJSONFile string `mapstructure:"user_json_file"`
UserSQLUsername string `mapstructure:"user_sql_username"`
UserSQLPassword string `mapstructure:"user_sql_password"`
UserSQLHost string `mapstructure:"user_sql_host"`
UserSQLPort int `mapstructure:"user_sql_port"`
UserSQLName string `mapstructure:"user_sql_name"`
PublicDriver string `mapstructure:"public_driver"`
PublicJSONFile string `mapstructure:"public_json_file"`
PublicPasswordHashCost int `mapstructure:"public_password_hash_cost"`
PublicEnableExpiredSharesCleanup bool `mapstructure:"public_enable_expired_shares_cleanup"`
PublicJanitorRunInterval int `mapstructure:"public_janitor_run_interval"`
UserStorageMountID string `mapstructure:"user_storage_mount_id"`
UserDriver string `ocisConfig:"user_driver"`
UserJSONFile string `ocisConfig:"user_json_file"`
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"`
}
// Port defines the available port configuration.
type Port struct {
// MaxCPUs can be a number or a percentage
MaxCPUs string `mapstructure:"max_cpus"`
LogLevel string `mapstructure:"log_level"`
MaxCPUs string `ocisConfig:"max_cpus"`
LogLevel string `ocisConfig:"log_level"`
// GRPCNetwork can be tcp, udp or unix
GRPCNetwork string `mapstructure:"grpc_network"`
GRPCNetwork string `ocisConfig:"grpc_network"`
// GRPCAddr to listen on, hostname:port (0.0.0.0:9999 for all interfaces) or socket (/var/run/reva/sock)
GRPCAddr string `mapstructure:"grpc_addr"`
GRPCAddr string `ocisConfig:"grpc_addr"`
// Protocol can be grpc or http
// HTTPNetwork can be tcp, udp or unix
HTTPNetwork string `mapstructure:"http_network"`
HTTPNetwork string `ocisConfig:"http_network"`
// HTTPAddr to listen on, hostname:port (0.0.0.0:9100 for all interfaces) or socket (/var/run/reva/sock)
HTTPAddr string `mapstructure:"http_addr"`
HTTPAddr string `ocisConfig:"http_addr"`
// Protocol can be grpc or http
Protocol string `mapstructure:"protocol"`
Protocol string `ocisConfig:"protocol"`
// Endpoint is used by the gateway and registries (eg localhost:9100 or cloud.example.com)
Endpoint string `mapstructure:"endpoint"`
Endpoint string `ocisConfig:"endpoint"`
// DebugAddr for the debug endpoint to bind to
DebugAddr string `mapstructure:"debug_addr"`
DebugAddr string `ocisConfig:"debug_addr"`
// Services can be used to give a list of services that should be started on this port
Services []string `mapstructure:"services"`
Services []string `ocisConfig:"services"`
// Config can be used to configure the reva instance.
// Services and Protocol will be ignored if this is used
Config map[string]interface{} `mapstructure:"config"`
Config map[string]interface{} `ocisConfig:"config"`
// Context allows for context cancellation and propagation
Context context.Context
@@ -130,113 +130,113 @@ type Port struct {
// Users defines the available users configuration.
type Users struct {
Port
Driver string `mapstucture:"driver"`
JSON string `mapstucture:"json"`
UserGroupsCacheExpiration int `mapstucture:"user_groups_cache_expiration"`
Driver string `ocisConfig:"driver"`
JSON string `ocisConfig:"json"`
UserGroupsCacheExpiration int `ocisConfig:"user_groups_cache_expiration"`
}
// AuthMachineConfig defines the available configuration for the machine auth driver.
type AuthMachineConfig struct {
MachineAuthAPIKey string `mapstucture:"machine_auth_api_key"`
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"`
}
// Groups defines the available groups configuration.
type Groups struct {
Port
Driver string `mapstucture:"driver"`
JSON string `mapstucture:"json"`
GroupMembersCacheExpiration int `mapstucture:"group_members_cache_expiration"`
Driver string `ocisConfig:"driver"`
JSON string `ocisConfig:"json"`
GroupMembersCacheExpiration int `ocisConfig:"group_members_cache_expiration"`
}
// FrontendPort defines the available frontend configuration.
type FrontendPort struct {
Port
AppProviderInsecure bool `mapstucture:"app_provider_insecure"`
AppProviderPrefix string `mapstucture:"app_provider_prefix"`
ArchiverInsecure bool `mapstucture:"archiver_insecure"`
ArchiverPrefix string `mapstucture:"archiver_prefix"`
DatagatewayPrefix string `mapstucture:"data_gateway_prefix"`
Favorites bool `mapstucture:"favorites"`
OCDavInsecure bool `mapstucture:"ocdav_insecure"`
OCDavPrefix string `mapstucture:"ocdav_prefix"`
OCSPrefix string `mapstucture:"ocs_prefix"`
OCSSharePrefix string `mapstucture:"ocs_share_prefix"`
OCSHomeNamespace string `mapstucture:"ocs_home_namespace"`
PublicURL string `mapstucture:"public_url"`
OCSCacheWarmupDriver string `mapstucture:"ocs_cache_warmup_driver"`
OCSAdditionalInfoAttribute string `mapstucture:"ocs_additional_info_attribute"`
OCSResourceInfoCacheTTL int `mapstucture:"ocs_resource_info_cache_ttl"`
Middleware Middleware `mapstucture:"middleware"`
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"`
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"`
}
// Middleware configures reva middlewares.
type Middleware struct {
Auth Auth `mapstructure:"auth"`
Auth Auth `ocisConfig:"auth"`
}
// Auth configures reva http auth middleware.
type Auth struct {
CredentialsByUserAgent map[string]string `mapstructure:"credentials_by_user_agenr"`
CredentialsByUserAgent map[string]string `ocisConfig:"credentials_by_user_agenr"`
}
// DataGatewayPort has a public url
type DataGatewayPort struct {
Port
PublicURL string `mapstructure:""`
PublicURL string `ocisConfig:""`
}
type DataProvider struct {
Insecure bool `mapstructure:"insecure"`
Insecure bool `ocisConfig:"insecure"`
}
// StoragePort defines the available storage configuration.
type StoragePort struct {
Port
Driver string `mapstructure:"driver"`
MountPath string `mapstructure:"mount_path"`
MountID string `mapstructure:"mount_id"`
ExposeDataServer bool `mapstructure:"expose_data_server"`
Driver string `ocisConfig:"driver"`
MountPath string `ocisConfig:"mount_path"`
MountID string `ocisConfig:"mount_id"`
ExposeDataServer bool `ocisConfig:"expose_data_server"`
// url the data gateway will use to route requests
DataServerURL string `mapstructure:"data_server_url"`
DataServerURL string `ocisConfig:"data_server_url"`
// for HTTP ports with only one http service
HTTPPrefix string `mapstructure:"http_prefix"`
TempFolder string `mapstructure:"temp_folder"`
ReadOnly bool `mapstructure:"read_only"`
DataProvider DataProvider `mapstructure:"data_provider"`
HTTPPrefix string `ocisConfig:"http_prefix"`
TempFolder string `ocisConfig:"temp_folder"`
ReadOnly bool `ocisConfig:"read_only"`
DataProvider DataProvider `ocisConfig:"data_provider"`
}
// PublicStorage configures a public storage provider
type PublicStorage struct {
StoragePort
PublicShareProviderAddr string `mapstructure:"public_share_provider_addr"`
UserProviderAddr string `mapstructure:"user_provider_addr"`
PublicShareProviderAddr string `ocisConfig:"public_share_provider_addr"`
UserProviderAddr string `ocisConfig:"user_provider_addr"`
}
// StorageConfig combines all available storage driver configuration parts.
type StorageConfig struct {
EOS DriverEOS `mapstructure:"eos"`
Local DriverCommon `mapstructure:"local"`
OwnCloud DriverOwnCloud `mapstructure:"owncloud"`
OwnCloudSQL DriverOwnCloudSQL `mapstructure:"owncloud_sql"`
S3 DriverS3 `mapstructure:"s3"`
S3NG DriverS3NG `mapstructure:"s3ng"`
OCIS DriverOCIS `mapstructure:"ocis"`
EOS DriverEOS `ocisConfig:"eos"`
Local DriverCommon `ocisConfig:"local"`
OwnCloud DriverOwnCloud `ocisConfig:"owncloud"`
OwnCloudSQL DriverOwnCloudSQL `ocisConfig:"owncloud_sql"`
S3 DriverS3 `ocisConfig:"s3"`
S3NG DriverS3NG `ocisConfig:"s3ng"`
OCIS DriverOCIS `ocisConfig:"ocis"`
}
// DriverCommon defines common driver configuration options.
type DriverCommon struct {
// Root is the absolute path to the location of the data
Root string `mapstructure:"root"`
Root string `ocisConfig:"root"`
//ShareFolder defines the name of the folder jailing all shares
ShareFolder string `mapstructure:"share_folder"`
ShareFolder string `ocisConfig:"share_folder"`
// UserLayout contains the template used to construct
// the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}`
UserLayout string `mapstructure:"user_layout"`
UserLayout string `ocisConfig:"user_layout"`
// EnableHome enables the creation of home directories.
EnableHome bool `mapstructure:"enable_home"`
EnableHome bool `ocisConfig:"enable_home"`
}
// DriverEOS defines the available EOS driver configuration.
@@ -244,273 +244,273 @@ type DriverEOS struct {
DriverCommon
// ShadowNamespace for storing shadow data
ShadowNamespace string `mapstructure:"shadow_namespace"`
ShadowNamespace string `ocisConfig:"shadow_namespace"`
// UploadsNamespace for storing upload data
UploadsNamespace string `mapstructure:"uploads_namespace"`
UploadsNamespace string `ocisConfig:"uploads_namespace"`
// Location of the eos binary.
// Default is /usr/bin/eos.
EosBinary string `mapstructure:"eos_binary"`
EosBinary string `ocisConfig:"eos_binary"`
// Location of the xrdcopy binary.
// Default is /usr/bin/xrdcopy.
XrdcopyBinary string `mapstructure:"xrd_copy_binary"`
XrdcopyBinary string `ocisConfig:"xrd_copy_binary"`
// URL of the Master EOS MGM.
// Default is root://eos-example.org
MasterURL string `mapstructure:"master_url"`
MasterURL string `ocisConfig:"master_url"`
// URI of the EOS MGM grpc server
// Default is empty
GrpcURI string `mapstructure:"grpc_uri"`
GrpcURI string `ocisConfig:"grpc_uri"`
// URL of the Slave EOS MGM.
// Default is root://eos-example.org
SlaveURL string `mapstructure:"slave_url"`
SlaveURL string `ocisConfig:"slave_url"`
// Location on the local fs where to store reads.
// Defaults to os.TempDir()
CacheDirectory string `mapstructure:"cache_directory"`
CacheDirectory string `ocisConfig:"cache_directory"`
// Enables logging of the commands executed
// Defaults to false
EnableLogging bool `mapstructure:"enable_logging"`
EnableLogging bool `ocisConfig:"enable_logging"`
// ShowHiddenSysFiles shows internal EOS files like
// .sys.v# and .sys.a# files.
ShowHiddenSysFiles bool `mapstructure:"shadow_hidden_files"`
ShowHiddenSysFiles bool `ocisConfig:"shadow_hidden_files"`
// ForceSingleUserMode will force connections to EOS to use SingleUsername
ForceSingleUserMode bool `mapstructure:"force_single_user_mode"`
ForceSingleUserMode bool `ocisConfig:"force_single_user_mode"`
// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
UseKeytab bool `mapstructure:"user_keytab"`
UseKeytab bool `ocisConfig:"user_keytab"`
// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
SecProtocol string `mapstructure:"sec_protocol"`
SecProtocol string `ocisConfig:"sec_protocol"`
// Keytab specifies the location of the keytab to use to authenticate to EOS.
Keytab string `mapstructure:"keytab"`
Keytab string `ocisConfig:"keytab"`
// SingleUsername is the username to use when SingleUserMode is enabled
SingleUsername string `mapstructure:"single_username"`
SingleUsername string `ocisConfig:"single_username"`
// gateway service to use for uid lookups
GatewaySVC string `mapstructure:"gateway_svc"`
GatewaySVC string `ocisConfig:"gateway_svc"`
}
// DriverOCIS defines the available oCIS storage driver configuration.
type DriverOCIS struct {
DriverCommon
ServiceUserUUID string `mapstructure:"service_user_uuid"`
ServiceUserUUID string `ocisConfig:"service_user_uuid"`
}
// DriverOwnCloud defines the available ownCloud storage driver configuration.
type DriverOwnCloud struct {
DriverCommon
UploadInfoDir string `mapstructure:"upload_info_dir"`
Redis string `mapstructure:"redis"`
Scan bool `mapstructure:"scan"`
UploadInfoDir string `ocisConfig:"upload_info_dir"`
Redis string `ocisConfig:"redis"`
Scan bool `ocisConfig:"scan"`
}
// DriverOwnCloudSQL defines the available ownCloudSQL storage driver configuration.
type DriverOwnCloudSQL struct {
DriverCommon
UploadInfoDir string `mapstructure:"upload_info_dir"`
DBUsername string `mapstructure:"db_username"`
DBPassword string `mapstructure:"db_password"`
DBHost string `mapstructure:"db_host"`
DBPort int `mapstructure:"db_port"`
DBName string `mapstructure:"db_name"`
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"`
}
// DriverS3 defines the available S3 storage driver configuration.
type DriverS3 struct {
DriverCommon
Region string `mapstructure:"region"`
AccessKey string `mapstructure:"access_key"`
SecretKey string `mapstructure:"secret_key"`
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
Region string `ocisConfig:"region"`
AccessKey string `ocisConfig:"access_key"`
SecretKey string `ocisConfig:"secret_key"`
Endpoint string `ocisConfig:"endpoint"`
Bucket string `ocisConfig:"bucket"`
}
// DriverS3NG defines the available s3ng storage driver configuration.
type DriverS3NG struct {
DriverCommon
Region string `mapstructure:"region"`
AccessKey string `mapstructure:"access_key"`
SecretKey string `mapstructure:"secret_key"`
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
Region string `ocisConfig:"region"`
AccessKey string `ocisConfig:"access_key"`
SecretKey string `ocisConfig:"secret_key"`
Endpoint string `ocisConfig:"endpoint"`
Bucket string `ocisConfig:"bucket"`
}
// OIDC defines the available OpenID Connect configuration.
type OIDC struct {
Issuer string `mapstructure:"issuer"`
Insecure bool `mapstructure:"insecure"`
IDClaim string `mapstructure:"id_claim"`
UIDClaim string `mapstructure:"uid_claim"`
GIDClaim string `mapstructure:"gid_claim"`
Issuer string `ocisConfig:"issuer"`
Insecure bool `ocisConfig:"insecure"`
IDClaim string `ocisConfig:"id_claim"`
UIDClaim string `ocisConfig:"uid_claim"`
GIDClaim string `ocisConfig:"gid_claim"`
}
// LDAP defines the available ldap configuration.
type LDAP struct {
Hostname string `mapstructure:"hostname"`
Port int `mapstructure:"port"`
CACert string `mapstructure:"ca_cert"`
Insecure bool `mapstructure:"insecure"`
BaseDN string `mapstructure:"base_dn"`
LoginFilter string `mapstructure:"login_filter"`
UserFilter string `mapstructure:"user_filter"`
UserAttributeFilter string `mapstructure:"user_attribute_filter"`
UserFindFilter string `mapstructure:"user_find_filter"`
UserGroupFilter string `mapstructure:"user_group_filter"`
GroupFilter string `mapstructure:"group_filter"`
GroupAttributeFilter string `mapstructure:"group_attribute_filter"`
GroupFindFilter string `mapstructure:"group_finder_filter"`
GroupMemberFilter string `mapstructure:"group_member_filter"`
BindDN string `mapstructure:"bind_dn"`
BindPassword string `mapstructure:"bind_password"`
IDP string `mapstructure:"idp"`
UserSchema LDAPUserSchema `mapstructure:"user_schema"`
GroupSchema LDAPGroupSchema `mapstructure:"group_schema"`
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"`
}
// UserGroupRest defines the REST driver specification for user and group resolution.
type UserGroupRest struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
RedisAddress string `mapstructure:"redis_address"`
RedisUsername string `mapstructure:"redis_username"`
RedisPassword string `mapstructure:"redis_password"`
IDProvider string `mapstructure:"idp_provider"`
APIBaseURL string `mapstructure:"api_base_url"`
OIDCTokenEndpoint string `mapstructure:"oidc_token_endpoint"`
TargetAPI string `mapstructure:"target_api"`
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"`
}
// UserOwnCloudSQL defines the available ownCloudSQL user provider configuration.
type UserOwnCloudSQL struct {
DBUsername string `mapstructure:"db_username"`
DBPassword string `mapstructure:"db_password"`
DBHost string `mapstructure:"db_host"`
DBPort int `mapstructure:"db_port"`
DBName string `mapstructure:"db_name"`
Idp string `mapstructure:"idp"`
Nobody int64 `mapstructure:"nobody"`
JoinUsername bool `mapstructure:"join_username"`
JoinOwnCloudUUID bool `mapstructure:"join_owncloud_uuid"`
EnableMedialSearch bool `mapstructure:"enable_medial_search"`
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"`
}
// LDAPUserSchema defines the available ldap user schema configuration.
type LDAPUserSchema struct {
UID string `mapstructure:"uid"`
Mail string `mapstructure:"mail"`
DisplayName string `mapstructure:"display_name"`
CN string `mapstructure:"cn"`
UIDNumber string `mapstructure:"uid_number"`
GIDNumber string `mapstructure:"gid_number"`
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"`
}
// LDAPGroupSchema defines the available ldap group schema configuration.
type LDAPGroupSchema struct {
GID string `mapstructure:"gid"`
Mail string `mapstructure:"mail"`
DisplayName string `mapstructure:"display_name"`
CN string `mapstructure:"cn"`
GIDNumber string `mapstructure:"gid_number"`
GID string `ocisConfig:"gid"`
Mail string `ocisConfig:"mail"`
DisplayName string `ocisConfig:"display_name"`
CN string `ocisConfig:"cn"`
GIDNumber string `ocisConfig:"gid_number"`
}
// OCDav defines the available ocdav configuration.
type OCDav struct {
WebdavNamespace string `mapstructure:"webdav_namespace"`
DavFilesNamespace string `mapstructure:"dav_files_namespace"`
WebdavNamespace string `ocisConfig:"webdav_namespace"`
DavFilesNamespace string `ocisConfig:"dav_files_namespace"`
}
// Archiver defines the available archiver configuration.
type Archiver struct {
MaxNumFiles int64 `mapstructure:"max_num_files"`
MaxSize int64 `mapstructure:"max_size"`
ArchiverURL string `mapstructure:"archiver_url"`
MaxNumFiles int64 `ocisConfig:"max_num_files"`
MaxSize int64 `ocisConfig:"max_size"`
ArchiverURL string `ocisConfig:"archiver_url"`
}
// Reva defines the available reva configuration.
type Reva struct {
// JWTSecret used to sign jwt tokens between services
JWTSecret string `mapstructure:"jwt_secret"`
SkipUserGroupsInToken bool `mapstructure:"skip_user_grooups_in_token"`
TransferSecret string `mapstructure:"transfer_secret"`
TransferExpires int `mapstructure:"transfer_expires"`
OIDC OIDC `mapstructure:"oidc"`
LDAP LDAP `mapstructure:"ldap"`
UserGroupRest UserGroupRest `mapstructure:"user_group_rest"`
UserOwnCloudSQL UserOwnCloudSQL `mapstructure:"user_owncloud_sql"`
OCDav OCDav `mapstructure:"ocdav"`
Archiver Archiver `mapstructure:"archiver"`
UserStorage StorageConfig `mapstructure:"user_storage"`
MetadataStorage StorageConfig `mapstructure:"metadata_storage"`
JWTSecret string `ocisConfig:"jwt_secret"`
SkipUserGroupsInToken bool `ocisConfig:"skip_user_grooups_in_token"`
TransferSecret string `ocisConfig:"transfer_secret"`
TransferExpires int `ocisConfig:"transfer_expires"`
OIDC OIDC `ocisConfig:"oidc"`
LDAP LDAP `ocisConfig:"ldap"`
UserGroupRest UserGroupRest `ocisConfig:"user_group_rest"`
UserOwnCloudSQL UserOwnCloudSQL `ocisConfig:"user_owncloud_sql"`
OCDav OCDav `ocisConfig:"ocdav"`
Archiver Archiver `ocisConfig:"archiver"`
UserStorage StorageConfig `ocisConfig:"user_storage"`
MetadataStorage StorageConfig `ocisConfig:"metadata_storage"`
// Ports are used to configure which services to start on which port
Frontend FrontendPort `mapstructure:"frontend"`
DataGateway DataGatewayPort `mapstructure:"data_gateway"`
Gateway Gateway `mapstructure:"gateway"`
StorageRegistry StorageRegistry `mapstructure:"storage_registry"`
AppRegistry AppRegistry `mapstructure:"app_registry"`
Users Users `mapstructure:"users"`
Groups Groups `mapstructure:"groups"`
AuthProvider Users `mapstructure:"auth_provider"`
AuthBasic Port `mapstructure:"auth_basic"`
AuthBearer Port `mapstructure:"auth_bearer"`
AuthMachine Port `mapstructure:"auth_machine"`
AuthMachineConfig AuthMachineConfig `mapstructure:"auth_machine_config"`
Sharing Sharing `mapstructure:"sharing"`
StorageHome StoragePort `mapstructure:"storage_home"`
StorageUsers StoragePort `mapstructure:"storage_users"`
StoragePublicLink PublicStorage `mapstructure:"storage_public_link"`
StorageMetadata StoragePort `mapstructure:"storage_metadata"`
AppProvider AppProvider `mapstructure:"app_provider"`
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"`
StorageHome StoragePort `ocisConfig:"storage_home"`
StorageUsers StoragePort `ocisConfig:"storage_users"`
StoragePublicLink PublicStorage `ocisConfig:"storage_public_link"`
StorageMetadata StoragePort `ocisConfig:"storage_metadata"`
AppProvider AppProvider `ocisConfig:"app_provider"`
// Configs can be used to configure the reva instance.
// Services and Ports will be ignored if this is used
Configs map[string]interface{} `mapstructure:"configs"`
Configs map[string]interface{} `ocisConfig:"configs"`
// chunking and resumable upload config (TUS)
UploadMaxChunkSize int `mapstructure:"uppload_max_chunk_size"`
UploadHTTPMethodOverride string `mapstructure:"upload_http_method_override"`
UploadMaxChunkSize int `ocisConfig:"uppload_max_chunk_size"`
UploadHTTPMethodOverride string `ocisConfig:"upload_http_method_override"`
// checksumming capabilities
ChecksumSupportedTypes []string `mapstructure:"checksum_supported_types"`
ChecksumPreferredUploadType string `mapstructure:"checksum_preferred_upload_type"`
DefaultUploadProtocol string `mapstructure:"default_upload_protocol"`
ChecksumSupportedTypes []string `ocisConfig:"checksum_supported_types"`
ChecksumPreferredUploadType string `ocisConfig:"checksum_preferred_upload_type"`
DefaultUploadProtocol string `ocisConfig:"default_upload_protocol"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Asset defines the available asset configuration.
type Asset struct {
Path string `mapstructure:"path"`
Path string `ocisConfig:"path"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
Reva Reva `mapstructure:"reva"`
Tracing Tracing `mapstructure:"tracing"`
Asset Asset `mapstructure:"asset"`
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"`
}
// New initializes a new configuration with or without defaults.
+21 -21
View File
@@ -10,43 +10,43 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string
Token string
Pprof bool
Zpages bool
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string
Root string
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
}
// Service defines the available service configuration.
type Service struct {
Name string
Namespace string
Version string
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool
Type string
Endpoint string
Collector string
Service string
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Config combines all available configuration parts.
type Config struct {
File string
Log shared.Log
Debug Debug
GRPC GRPC
Tracing Tracing
Datapath string
Service Service
File string `ocisConfig:"file"`
Log shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
GRPC GRPC `ocisConfig:"grpc"`
Tracing Tracing `ocisConfig:"tracing"`
Datapath string `ocisConfig:"data_path"`
Service Service `ocisConfig:"service"`
Context context.Context
Supervised bool
+27 -27
View File
@@ -10,39 +10,39 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// Server defines the available server configuration.
type Server struct {
Name string `mapstructure:"name"`
Namespace string `mapstructure:"namespace"`
Address string `mapstructure:"address"`
Version string `mapstructure:"version"`
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Address string `ocisConfig:"address"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
Server Server `mapstructure:"server"`
Tracing Tracing `mapstructure:"tracing"`
Thumbnail Thumbnail `mapstructure:"thumbnail"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
Server Server `ocisConfig:"server"`
Tracing Tracing `ocisConfig:"tracing"`
Thumbnail Thumbnail `ocisConfig:"thumbnail"`
Context context.Context
Supervised bool
@@ -50,22 +50,22 @@ type Config struct {
// FileSystemStorage defines the available filesystem storage configuration.
type FileSystemStorage struct {
RootDirectory string `mapstructure:"root_directory"`
RootDirectory string `ocisConfig:"root_directory"`
}
// FileSystemSource defines the available filesystem source configuration.
type FileSystemSource struct {
BasePath string `mapstructure:"base_path"`
BasePath string `ocisConfig:"base_path"`
}
// Thumbnail defines the available thumbnail related configuration.
type Thumbnail struct {
Resolutions []string `mapstructure:"resolutions"`
FileSystemStorage FileSystemStorage `mapstructure:"filesystem_storage"`
WebdavAllowInsecure bool `mapstructure:"webdav_allow_insecure"`
CS3AllowInsecure bool `mapstructure:"cs3_allow_insecure"`
RevaGateway string `mapstructure:"reva_gateway"`
WebdavNamespace string `mapstructure:"webdav_namespace"`
Resolutions []string `ocisConfig:"resolutions"`
FileSystemStorage FileSystemStorage `ocisConfig:"filesystem_storage"`
WebdavAllowInsecure bool `ocisConfig:"webdav_allow_insecure"`
CS3AllowInsecure bool `ocisConfig:"cs3_allow_insecure"`
RevaGateway string `ocisConfig:"reva_gateway"`
WebdavNamespace string `ocisConfig:"webdav_namespace"`
}
// New initializes a new configuration with or without defaults.
+41 -41
View File
@@ -8,52 +8,52 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
Namespace string `mapstructure:"namespace"`
CacheTTL int `mapstructure:"cache_ttl"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
Namespace string `ocisConfig:"namespace"`
CacheTTL int `ocisConfig:"cache_ttl"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Asset defines the available asset configuration.
type Asset struct {
Path string `mapstructure:"path"`
Path string `ocisConfig:"path"`
}
// WebConfig defines the available web configuration for a dynamically rendered config.json.
type WebConfig struct {
Server string `json:"server,omitempty" mapstructure:"server"`
Theme string `json:"theme,omitempty" mapstructure:"theme"`
Version string `json:"version,omitempty" mapstructure:"version"`
OpenIDConnect OIDC `json:"openIdConnect,omitempty" mapstructure:"oids"`
Apps []string `json:"apps" mapstructure:"apps"`
ExternalApps []ExternalApp `json:"external_apps,omitempty" mapstructure:"external_apps"`
Options map[string]interface{} `json:"options,omitempty" mapstructure:"options"`
Server string `json:"server,omitempty" ocisConfig:"server"`
Theme string `json:"theme,omitempty" ocisConfig:"theme"`
Version string `json:"version,omitempty" ocisConfig:"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"`
}
// OIDC defines the available oidc configuration
type OIDC struct {
MetadataURL string `json:"metadata_url,omitempty" mapstructure:"metadata_url"`
Authority string `json:"authority,omitempty" mapstructure:"authority"`
ClientID string `json:"client_id,omitempty" mapstructure:"client_id"`
ResponseType string `json:"response_type,omitempty" mapstructure:"response_type"`
Scope string `json:"scope,omitempty" mapstructure:"scope"`
MetadataURL string `json:"metadata_url,omitempty" ocisConfig:"metadata_url"`
Authority string `json:"authority,omitempty" ocisConfig:"authority"`
ClientID string `json:"client_id,omitempty" ocisConfig:"client_id"`
ResponseType string `json:"response_type,omitempty" ocisConfig:"response_type"`
Scope string `json:"scope,omitempty" ocisConfig:"scope"`
}
// ExternalApp defines an external web app.
@@ -65,36 +65,36 @@ type OIDC struct {
// }
// }
type ExternalApp struct {
ID string `json:"id,omitempty" mapstructure:"id"`
Path string `json:"path,omitempty" mapstructure:"path"`
ID string `json:"id,omitempty" ocisConfig:"id"`
Path string `json:"path,omitempty" ocisConfig:"path"`
// Config is completely dynamic, because it depends on the extension
Config map[string]interface{} `json:"config,omitempty" mapstructure:"config"`
Config map[string]interface{} `json:"config,omitempty" ocisConfig:"config"`
}
// ExternalAppConfig defines an external web app configuration.
type ExternalAppConfig struct {
URL string `json:"url,omitempty" mapstructure:"url"`
URL string `json:"url,omitempty" ocisConfig:"url"`
}
// Web defines the available web configuration.
type Web struct {
Path string `mapstructure:"path"`
ThemeServer string `mapstructure:"theme_server"` // used to build Theme in WebConfig
ThemePath string `mapstructure:"theme_path"` // used to build Theme in WebConfig
Config WebConfig `mapstructure:"config"`
Path string `ocisConfig:"path"`
ThemeServer string `ocisConfig:"theme_server"` // used to build Theme in WebConfig
ThemePath string `ocisConfig:"theme_path"` // used to build Theme in WebConfig
Config WebConfig `ocisConfig:"config"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Tracing Tracing `mapstructure:"tracing"`
Asset Asset `mapstructure:"asset"`
Web Web `mapstructure:"web"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Tracing Tracing `ocisConfig:"tracing"`
Asset Asset `ocisConfig:"asset"`
Web Web `ocisConfig:"web"`
Context context.Context
Supervised bool
+27 -27
View File
@@ -8,55 +8,55 @@ import (
// Debug defines the available debug configuration.
type Debug struct {
Addr string `mapstructure:"addr"`
Token string `mapstructure:"token"`
Pprof bool `mapstructure:"pprof"`
Zpages bool `mapstructure:"zpages"`
Addr string `ocisConfig:"addr"`
Token string `ocisConfig:"token"`
Pprof bool `ocisConfig:"pprof"`
Zpages bool `ocisConfig:"zpages"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `mapstructure:"allowed_origins"`
AllowedMethods []string `mapstructure:"allowed_methods"`
AllowedHeaders []string `mapstructure:"allowed_headers"`
AllowCredentials bool `mapstructure:"allow_credentials"`
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allow_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `mapstructure:"addr"`
Root string `mapstructure:"root"`
CORS CORS `mapstructure:"cors"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
CORS CORS `ocisConfig:"cors"`
}
// Service defines the available service configuration.
type Service struct {
Name string `mapstructure:"name"`
Namespace string `mapstructure:"namespace"`
Version string `mapstructure:"version"`
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool `mapstructure:"enabled"`
Type string `mapstructure:"type"`
Endpoint string `mapstructure:"endpoint"`
Collector string `mapstructure:"collector"`
Service string `mapstructure:"service"`
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Config combines all available configuration parts.
type Config struct {
*shared.Commons
File string `mapstructure:"file"`
Log *shared.Log `mapstructure:"log"`
Debug Debug `mapstructure:"debug"`
HTTP HTTP `mapstructure:"http"`
Tracing Tracing `mapstructure:"tracing"`
Service Service `mapstructure:"service"`
OcisPublicURL string `mapstructure:"ocis_public_url"`
WebdavNamespace string `mapstructure:"webdav_namespace"`
File string `ocisConfig:"file"`
Log *shared.Log `ocisConfig:"log"`
Debug Debug `ocisConfig:"debug"`
HTTP HTTP `ocisConfig:"http"`
Tracing Tracing `ocisConfig:"tracing"`
Service Service `ocisConfig:"service"`
OcisPublicURL string `ocisConfig:"ocis_public_url"`
WebdavNamespace string `ocisConfig:"webdav_namespace"`
Context context.Context
Supervised bool