feat(Core/Config): Implement config override with env vars (#16817)

* Core/Config: Implement config override with env vars

Implement overriding of configuration from the .conf file with environment variables.
Environment variables keys are autogenerated based on the keys defined in .conf file.

Usage example:

$ export TC_DATA_DIR=/usr
$ AC_WORLD_SERVER_PORT=8080 ./worldserver

* Add tests for env vars config
This commit is contained in:
Anton Popovichenko
2023-08-14 22:07:43 +02:00
committed by GitHub
parent f633e4e9cd
commit d69ee90ed3
5 changed files with 278 additions and 6 deletions

View File

@@ -39,6 +39,9 @@ public:
bool Reload();
/// Overrides configuration with environment variables and returns overridden keys
std::vector<std::string> OverrideWithEnvVariablesIfAny();
std::string const GetFilename();
std::string const GetConfigPath();
[[nodiscard]] std::vector<std::string> const& GetArguments() const;