diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 23af0b3e1..aa7ef42fb 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -102,6 +102,7 @@ type Drivers struct { OCIS OCISDriver `yaml:"ocis"` S3NG S3NGDriver `yaml:"s3ng"` OwnCloudSQL OwnCloudSQLDriver `yaml:"owncloudsql"` + Posix PosixDriver `yaml:"posix"` S3 S3Driver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs EOS EOSDriver `yaml:",omitempty"` // not supported by the oCIS product, therefore not part of docs @@ -186,6 +187,14 @@ type OwnCloudSQLDriver struct { UsersProviderEndpoint string `yaml:"users_provider_endpoint" env:"STORAGE_USERS_OWNCLOUDSQL_USERS_PROVIDER_ENDPOINT" desc:"Endpoint of the users provider." introductionVersion:"pre5.0"` } +// PosixDriver is the storage driver configuration when using 'posix' storage driver +type PosixDriver struct { + // Root is the absolute path to the location of the data + Root string `yaml:"root" env:"STORAGE_USERS_POSIX_ROOT" desc:"The directory where the filesystem storage will store its data. If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/owncloud."` + UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_POSIX_USER_LAYOUT" desc:"Template string for the user storage layout in the user directory."` + PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_POSIX_PERMISSIONS_ENDPOINT" desc:"Endpoint of the permissions service. The endpoints can differ for 'ocis', 'posix' and 's3ng'."` +} + // Events combines the configuration options for the event bus. type Events struct { Addr string `yaml:"endpoint" env:"OCIS_EVENTS_ENDPOINT;STORAGE_USERS_EVENTS_ENDPOINT" desc:"The address of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture." introductionVersion:"pre5.0"` diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index f165fbdc5..07eea0f1e 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -137,6 +137,10 @@ func DefaultConfig() *config.Config { LockCycleDurationFactor: 30, AsyncUploads: true, }, + Posix: config.PosixDriver{ + UserLayout: "users/{{.User.Username}}", + PermissionsEndpoint: "com.owncloud.api.settings", + }, }, Events: config.Events{ Addr: "127.0.0.1:9233", diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index 841a31909..1fa95c9fb 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -84,6 +84,16 @@ func Local(cfg *config.Config) map[string]interface{} { } } +// Posix is the config mapping for the Posix storage driver +func Posix(cfg *config.Config) map[string]interface{} { + return map[string]interface{}{ + "root": cfg.Drivers.Posix.Root, + "user_layout": cfg.Drivers.Posix.UserLayout, + "permissionssvc": cfg.Drivers.Posix.PermissionsEndpoint, + "permissionssvc_tls_mode": cfg.Commons.GRPCClientTLS.Mode, + } +} + // LocalHome is the config mapping for the LocalHome storage driver func LocalHome(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ diff --git a/services/storage-users/pkg/revaconfig/user.go b/services/storage-users/pkg/revaconfig/user.go index ef64d94b2..29a26af32 100644 --- a/services/storage-users/pkg/revaconfig/user.go +++ b/services/storage-users/pkg/revaconfig/user.go @@ -14,6 +14,7 @@ func StorageProviderDrivers(cfg *config.Config) map[string]interface{} { "ocis": OcisNoEvents(cfg), "s3": S3(cfg), "s3ng": S3NGNoEvents(cfg), + "posix": Posix(cfg), } } @@ -29,5 +30,6 @@ func DataProviderDrivers(cfg *config.Config) map[string]interface{} { "ocis": Ocis(cfg), "s3": S3(cfg), "s3ng": S3NG(cfg), + "posix": Posix(cfg), } }