aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-06-10 13:08:59 +0200
committerDan Engelbrecht <[email protected]>2025-06-10 13:08:59 +0200
commitf696e52d150ae284e26de5bdd78d1b1edf914314 (patch)
tree392920b1a1334d61900b871b851228cd7963a46c /src/zenserver/config.cpp
parentadd sentry configurations options for debug/environment (diff)
downloadzen-f696e52d150ae284e26de5bdd78d1b1edf914314.tar.xz
zen-f696e52d150ae284e26de5bdd78d1b1edf914314.zip
revert 61b4a88f and cadaad63
Diffstat (limited to 'src/zenserver/config.cpp')
-rw-r--r--src/zenserver/config.cpp44
1 files changed, 6 insertions, 38 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index 1f9ae5fb6..055376b5c 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -16,7 +16,6 @@
#include <zencore/string.h>
#include <zenhttp/zenhttp.h>
#include <zenutil/commandlineoptions.h>
-#include <zenutil/environmentoptions.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
@@ -430,29 +429,6 @@ MakeOption(std::vector<std::pair<std::string, ZenStructuredCacheBucketConfig>>&
};
void
-ParseEnvVariables(ZenServerOptions& ServerOptions, const cxxopts::ParseResult& CmdLineResult)
-{
- using namespace std::literals;
-
- EnvironmentOptions Options;
- Options.AddOption("UE_ZEN_SENTRY_ALLOWPERSONALINFO"sv, ServerOptions.SentryConfig.AllowPII, "sentry-allow-personal-info"sv);
- Options.AddOption("UE_ZEN_SENTRY_DSN"sv, ServerOptions.SentryConfig.Dsn, "sentry-dsn"sv);
- Options.AddOption("UE_ZEN_SENTRY_ENVIRONMENT"sv, ServerOptions.SentryConfig.Environment, "sentry-environment"sv);
-
- bool EnvEnableSentry = !ServerOptions.SentryConfig.Disable;
- Options.AddOption("UE_ZEN_SENTRY_ENABLED"sv, EnvEnableSentry, "no-sentry"sv);
-
- Options.AddOption("UE_ZEN_SENTRY_DEBUG"sv, ServerOptions.SentryConfig.Debug, "sentry-debug"sv);
-
- Options.Parse(CmdLineResult);
-
- if (EnvEnableSentry != !ServerOptions.SentryConfig.Disable)
- {
- ServerOptions.SentryConfig.Disable = !EnvEnableSentry;
- }
-}
-
-void
ParseConfigFile(const std::filesystem::path& Path,
ZenServerOptions& ServerOptions,
const cxxopts::ParseResult& CmdLineResult,
@@ -465,11 +441,9 @@ ParseConfigFile(const std::filesystem::path& Path,
////// server
LuaOptions.AddOption("server.dedicated"sv, ServerOptions.IsDedicated, "dedicated"sv);
LuaOptions.AddOption("server.logid"sv, ServerOptions.LogId, "log-id"sv);
- LuaOptions.AddOption("server.sentry.disable"sv, ServerOptions.SentryConfig.Disable, "no-sentry"sv);
- LuaOptions.AddOption("server.sentry.allowpersonalinfo"sv, ServerOptions.SentryConfig.AllowPII, "sentry-allow-personal-info"sv);
- LuaOptions.AddOption("server.sentry.dsn"sv, ServerOptions.SentryConfig.Dsn, "sentry-dsn"sv);
- LuaOptions.AddOption("server.sentry.environment"sv, ServerOptions.SentryConfig.Environment, "sentry-environment"sv);
- LuaOptions.AddOption("server.sentry.debug"sv, ServerOptions.SentryConfig.Debug, "sentry-debug"sv);
+ LuaOptions.AddOption("server.sentry.disable"sv, ServerOptions.NoSentry, "no-sentry"sv);
+ LuaOptions.AddOption("server.sentry.allowpersonalinfo"sv, ServerOptions.SentryAllowPII, "sentry-allow-personal-info"sv);
+ LuaOptions.AddOption("server.sentry.dsn"sv, ServerOptions.SentryDsn, "sentry-dsn"sv);
LuaOptions.AddOption("server.systemrootdir"sv, ServerOptions.SystemRootDir, "system-dir"sv);
LuaOptions.AddOption("server.datadir"sv, ServerOptions.DataDir, "data-dir"sv);
LuaOptions.AddOption("server.contentdir"sv, ServerOptions.ContentDir, "content-dir"sv);
@@ -785,15 +759,11 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
options.add_options()("write-config", "Path to output Lua config file", cxxopts::value<std::string>(OutputConfigFile));
options.add_options()("no-sentry",
"Disable Sentry crash handler",
- cxxopts::value<bool>(ServerOptions.SentryConfig.Disable)->default_value("false"));
+ cxxopts::value<bool>(ServerOptions.NoSentry)->default_value("false"));
options.add_options()("sentry-allow-personal-info",
"Allow personally identifiable information in sentry crash reports",
- cxxopts::value<bool>(ServerOptions.SentryConfig.AllowPII)->default_value("false"));
- options.add_options()("sentry-dsn", "Sentry DSN to send events to", cxxopts::value<std::string>(ServerOptions.SentryConfig.Dsn));
- options.add_options()("sentry-environment", "Sentry environment", cxxopts::value<std::string>(ServerOptions.SentryConfig.Environment));
- options.add_options()("sentry-debug",
- "Enable debug mode for Sentry",
- cxxopts::value<bool>(ServerOptions.SentryConfig.Debug)->default_value("false"));
+ cxxopts::value<bool>(ServerOptions.SentryAllowPII)->default_value("false"));
+ options.add_options()("sentry-dsn", "Sentry DSN to send events to", cxxopts::value<std::string>(ServerOptions.SentryDsn));
options.add_options()("detach",
"Indicate whether zenserver should detach from parent process group",
cxxopts::value<bool>(ServerOptions.Detach)->default_value("true"));
@@ -1366,8 +1336,6 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
ServerOptions.ObjectStoreConfig = ParseBucketConfigs(BucketConfigs);
- ParseEnvVariables(ServerOptions, Result);
-
if (!ServerOptions.ConfigFile.empty())
{
ParseConfigFile(ServerOptions.ConfigFile, ServerOptions, Result, OutputConfigFile);