Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,127 @@
// Package revaconfig contains the config for the reva service
package revaconfig
import (
"strconv"
"strings"
"github.com/qsfera/server/pkg/generators"
"github.com/qsfera/server/services/storage-users/pkg/config"
)
// StorageUsersConfigFromStruct will adapt a КуСфера config struct into a reva mapstructure to start a reva service.
func StorageUsersConfigFromStruct(cfg *config.Config) map[string]any {
rcfg := map[string]any{
"core": map[string]any{
"graceful_shutdown_timeout": cfg.GracefulShutdownTimeout,
},
"shared": map[string]any{
"jwt_secret": cfg.TokenManager.JWTSecret,
"gatewaysvc": cfg.Reva.Address,
"skip_user_groups_in_token": cfg.SkipUserGroupsInToken,
"grpc_client_options": cfg.Reva.GetGRPCClientConfig(),
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
},
"grpc": map[string]any{
"network": cfg.GRPC.Protocol,
"address": cfg.GRPC.Addr,
"tls_settings": map[string]any{
"enabled": cfg.GRPC.TLS.Enabled,
"certificate": cfg.GRPC.TLS.Cert,
"key": cfg.GRPC.TLS.Key,
},
// TODO build services dynamically
"services": map[string]any{
"storageprovider": map[string]any{
"driver": cfg.Driver,
"drivers": StorageProviderDrivers(cfg),
"mount_id": cfg.MountID,
"expose_data_server": cfg.ExposeDataServer,
"data_server_url": cfg.DataServerURL,
"upload_expiration": cfg.UploadExpiration,
"events": map[string]any{
"nats_address": cfg.Events.Addr,
"nats_clusterid": cfg.Events.ClusterID,
"tls_insecure": cfg.Events.TLSInsecure,
"tls_root_ca_cert": cfg.Events.TLSRootCaCertPath,
"nats_enable_tls": cfg.Events.EnableTLS,
"nats_username": cfg.Events.AuthUsername,
"nats_password": cfg.Events.AuthPassword,
},
},
},
"interceptors": map[string]any{
"eventsmiddleware": map[string]any{
"group": "sharing",
"type": "nats",
"address": cfg.Events.Addr,
"clusterID": cfg.Events.ClusterID,
"tls-insecure": cfg.Events.TLSInsecure,
"tls-root-ca-cert": cfg.Events.TLSRootCaCertPath,
"enable-tls": cfg.Events.EnableTLS,
"name": generators.GenerateConnectionName(cfg.Service.Name, generators.NTypeBus),
"username": cfg.Events.AuthUsername,
"password": cfg.Events.AuthPassword,
},
"prometheus": map[string]any{
"namespace": "qsfera",
"subsystem": "storage_users",
},
},
},
"http": map[string]any{
"network": cfg.HTTP.Protocol,
"address": cfg.HTTP.Addr,
"middlewares": map[string]any{
"requestid": map[string]any{},
},
// TODO build services dynamically
"services": map[string]any{
"dataprovider": map[string]any{
"prefix": cfg.HTTP.Prefix,
"driver": cfg.Driver,
"drivers": DataProviderDrivers(cfg),
"nats_address": cfg.Events.Addr,
"nats_clusterID": cfg.Events.ClusterID,
"nats_tls_insecure": cfg.Events.TLSInsecure,
"nats_root_ca_cert_path": cfg.Events.TLSRootCaCertPath,
"nats_enable_tls": cfg.Events.EnableTLS,
"nats_username": cfg.Events.AuthUsername,
"nats_password": cfg.Events.AuthPassword,
"data_txs": map[string]any{
"simple": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
},
"spaces": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
},
"tus": map[string]any{
"cache_store": "noop",
"cache_database": "system",
"cache_table": "stat",
"cors_enabled": true,
// allow_origin is configured as a regex in tusd, so we concatenate the configured values into a regex
"cors_allow_origin": "(" + strings.ReplaceAll(strings.Join(cfg.HTTP.CORS.AllowedOrigins, "|"), "*", ".*") + ")",
"cors_allow_credentials": cfg.HTTP.CORS.AllowCredentials,
"cors_allow_methods": strings.Join(cfg.HTTP.CORS.AllowedMethods, ","),
"cors_allow_headers": strings.Join(cfg.HTTP.CORS.AllowedHeaders, ","),
"cors_max_age": strconv.FormatUint(uint64(cfg.HTTP.CORS.MaxAge), 10),
"cors_expose_headers": strings.Join(cfg.HTTP.CORS.ExposedHeaders, ","),
},
},
},
},
},
}
if cfg.ReadOnly {
gcfg := rcfg["grpc"].(map[string]any)
gcfg["interceptors"] = map[string]any{
"readonly": map[string]any{},
}
}
return rcfg
}
@@ -0,0 +1,393 @@
package revaconfig
import (
"github.com/qsfera/server/services/storage-users/pkg/config"
)
// EOS is the config mapping for the EOS storage driver
func EOS(cfg *config.Config) map[string]any {
return map[string]any{
"namespace": cfg.Drivers.EOS.Root,
"shadow_namespace": cfg.Drivers.EOS.ShadowNamespace,
"uploads_namespace": cfg.Drivers.EOS.UploadsNamespace,
"share_folder": cfg.Drivers.EOS.ShareFolder,
"eos_binary": cfg.Drivers.EOS.EosBinary,
"xrdcopy_binary": cfg.Drivers.EOS.XrdcopyBinary,
"master_url": cfg.Drivers.EOS.MasterURL,
"slave_url": cfg.Drivers.EOS.SlaveURL,
"cache_directory": cfg.Drivers.EOS.CacheDirectory,
"sec_protocol": cfg.Drivers.EOS.SecProtocol,
"keytab": cfg.Drivers.EOS.Keytab,
"single_username": cfg.Drivers.EOS.SingleUsername,
"enable_logging": cfg.Drivers.EOS.EnableLogging,
"show_hidden_sys_files": cfg.Drivers.EOS.ShowHiddenSysFiles,
"force_single_user_mode": cfg.Drivers.EOS.ForceSingleUserMode,
"use_keytab": cfg.Drivers.EOS.UseKeytab,
"gatewaysvc": cfg.Drivers.EOS.GatewaySVC,
}
}
// EOSHome is the config mapping for the EOSHome storage driver
func EOSHome(cfg *config.Config) map[string]any {
return map[string]any{
"namespace": cfg.Drivers.EOS.Root,
"shadow_namespace": cfg.Drivers.EOS.ShadowNamespace,
"uploads_namespace": cfg.Drivers.EOS.UploadsNamespace,
"share_folder": cfg.Drivers.EOS.ShareFolder,
"eos_binary": cfg.Drivers.EOS.EosBinary,
"xrdcopy_binary": cfg.Drivers.EOS.XrdcopyBinary,
"master_url": cfg.Drivers.EOS.MasterURL,
"slave_url": cfg.Drivers.EOS.SlaveURL,
"cache_directory": cfg.Drivers.EOS.CacheDirectory,
"sec_protocol": cfg.Drivers.EOS.SecProtocol,
"keytab": cfg.Drivers.EOS.Keytab,
"single_username": cfg.Drivers.EOS.SingleUsername,
"user_layout": cfg.Drivers.EOS.UserLayout,
"enable_logging": cfg.Drivers.EOS.EnableLogging,
"show_hidden_sys_files": cfg.Drivers.EOS.ShowHiddenSysFiles,
"force_single_user_mode": cfg.Drivers.EOS.ForceSingleUserMode,
"use_keytab": cfg.Drivers.EOS.UseKeytab,
"gatewaysvc": cfg.Drivers.EOS.GatewaySVC,
}
}
// EOSGRPC is the config mapping for the EOSGRPC storage driver
func EOSGRPC(cfg *config.Config) map[string]any {
return map[string]any{
"namespace": cfg.Drivers.EOS.Root,
"shadow_namespace": cfg.Drivers.EOS.ShadowNamespace,
"share_folder": cfg.Drivers.EOS.ShareFolder,
"eos_binary": cfg.Drivers.EOS.EosBinary,
"xrdcopy_binary": cfg.Drivers.EOS.XrdcopyBinary,
"master_url": cfg.Drivers.EOS.MasterURL,
"master_grpc_uri": cfg.Drivers.EOS.GRPCURI,
"slave_url": cfg.Drivers.EOS.SlaveURL,
"cache_directory": cfg.Drivers.EOS.CacheDirectory,
"sec_protocol": cfg.Drivers.EOS.SecProtocol,
"keytab": cfg.Drivers.EOS.Keytab,
"single_username": cfg.Drivers.EOS.SingleUsername,
"user_layout": cfg.Drivers.EOS.UserLayout,
"enable_logging": cfg.Drivers.EOS.EnableLogging,
"show_hidden_sys_files": cfg.Drivers.EOS.ShowHiddenSysFiles,
"force_single_user_mode": cfg.Drivers.EOS.ForceSingleUserMode,
"use_keytab": cfg.Drivers.EOS.UseKeytab,
"enable_home": false,
"gatewaysvc": cfg.Drivers.EOS.GatewaySVC,
}
}
// Local is the config mapping for the Local storage driver
func Local(cfg *config.Config) map[string]any {
return map[string]any{
"root": cfg.Drivers.Local.Root,
"share_folder": cfg.Drivers.Local.ShareFolder,
}
}
// Posix is the config mapping for the Posix storage driver
func Posix(cfg *config.Config, enableFSScan, enableFSWatch bool) map[string]any {
return map[string]any{
"root": cfg.Drivers.Posix.Root,
"personalspacepath_template": cfg.Drivers.Posix.PersonalSpacePathTemplate,
"personalspacealias_template": cfg.Drivers.Posix.PersonalSpaceAliasTemplate,
"generalspacepath_template": cfg.Drivers.Posix.GeneralSpacePathTemplate,
"generalspacealias_template": cfg.Drivers.Posix.GeneralSpaceAliasTemplate,
"permissionssvc": cfg.Drivers.Posix.PermissionsEndpoint,
"permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode,
"treetime_accounting": true,
"treesize_accounting": true,
"asyncfileuploads": cfg.Drivers.Posix.AsyncUploads,
"scan_debounce_delay": cfg.Drivers.Posix.ScanDebounceDelay,
"max_quota": cfg.Drivers.Posix.MaxQuota,
"disable_versioning": cfg.Drivers.Posix.DisableVersioning,
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
"propagator": cfg.Drivers.Posix.Propagator,
"async_propagator_options": map[string]any{
"propagation_delay": cfg.Drivers.Posix.AsyncPropagatorOptions.PropagationDelay,
},
"max_acquire_lock_cycles": cfg.Drivers.Posix.MaxAcquireLockCycles,
"lock_cycle_duration_factor": cfg.Drivers.Posix.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.Posix.MaxConcurrency,
"idcache": map[string]any{
"cache_store": cfg.IDCache.Store,
"cache_nodes": cfg.IDCache.Nodes,
"cache_database": cfg.IDCache.Database,
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
"cache_auth_username": cfg.IDCache.AuthUsername,
"cache_auth_password": cfg.IDCache.AuthPassword,
},
"filemetadatacache": map[string]any{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
"cache_database": cfg.FilemetadataCache.Database,
"cache_ttl": cfg.FilemetadataCache.TTL,
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
"cache_auth_username": cfg.FilemetadataCache.AuthUsername,
"cache_auth_password": cfg.FilemetadataCache.AuthPassword,
},
"events": map[string]any{
"numconsumers": cfg.Events.NumConsumers,
},
"tokens": map[string]any{
"transfer_shared_secret": cfg.Commons.TransferSecret,
"transfer_expires": cfg.TransferExpires,
"download_endpoint": cfg.DataServerURL,
"datagateway_endpoint": cfg.DataGatewayURL,
},
"use_space_groups": cfg.Drivers.Posix.UseSpaceGroups,
"enable_fs_revisions": cfg.Drivers.Posix.EnableFSRevisions,
"scan_fs": enableFSScan,
"watch_fs": enableFSWatch,
"watch_type": cfg.Drivers.Posix.WatchType,
"watch_path": cfg.Drivers.Posix.WatchPath,
"watch_notification_brokers": cfg.Drivers.Posix.WatchNotificationBrokers,
"watch_root": cfg.Drivers.Posix.WatchRoot,
"inotify_stats_frequency": cfg.Drivers.Posix.InotifyStatsFrequency,
}
}
// LocalHome is the config mapping for the LocalHome storage driver
func LocalHome(cfg *config.Config) map[string]any {
return map[string]any{
"root": cfg.Drivers.Local.Root,
"share_folder": cfg.Drivers.Local.ShareFolder,
"user_layout": cfg.Drivers.Local.UserLayout,
}
}
// OwnCloudSQL is the config mapping for the OwnCloudSQL storage driver
func OwnCloudSQL(cfg *config.Config) map[string]any {
return map[string]any{
"datadirectory": cfg.Drivers.OwnCloudSQL.Root,
"upload_info_dir": cfg.Drivers.OwnCloudSQL.UploadInfoDir,
"share_folder": cfg.Drivers.OwnCloudSQL.ShareFolder,
"user_layout": cfg.Drivers.OwnCloudSQL.UserLayout,
"enable_home": false,
"dbusername": cfg.Drivers.OwnCloudSQL.DBUsername,
"dbpassword": cfg.Drivers.OwnCloudSQL.DBPassword,
"dbhost": cfg.Drivers.OwnCloudSQL.DBHost,
"dbport": cfg.Drivers.OwnCloudSQL.DBPort,
"dbname": cfg.Drivers.OwnCloudSQL.DBName,
"userprovidersvc": cfg.Drivers.OwnCloudSQL.UsersProviderEndpoint,
"tokens": map[string]any{
"download_endpoint": cfg.DataServerURL,
"datagateway_endpoint": cfg.DataGatewayURL,
"transfer_shared_secret": cfg.Commons.TransferSecret,
"transfer_expires": cfg.TransferExpires,
},
}
}
// Decomposed is the config mapping for the Decomposed storage driver
func Decomposed(cfg *config.Config) map[string]any {
return map[string]any{
"metadata_backend": "messagepack",
"propagator": cfg.Drivers.Decomposed.Propagator,
"async_propagator_options": map[string]any{
"propagation_delay": cfg.Drivers.Decomposed.AsyncPropagatorOptions.PropagationDelay,
},
"root": cfg.Drivers.Decomposed.Root,
"user_layout": cfg.Drivers.Decomposed.UserLayout,
"share_folder": cfg.Drivers.Decomposed.ShareFolder,
"personalspacealias_template": cfg.Drivers.Decomposed.PersonalSpaceAliasTemplate,
"personalspacepath_template": cfg.Drivers.Decomposed.PersonalSpacePathTemplate,
"generalspacealias_template": cfg.Drivers.Decomposed.GeneralSpaceAliasTemplate,
"generalspacepath_template": cfg.Drivers.Decomposed.GeneralSpacePathTemplate,
"treetime_accounting": true,
"treesize_accounting": true,
"permissionssvc": cfg.Drivers.Decomposed.PermissionsEndpoint,
"permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode,
"max_acquire_lock_cycles": cfg.Drivers.Decomposed.MaxAcquireLockCycles,
"lock_cycle_duration_factor": cfg.Drivers.Decomposed.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.Decomposed.MaxConcurrency,
"asyncfileuploads": cfg.Drivers.Decomposed.AsyncUploads,
"max_quota": cfg.Drivers.Decomposed.MaxQuota,
"disable_versioning": cfg.Drivers.Decomposed.DisableVersioning,
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
"filemetadatacache": map[string]any{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
"cache_database": cfg.FilemetadataCache.Database,
"cache_ttl": cfg.FilemetadataCache.TTL,
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
"cache_auth_username": cfg.FilemetadataCache.AuthUsername,
"cache_auth_password": cfg.FilemetadataCache.AuthPassword,
},
"idcache": map[string]any{
"cache_store": cfg.IDCache.Store,
"cache_nodes": cfg.IDCache.Nodes,
"cache_database": cfg.IDCache.Database,
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
"cache_auth_username": cfg.IDCache.AuthUsername,
"cache_auth_password": cfg.IDCache.AuthPassword,
},
"events": map[string]any{
"numconsumers": cfg.Events.NumConsumers,
},
"tokens": map[string]any{
"transfer_shared_secret": cfg.Commons.TransferSecret,
"transfer_expires": cfg.TransferExpires,
"download_endpoint": cfg.DataServerURL,
"datagateway_endpoint": cfg.DataGatewayURL,
},
}
}
// DecomposedsNoEvents is the config mapping for the Decomposed storage driver emitting no events
func DecomposedNoEvents(cfg *config.Config) map[string]any {
return map[string]any{
"metadata_backend": "messagepack",
"propagator": cfg.Drivers.Decomposed.Propagator,
"async_propagator_options": map[string]any{
"propagation_delay": cfg.Drivers.Decomposed.AsyncPropagatorOptions.PropagationDelay,
},
"root": cfg.Drivers.Decomposed.Root,
"user_layout": cfg.Drivers.Decomposed.UserLayout,
"share_folder": cfg.Drivers.Decomposed.ShareFolder,
"personalspacealias_template": cfg.Drivers.Decomposed.PersonalSpaceAliasTemplate,
"personalspacepath_template": cfg.Drivers.Decomposed.PersonalSpacePathTemplate,
"generalspacealias_template": cfg.Drivers.Decomposed.GeneralSpaceAliasTemplate,
"generalspacepath_template": cfg.Drivers.Decomposed.GeneralSpacePathTemplate,
"treetime_accounting": true,
"treesize_accounting": true,
"permissionssvc": cfg.Drivers.Decomposed.PermissionsEndpoint,
"permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode,
"max_acquire_lock_cycles": cfg.Drivers.Decomposed.MaxAcquireLockCycles,
"lock_cycle_duration_factor": cfg.Drivers.Decomposed.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.Decomposed.MaxConcurrency,
"max_quota": cfg.Drivers.Decomposed.MaxQuota,
"disable_versioning": cfg.Drivers.Decomposed.DisableVersioning,
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
"filemetadatacache": map[string]any{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
"cache_database": cfg.FilemetadataCache.Database,
"cache_ttl": cfg.FilemetadataCache.TTL,
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
"cache_auth_username": cfg.FilemetadataCache.AuthUsername,
"cache_auth_password": cfg.FilemetadataCache.AuthPassword,
},
"idcache": map[string]any{
"cache_store": cfg.IDCache.Store,
"cache_nodes": cfg.IDCache.Nodes,
"cache_database": cfg.IDCache.Database,
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
"cache_auth_username": cfg.IDCache.AuthUsername,
"cache_auth_password": cfg.IDCache.AuthPassword,
},
}
}
// DecomposedS3 is the config mapping for the decomposeds3 storage driver
func DecomposedS3(cfg *config.Config) map[string]any {
return map[string]any{
"metadata_backend": "messagepack",
"propagator": cfg.Drivers.DecomposedS3.Propagator,
"async_propagator_options": map[string]any{
"propagation_delay": cfg.Drivers.DecomposedS3.AsyncPropagatorOptions.PropagationDelay,
},
"root": cfg.Drivers.DecomposedS3.Root,
"user_layout": cfg.Drivers.DecomposedS3.UserLayout,
"share_folder": cfg.Drivers.DecomposedS3.ShareFolder,
"personalspacealias_template": cfg.Drivers.DecomposedS3.PersonalSpaceAliasTemplate,
"personalspacepath_template": cfg.Drivers.DecomposedS3.PersonalSpacePathTemplate,
"generalspacealias_template": cfg.Drivers.DecomposedS3.GeneralSpaceAliasTemplate,
"generalspacepath_template": cfg.Drivers.DecomposedS3.GeneralSpacePathTemplate,
"treetime_accounting": true,
"treesize_accounting": true,
"permissionssvc": cfg.Drivers.DecomposedS3.PermissionsEndpoint,
"permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode,
"s3.region": cfg.Drivers.DecomposedS3.Region,
"s3.access_key": cfg.Drivers.DecomposedS3.AccessKey,
"s3.secret_key": cfg.Drivers.DecomposedS3.SecretKey,
"s3.endpoint": cfg.Drivers.DecomposedS3.Endpoint,
"s3.bucket": cfg.Drivers.DecomposedS3.Bucket,
"s3.disable_content_sha254": cfg.Drivers.DecomposedS3.DisableContentSha256,
"s3.disable_multipart": cfg.Drivers.DecomposedS3.DisableMultipart,
"s3.send_content_md5": cfg.Drivers.DecomposedS3.SendContentMd5,
"s3.concurrent_stream_parts": cfg.Drivers.DecomposedS3.ConcurrentStreamParts,
"s3.num_threads": cfg.Drivers.DecomposedS3.NumThreads,
"s3.part_size": cfg.Drivers.DecomposedS3.PartSize,
"max_acquire_lock_cycles": cfg.Drivers.DecomposedS3.MaxAcquireLockCycles,
"lock_cycle_duration_factor": cfg.Drivers.DecomposedS3.LockCycleDurationFactor,
"max_concurrency": cfg.Drivers.DecomposedS3.MaxConcurrency,
"disable_versioning": cfg.Drivers.DecomposedS3.DisableVersioning,
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
"asyncfileuploads": cfg.Drivers.DecomposedS3.AsyncUploads,
"filemetadatacache": map[string]any{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
"cache_database": cfg.FilemetadataCache.Database,
"cache_ttl": cfg.FilemetadataCache.TTL,
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
"cache_auth_username": cfg.FilemetadataCache.AuthUsername,
"cache_auth_password": cfg.FilemetadataCache.AuthPassword,
},
"idcache": map[string]any{
"cache_store": cfg.IDCache.Store,
"cache_nodes": cfg.IDCache.Nodes,
"cache_database": cfg.IDCache.Database,
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
"cache_auth_username": cfg.IDCache.AuthUsername,
"cache_auth_password": cfg.IDCache.AuthPassword,
},
"events": map[string]any{
"numconsumers": cfg.Events.NumConsumers,
},
"tokens": map[string]any{
"transfer_shared_secret": cfg.Commons.TransferSecret,
"transfer_expires": cfg.TransferExpires,
"download_endpoint": cfg.DataServerURL,
"datagateway_endpoint": cfg.DataGatewayURL,
},
}
}
// DecomposedS3NoEvents is the config mapping for the decomposeds3 storage driver emitting no events
func DecomposedS3NoEvents(cfg *config.Config) map[string]any {
return map[string]any{
"metadata_backend": "messagepack",
"propagator": cfg.Drivers.DecomposedS3.Propagator,
"async_propagator_options": map[string]any{
"propagation_delay": cfg.Drivers.DecomposedS3.AsyncPropagatorOptions.PropagationDelay,
},
"root": cfg.Drivers.DecomposedS3.Root,
"user_layout": cfg.Drivers.DecomposedS3.UserLayout,
"share_folder": cfg.Drivers.DecomposedS3.ShareFolder,
"personalspacealias_template": cfg.Drivers.Decomposed.PersonalSpaceAliasTemplate,
"personalspacepath_template": cfg.Drivers.Decomposed.PersonalSpacePathTemplate,
"generalspacealias_template": cfg.Drivers.Decomposed.GeneralSpaceAliasTemplate,
"generalspacepath_template": cfg.Drivers.Decomposed.GeneralSpacePathTemplate,
"treetime_accounting": true,
"treesize_accounting": true,
"permissionssvc": cfg.Drivers.DecomposedS3.PermissionsEndpoint,
"permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode,
"s3.region": cfg.Drivers.DecomposedS3.Region,
"s3.access_key": cfg.Drivers.DecomposedS3.AccessKey,
"s3.secret_key": cfg.Drivers.DecomposedS3.SecretKey,
"s3.endpoint": cfg.Drivers.DecomposedS3.Endpoint,
"s3.bucket": cfg.Drivers.DecomposedS3.Bucket,
"max_acquire_lock_cycles": cfg.Drivers.DecomposedS3.MaxAcquireLockCycles,
"max_concurrency": cfg.Drivers.DecomposedS3.MaxConcurrency,
"disable_versioning": cfg.Drivers.DecomposedS3.DisableVersioning,
"multi_tenant_enabled": cfg.Commons.MultiTenantEnabled,
"lock_cycle_duration_factor": cfg.Drivers.DecomposedS3.LockCycleDurationFactor,
"filemetadatacache": map[string]any{
"cache_store": cfg.FilemetadataCache.Store,
"cache_nodes": cfg.FilemetadataCache.Nodes,
"cache_database": cfg.FilemetadataCache.Database,
"cache_ttl": cfg.FilemetadataCache.TTL,
"cache_disable_persistence": cfg.FilemetadataCache.DisablePersistence,
"cache_auth_username": cfg.FilemetadataCache.AuthUsername,
"cache_auth_password": cfg.FilemetadataCache.AuthPassword,
},
"idcache": map[string]any{
"cache_store": cfg.IDCache.Store,
"cache_nodes": cfg.IDCache.Nodes,
"cache_database": cfg.IDCache.Database,
"cache_disable_persistence": cfg.IDCache.DisablePersistence,
"cache_auth_username": cfg.IDCache.AuthUsername,
"cache_auth_password": cfg.IDCache.AuthPassword,
},
}
}
@@ -0,0 +1,42 @@
package revaconfig
import (
"github.com/qsfera/server/services/storage-users/pkg/config"
)
// StorageProviderDrivers are the drivers for the storage provider
func StorageProviderDrivers(cfg *config.Config) map[string]any {
return map[string]any{
"eos": EOS(cfg),
"eoshome": EOSHome(cfg),
"eosgrpc": EOSGRPC(cfg),
"local": Local(cfg),
"localhome": LocalHome(cfg),
"owncloudsql": OwnCloudSQL(cfg),
"decomposed": DecomposedNoEvents(cfg),
"decomposeds3": DecomposedS3NoEvents(cfg),
"posix": Posix(cfg, cfg.Drivers.Posix.ScanFS, cfg.Drivers.Posix.WatchFS),
"ocis": Decomposed(cfg), // deprecated: use decomposed
"s3ng": DecomposedS3NoEvents(cfg), // deprecated: use decomposeds3
}
}
// DataProviderDrivers are the drivers for the storage provider
func DataProviderDrivers(cfg *config.Config) map[string]any {
return map[string]any{
"eos": EOS(cfg),
"eoshome": EOSHome(cfg),
"eosgrpc": EOSGRPC(cfg),
"local": Local(cfg),
"localhome": LocalHome(cfg),
"owncloudsql": OwnCloudSQL(cfg),
"decomposed": Decomposed(cfg),
"decomposeds3": DecomposedS3(cfg),
"posix": Posix(cfg, false, false),
"ocis": Decomposed(cfg), // deprecated: use decomposed
"s3ng": DecomposedS3NoEvents(cfg), // deprecated: use decomposeds3
}
}