Initial support for the posixfs

This commit is contained in:
André Duffeck
2024-02-06 08:28:51 +01:00
parent 26c06a3c6d
commit aab219a38f
4 changed files with 25 additions and 0 deletions

View File

@@ -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"`

View File

@@ -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",

View File

@@ -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{}{

View File

@@ -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),
}
}