diff options
| author | Stefan Boberg <[email protected]> | 2025-10-14 11:32:16 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-14 11:32:16 +0200 |
| commit | ca09abbeef5b1788f4a52b61eedd2f3dd07f81f2 (patch) | |
| tree | 005a50adfddf6982bab3a06bb93d4c50da1a11fd /src/zenserver/config/config.h | |
| parent | make asiohttp work without IPv6 (#562) (diff) | |
| download | zen-ca09abbeef5b1788f4a52b61eedd2f3dd07f81f2.tar.xz zen-ca09abbeef5b1788f4a52b61eedd2f3dd07f81f2.zip | |
move all storage-related services into storage tree (#571)
* move all storage-related services into storage tree
* move config into config/
* also move admin service into storage since it mostly has storage related functionality
* header consolidation
Diffstat (limited to 'src/zenserver/config/config.h')
| -rw-r--r-- | src/zenserver/config/config.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/zenserver/config/config.h b/src/zenserver/config/config.h new file mode 100644 index 000000000..8471ee89b --- /dev/null +++ b/src/zenserver/config/config.h @@ -0,0 +1,87 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include <zencore/logbase.h> +#include <zencore/trace.h> +#include <zencore/zencore.h> +#include <zenhttp/httpserver.h> +#include <filesystem> +#include <string> +#include <vector> + +namespace zen::LuaConfig { +struct Options; +} +namespace cxxopts { +class Options; +class ParseResult; +} // namespace cxxopts +namespace zen { + +struct ZenStorageServerOptions; + +struct ZenStatsConfig +{ + bool Enabled = false; + std::string StatsdHost = "localhost"; + int StatsdPort = 8125; +}; + +struct ZenSentryConfig +{ + bool Disable = false; + bool AllowPII = false; // Allow personally identifiable information in sentry crash reports + std::string Dsn; + std::string Environment; + bool Debug = false; // Enable debug mode for Sentry +}; + +struct ZenServerOptions +{ + HttpServerConfig HttpServerConfig; + ZenSentryConfig SentryConfig; + int BasePort = 8558; // Service listen port (used for both UDP and TCP) + int OwnerPid = 0; // Parent process id (zero for standalone) + bool IsDebug = false; + bool IsCleanStart = false; // Indicates whether all state should be wiped on startup or not + bool IsPowerCycle = false; // When true, the process shuts down immediately after initialization + bool IsTest = false; + bool Detach = true; // Whether zenserver should detach from existing process group (Mac/Linux) + bool NoConsoleOutput = false; // Control default use of stdout for diagnostics + bool QuietConsole = false; // Configure console logger output to level WARN + int CoreLimit = 0; // If set, hardware concurrency queries are capped at this number + bool IsDedicated = false; // Indicates a dedicated/shared instance, with larger resource requirements + bool ShouldCrash = false; // Option for testing crash handling + bool IsFirstRun = false; + std::filesystem::path ConfigFile; // Path to Lua config file + std::filesystem::path SystemRootDir; // System root directory (used for machine level config) + std::filesystem::path ContentDir; // Root directory for serving frontend content (experimental) + std::filesystem::path DataDir; // Root directory for state (used for testing) + std::filesystem::path AbsLogFile; // Absolute path to main log file + std::string ChildId; // Id assigned by parent process (used for lifetime management) + std::string LogId; // Id for tagging log output + std::string Loggers[zen::logging::level::LogLevelCount]; +#if ZEN_WITH_TRACE + bool HasTraceCommandlineOptions = false; + TraceOptions TraceOptions; +#endif + std::string MemoryOptions; // Memory allocation options + std::string CommandLine; + std::string EncryptionKey; // 256 bit AES encryption key + std::string EncryptionIV; // 128 bit AES initialization vector + + ZenStatsConfig StatsConfig; + + bool InstallService = false; // Flag used to initiate service install (temporary) + bool UninstallService = false; // Flag used to initiate service uninstall (temporary) +}; + +void ParseCliOptions(int argc, char* argv[], ZenStorageServerOptions& ServerOptions); + +void EmitCentralManifest(const std::filesystem::path& SystemRoot, Oid Identifier, CbObject Manifest, std::filesystem::path ManifestPath); +std::vector<CbObject> ReadAllCentralManifests(const std::filesystem::path& SystemRoot); + +void AddServerConfigOptions(LuaConfig::Options& LuaOptions, ZenServerOptions& ServerOptions); + +} // namespace zen |