Give the ocm storage provider some storage space

This commit is contained in:
André Duffeck
2023-11-27 09:15:21 +01:00
parent 15051c99ad
commit 2ffec5c79f
3 changed files with 12 additions and 6 deletions

View File

@@ -110,7 +110,8 @@ type OCMCore struct {
Drivers OCMCoreDrivers `yaml:"drivers"`
}
type OCMStorageProvider struct {
Insecure bool `yaml:"insecure" env:"OCM_OCM_STORAGE_PROVIDER_INSECURE" desc:"Disable TLS certificate validation for the OCM connections. Do not set this in production environments."`
Insecure bool `yaml:"insecure" env:"OCM_OCM_STORAGE_PROVIDER_INSECURE" desc:"Disable TLS certificate validation for the OCM connections. Do not set this in production environments."`
StorageRoot string `yaml:"insecure" env:"OCM_OCM_STORAGE_PROVIDER_STORAGE_ROOT" desc:"Directory where the ocm storage provider persists its data like tus upload info files."`
}
type OCMCoreDrivers struct {

View File

@@ -94,7 +94,7 @@ func DefaultConfig() *config.Config {
Driver: "json",
Drivers: config.OCMInviteManagerDrivers{
JSON: config.OCMInviteManagerJSONDriver{
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocminvites.json"),
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocm", "ocminvites.json"),
},
},
Insecure: false,
@@ -102,14 +102,14 @@ func DefaultConfig() *config.Config {
OCMProviderAuthorizerDriver: "json",
OCMProviderAuthorizerDrivers: config.OCMProviderAuthorizerDrivers{
JSON: config.OCMProviderAuthorizerJSONDriver{
Providers: filepath.Join(defaults.BaseDataPath(), "storage", "ocmproviders.json"),
Providers: filepath.Join(defaults.BaseDataPath(), "storage", "ocm", "ocmproviders.json"),
},
},
OCMShareProvider: config.OCMShareProvider{
Driver: "json",
Drivers: config.OCMShareProviderDrivers{
JSON: config.OCMShareProviderJSONDriver{
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocmshares.json"),
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocm", "ocmshares.json"),
},
},
Insecure: false,
@@ -118,10 +118,14 @@ func DefaultConfig() *config.Config {
Driver: "json",
Drivers: config.OCMCoreDrivers{
JSON: config.OCMCoreJSONDriver{
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocmshares.json"),
File: filepath.Join(defaults.BaseDataPath(), "storage", "ocm", "ocmshares.json"),
},
},
},
OCMStorageProvider: config.OCMStorageProvider{
Insecure: false,
StorageRoot: filepath.Join(defaults.BaseDataPath(), "storage", "ocm"),
},
}
}

View File

@@ -132,7 +132,8 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
"driver": "ocmreceived",
"drivers": map[string]interface{}{
"ocmreceived": map[string]interface{}{
"insecure": cfg.OCMStorageProvider.Insecure,
"insecure": cfg.OCMStorageProvider.Insecure,
"storage_root": cfg.OCMStorageProvider.StorageRoot,
},
},
"data_server_url": "http://" + cfg.HTTP.Addr + "/data",