diff options
| author | Dan Engelbrecht <[email protected]> | 2022-04-26 10:46:38 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-04-26 10:46:38 +0200 |
| commit | bd5b1a15f65f2fde3721acd16ce3a316c03583ea (patch) | |
| tree | dfa0acea7237697cbdf14a1fa2bc121a060f6ec7 /zenserver/config.cpp | |
| parent | Merge branch 'main' into de/cache-with-block-store (diff) | |
| parent | Compute tweaks (#78) (diff) | |
| download | zen-bd5b1a15f65f2fde3721acd16ce3a316c03583ea.tar.xz zen-bd5b1a15f65f2fde3721acd16ce3a316c03583ea.zip | |
Merge remote-tracking branch 'origin/main' into de/cache-with-block-store
Diffstat (limited to 'zenserver/config.cpp')
| -rw-r--r-- | zenserver/config.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp index ac0f863cc..be91ae4f8 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -389,6 +389,49 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) options.add_option("compute", "", + "upstream-horde-storage-url", + "URL to a Horde Storage instance.", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageUrl)->default_value(""), + ""); + + options.add_option("compute", + "", + "upstream-horde-storage-oauth-url", + "URL to the OAuth provier", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthUrl)->default_value(""), + ""); + + options.add_option("compute", + "", + "upstream-horde-storage-oauth-clientid", + "The OAuth client ID", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthClientId)->default_value(""), + ""); + + options.add_option( + "compute", + "", + "upstream-horde-storage-oauth-clientsecret", + "The OAuth client secret", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthClientSecret)->default_value(""), + ""); + + options.add_option("compute", + "", + "upstream-horde-storage-openid-provider", + "Name of a registered Open ID provider", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOpenIdProvider)->default_value(""), + ""); + + options.add_option("compute", + "", + "upstream-horde-storage-token", + "A static authentication token", + cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.StorageAccessToken)->default_value(""), + ""); + + options.add_option("compute", + "", "upstream-horde-cluster", "The Horde compute cluster id", cxxopts::value<std::string>(ServerOptions.UpstreamCacheConfig.HordeConfig.Cluster)->default_value(""), @@ -700,6 +743,28 @@ ParseConfigFile(const std::filesystem::path& Path, ZenServerOptions& ServerOptio std::string_view("namespace"), ServerOptions.UpstreamCacheConfig.HordeConfig.Namespace); }; + + if (auto StorageConfig = UpstreamConfig->get<sol::optional<sol::table>>("storage")) + { + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("url"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageUrl); + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("oauthprovider"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthUrl); + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("oauthclientid"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthClientId); + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("oauthclientsecret"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOAuthClientSecret); + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("openidprovider"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageOpenIdProvider); + UpdateStringValueFromConfig(StorageConfig.value(), + std::string_view("token"), + ServerOptions.UpstreamCacheConfig.HordeConfig.StorageAccessToken); + }; } } |