fix(ocm): add data_server_url to ocm storage provider

Fixes: #10358
This commit is contained in:
Ralf Haferkamp
2024-10-30 16:45:51 +01:00
committed by Ralf Haferkamp
parent a04458a0a0
commit 0d88a68c79
4 changed files with 17 additions and 5 deletions
@@ -0,0 +1,10 @@
Bugfix: Allow to configure data server URL for ocm
We introduced the `OCM_OCM_STORAGE_DATA_SERVER_URL` setting to fix a bug
when downloading files from an OCM share. Before the data server URL defaulted
to the listen address of the OCM server, which did not work when using
0.0.0.0 as the listen address.
https://github.com/owncloud/ocis/pull/10440
https://github.com/owncloud/ocis/issues/10358
+3 -2
View File
@@ -121,8 +121,9 @@ 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." introductionVersion:"5.0"`
StorageRoot string `yaml:"storage_root" env:"OCM_OCM_STORAGE_PROVIDER_STORAGE_ROOT" desc:"Directory where the ocm storage provider persists its data like tus upload info files." introductionVersion:"5.0"`
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." introductionVersion:"5.0"`
StorageRoot string `yaml:"storage_root" env:"OCM_OCM_STORAGE_PROVIDER_STORAGE_ROOT" desc:"Directory where the ocm storage provider persists its data like tus upload info files." introductionVersion:"5.0"`
DataServerURL string `yaml:"data_server_url" env:"OCM_OCM_STORAGE_DATA_SERVER_URL" desc:"URL of the data server, needs to be reachable by the data gateway provided by the frontend service or the user if directly exposed." introductionVersion:"7.0.0"`
}
type OCMCoreDrivers struct {
@@ -130,8 +130,9 @@ func DefaultConfig() *config.Config {
},
},
OCMStorageProvider: config.OCMStorageProvider{
Insecure: false,
StorageRoot: filepath.Join(defaults.BaseDataPath(), "storage", "ocm"),
Insecure: false,
StorageRoot: filepath.Join(defaults.BaseDataPath(), "storage", "ocm"),
DataServerURL: "http://localhost:9280/data",
},
}
}
+1 -1
View File
@@ -163,7 +163,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
"storage_root": cfg.OCMStorageProvider.StorageRoot,
},
},
"data_server_url": "http://" + cfg.HTTP.Addr + "/data",
"data_server_url": cfg.OCMStorageProvider.DataServerURL,
},
"authprovider": map[string]interface{}{
"auth_manager": "ocmshares",