aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/config')
-rw-r--r--src/zenserver/config/config.cpp29
-rw-r--r--src/zenserver/config/config.h2
2 files changed, 24 insertions, 7 deletions
diff --git a/src/zenserver/config/config.cpp b/src/zenserver/config/config.cpp
index 15f6f79f3..2a89fc637 100644
--- a/src/zenserver/config/config.cpp
+++ b/src/zenserver/config/config.cpp
@@ -12,6 +12,7 @@
#include <zencore/compactbinaryutil.h>
#include <zencore/compactbinaryvalidation.h>
#include <zencore/except.h>
+#include <zencore/filesystem.h>
#include <zencore/fmtutils.h>
#include <zencore/iobuffer.h>
#include <zencore/logging.h>
@@ -266,6 +267,10 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
options.add_options()("powercycle",
"Exit immediately after initialization is complete",
cxxopts::value<bool>(ServerOptions.IsPowerCycle));
+ options.add_options()("enable-execution-history",
+ "Record this invocation in the per-user execution history "
+ "(use --enable-execution-history=false to suppress)",
+ cxxopts::value<bool>()->default_value("true")->implicit_value("true"));
options.add_option("diagnostics",
"",
@@ -417,7 +422,7 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi
options.add_option("network",
"",
"httpclient",
- "Select HTTP client implementation (e.g. 'curl', 'cpr')",
+ "Select HTTP client implementation",
cxxopts::value<std::string>(ServerOptions.HttpClient.Backend)->default_value("curl"),
"<http client>");
@@ -478,15 +483,27 @@ ZenServerCmdLineOptions::ApplyOptions(cxxopts::Options& options, ZenServerConfig
throw std::runtime_error(fmt::format("'--snapshot-dir' ('{}') must be a directory", ServerOptions.BaseSnapshotDir));
}
- ServerOptions.SystemRootDir = MakeSafeAbsolutePath(SystemRootDir);
- ServerOptions.DataDir = MakeSafeAbsolutePath(DataDir);
- ServerOptions.ContentDir = MakeSafeAbsolutePath(ContentDir);
- ServerOptions.ConfigFile = MakeSafeAbsolutePath(ConfigFile);
- ServerOptions.BaseSnapshotDir = MakeSafeAbsolutePath(BaseSnapshotDir);
+ SystemRootDir = ExpandEnvironmentVariables(SystemRootDir);
+ ServerOptions.SystemRootDir = MakeSafeAbsolutePath(SystemRootDir);
+
+ DataDir = ExpandEnvironmentVariables(DataDir);
+ ServerOptions.DataDir = MakeSafeAbsolutePath(DataDir);
+
+ ContentDir = ExpandEnvironmentVariables(ContentDir);
+ ServerOptions.ContentDir = MakeSafeAbsolutePath(ContentDir);
+
+ ConfigFile = ExpandEnvironmentVariables(ConfigFile);
+ ServerOptions.ConfigFile = MakeSafeAbsolutePath(ConfigFile);
+
+ BaseSnapshotDir = ExpandEnvironmentVariables(BaseSnapshotDir);
+ ServerOptions.BaseSnapshotDir = MakeSafeAbsolutePath(BaseSnapshotDir);
+
+ ExpandEnvironmentVariables(SecurityConfigPath);
ServerOptions.SecurityConfigPath = MakeSafeAbsolutePath(SecurityConfigPath);
if (!UnixSocketPath.empty())
{
+ UnixSocketPath = ExpandEnvironmentVariables(UnixSocketPath);
ServerOptions.HttpConfig.UnixSocketPath = MakeSafeAbsolutePath(UnixSocketPath);
}
diff --git a/src/zenserver/config/config.h b/src/zenserver/config/config.h
index 5078fe71a..d35a1a8c7 100644
--- a/src/zenserver/config/config.h
+++ b/src/zenserver/config/config.h
@@ -40,7 +40,7 @@ struct ZenSentryConfig
struct HttpClientConfig
{
- std::string Backend = "cpr"; // Choice of HTTP client implementation (e.g. "curl", "cpr")
+ std::string Backend = "curl"; // Choice of HTTP client implementation
};
struct ZenServerConfig