expose owncloudsql sharing driver

This commit is contained in:
Willy Kloucek
2022-05-03 18:40:55 +02:00
parent e32f909b82
commit 5bf8f254e1
2 changed files with 22 additions and 21 deletions

View File

@@ -61,9 +61,11 @@ type GRPCConfig struct {
}
type UserSharingDrivers struct {
JSON UserSharingJSONDriver `yaml:"json"`
CS3 UserSharingCS3Driver `yaml:"cs3"`
SQL UserSharingSQLDriver `yaml:"sql,omitempty"` // not supported by the oCIS product, therefore not part of docs
JSON UserSharingJSONDriver `yaml:"json"`
CS3 UserSharingCS3Driver `yaml:"cs3"`
OwnCloudSQL UserSharingOwnCloudSQLDriver `yaml:"owncloudsql"`
SQL UserSharingSQLDriver `yaml:"sql,omitempty"` // not supported by the oCIS product, therefore not part of docs
}
type UserSharingJSONDriver struct {
@@ -82,6 +84,15 @@ type UserSharingSQLDriver struct {
UserStorageMountID string `yaml:"user_storage_mount_id"`
}
type UserSharingOwnCloudSQLDriver struct {
DBUsername string `yaml:"db_username" env:"SHARING_USER_OWNCLOUDSQL_DB_USERNAME"`
DBPassword string `yaml:"db_password" env:"SHARING_USER_OWNCLOUDSQL_DB_PASSWORD"`
DBHost string `yaml:"db_host" env:"SHARING_USER_OWNCLOUDSQL_DB_HOST"`
DBPort int `yaml:"db_port" env:"SHARING_USER_OWNCLOUDSQL_DB_PORT"`
DBName string `yaml:"db_name" env:"SHARING_USER_OWNCLOUDSQL_DB_NAME"`
UserStorageMountID string `yaml:"user_storage_mount_id" env:"SHARING_USER_OWNCLOUDSQL_USER_STORAGE_MOUNT_ID"`
}
type UserSharingCS3Driver struct {
ProviderAddr string `yaml:"provider_addr" env:"SHARING_USER_CS3_PROVIDER_ADDR"`
ServiceUserID string `yaml:"service_user_id" env:"SHARING_USER_CS3_SERVICE_USER_ID"`
@@ -92,7 +103,8 @@ type UserSharingCS3Driver struct {
type PublicSharingDrivers struct {
JSON PublicSharingJSONDriver `yaml:"json"`
CS3 PublicSharingCS3Driver `yaml:"cs3"`
SQL PublicSharingSQLDriver `yaml:"sql,omitempty"` // not supported by the oCIS product, therefore not part of docs
SQL PublicSharingSQLDriver `yaml:"sql,omitempty"` // not supported by the oCIS product, therefore not part of docs
}
type PublicSharingJSONDriver struct {

View File

@@ -41,12 +41,12 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
"janitor_run_interval": cfg.UserSharingDrivers.SQL.JanitorRunInterval,
},
"owncloudsql": map[string]interface{}{
"storage_mount_id": cfg.UserSharingDrivers.SQL.UserStorageMountID,
"db_username": cfg.UserSharingDrivers.SQL.DBUsername,
"db_password": cfg.UserSharingDrivers.SQL.DBPassword,
"db_host": cfg.UserSharingDrivers.SQL.DBHost,
"db_port": cfg.UserSharingDrivers.SQL.DBPort,
"db_name": cfg.UserSharingDrivers.SQL.DBName,
"storage_mount_id": cfg.UserSharingDrivers.OwnCloudSQL.UserStorageMountID,
"db_username": cfg.UserSharingDrivers.OwnCloudSQL.DBUsername,
"db_password": cfg.UserSharingDrivers.OwnCloudSQL.DBPassword,
"db_host": cfg.UserSharingDrivers.OwnCloudSQL.DBHost,
"db_port": cfg.UserSharingDrivers.OwnCloudSQL.DBPort,
"db_name": cfg.UserSharingDrivers.OwnCloudSQL.DBName,
},
"cs3": map[string]interface{}{
"provider_addr": cfg.UserSharingDrivers.CS3.ProviderAddr,
@@ -73,17 +73,6 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
"enable_expired_shares_cleanup": cfg.PublicSharingDrivers.SQL.EnableExpiredSharesCleanup,
"janitor_run_interval": cfg.PublicSharingDrivers.SQL.JanitorRunInterval,
},
"owncloudsql": map[string]interface{}{
"storage_mount_id": cfg.PublicSharingDrivers.SQL.UserStorageMountID,
"db_username": cfg.PublicSharingDrivers.SQL.DBUsername,
"db_password": cfg.PublicSharingDrivers.SQL.DBPassword,
"db_host": cfg.PublicSharingDrivers.SQL.DBHost,
"db_port": cfg.PublicSharingDrivers.SQL.DBPort,
"db_name": cfg.PublicSharingDrivers.SQL.DBName,
"password_hash_cost": cfg.PublicSharingDrivers.SQL.PasswordHashCost,
"enable_expired_shares_cleanup": cfg.PublicSharingDrivers.SQL.EnableExpiredSharesCleanup,
"janitor_run_interval": cfg.PublicSharingDrivers.SQL.JanitorRunInterval,
},
"cs3": map[string]interface{}{
"provider_addr": cfg.PublicSharingDrivers.CS3.ProviderAddr,
"service_user_id": cfg.PublicSharingDrivers.CS3.ServiceUserID,