use userprovider in owncloudsql storage and add gateway for sharing driver

This commit is contained in:
Willy Kloucek
2022-05-06 12:52:47 +02:00
parent dfafcb9664
commit 68be48b95a
3 changed files with 12 additions and 10 deletions
@@ -41,6 +41,7 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
"janitor_run_interval": cfg.UserSharingDrivers.SQL.JanitorRunInterval, "janitor_run_interval": cfg.UserSharingDrivers.SQL.JanitorRunInterval,
}, },
"owncloudsql": map[string]interface{}{ "owncloudsql": map[string]interface{}{
"gateway_addr": cfg.Reva.Address,
"storage_mount_id": cfg.UserSharingDrivers.OwnCloudSQL.UserStorageMountID, "storage_mount_id": cfg.UserSharingDrivers.OwnCloudSQL.UserStorageMountID,
"db_username": cfg.UserSharingDrivers.OwnCloudSQL.DBUsername, "db_username": cfg.UserSharingDrivers.OwnCloudSQL.DBUsername,
"db_password": cfg.UserSharingDrivers.OwnCloudSQL.DBPassword, "db_password": cfg.UserSharingDrivers.OwnCloudSQL.DBPassword,
@@ -129,7 +129,7 @@ type OwnCloudSQLDriver struct {
DBHost string `yaml:"db_host" env:"STORAGE_USERS_OWNCLOUDSQL_DB_HOST"` DBHost string `yaml:"db_host" env:"STORAGE_USERS_OWNCLOUDSQL_DB_HOST"`
DBPort int `yaml:"db_port" env:"STORAGE_USERS_OWNCLOUDSQL_DB_PORT"` DBPort int `yaml:"db_port" env:"STORAGE_USERS_OWNCLOUDSQL_DB_PORT"`
DBName string `yaml:"db_name" env:"STORAGE_USERS_OWNCLOUDSQL_DB_NAME"` DBName string `yaml:"db_name" env:"STORAGE_USERS_OWNCLOUDSQL_DB_NAME"`
UsersProviderEndpoint string `yaml:"users_provider_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_OWNCLOUDSQL_USERS_PROVIDER_ENDPOINT"` UsersProviderEndpoint string `yaml:"users_provider_endpoint" env:"STORAGE_USERS_OWNCLOUDSQL_USERS_PROVIDER_ENDPOINT"`
} }
type Events struct { type Events struct {
@@ -45,15 +45,16 @@ func DefaultConfig() *config.Config {
Driver: "ocis", Driver: "ocis",
Drivers: config.Drivers{ Drivers: config.Drivers{
OwnCloudSQL: config.OwnCloudSQLDriver{ OwnCloudSQL: config.OwnCloudSQLDriver{
Root: filepath.Join(defaults.BaseDataPath(), "storage", "owncloud"), Root: filepath.Join(defaults.BaseDataPath(), "storage", "owncloud"),
ShareFolder: "/Shares", ShareFolder: "/Shares",
UserLayout: "{{.Username}}", UserLayout: "{{.Username}}",
UploadInfoDir: filepath.Join(defaults.BaseDataPath(), "storage", "uploadinfo"), UploadInfoDir: filepath.Join(defaults.BaseDataPath(), "storage", "uploadinfo"),
DBUsername: "owncloud", DBUsername: "owncloud",
DBPassword: "owncloud", DBPassword: "owncloud",
DBHost: "", DBHost: "",
DBPort: 3306, DBPort: 3306,
DBName: "owncloud", DBName: "owncloud",
UsersProviderEndpoint: "localhost:9144",
}, },
S3NG: config.S3NGDriver{ S3NG: config.S3NGDriver{
Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"), Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"),