diff options
author | Foereaper <Foereaper@users.noreply.github.com> | 2023-01-21 14:48:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-21 14:48:22 +0100 |
commit | 5fa027a222129ba6a8d82201ccbc75842a308070 (patch) | |
tree | 1d293746e32651db42154f40151a553ae9dc8f77 /src/common/Configuration/Config.cpp | |
parent | 30c29303dba7a2732e76ee1a6deee5459fad5e60 (diff) |
refactor(Core/Conf): Removal of unnecessary .dist file loading (#14707)
* Remove .dist file requirement
* Remove unnecessary string cast
* Add required variables for CI build configs
* More required variables
* Add some more default variables to reduce log output
* One last default value to cut down log spam
* Rewrite conf file bash script
This should use the standard .dest file as a template
* Change dir we copy the dest files from
* actually use the correct file name
* need to use double quotes for variables
* add missing username
* set the correct datadir
* Attempt to fix dbimport
Co-authored-by: Foereaper <foereaper@elunatech.com>
Diffstat (limited to 'src/common/Configuration/Config.cpp')
-rw-r--r-- | src/common/Configuration/Config.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index 29eb390f49..d5750120d0 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -32,7 +32,6 @@ namespace std::vector<std::string> _args; std::unordered_map<std::string /*name*/, std::string /*value*/> _configOptions; std::mutex _configLock; - bool _usingDistConfig = false; // Check system configs like *server.conf* bool IsAppConfig(std::string_view fileName) @@ -255,8 +254,8 @@ T ConfigMgr::GetValueDefault(std::string const& name, T const& def, bool showLog { if (showLogs) { - LOG_ERROR("server.loading", "> Config: Missing property {} in all config files, at least the .dist file must contain: \"{} = {}\"", - name, name, Acore::ToString(def)); + LOG_ERROR("server.loading", "> Config: Missing property {} in config file {}, add \"{} = {}\" to this file.", + name, _filename, name, Acore::ToString(def)); } return def; @@ -285,8 +284,8 @@ std::string ConfigMgr::GetValueDefault<std::string>(std::string const& name, std { if (showLogs) { - LOG_ERROR("server.loading", "> Config: Missing option {}, add \"{} = {}\"", - name, name, def); + LOG_ERROR("server.loading", "> Config: Missing property {} in config file {}, add \"{} = {}\" to this file.", + name, _filename, name, def); } return def; @@ -341,7 +340,7 @@ std::vector<std::string> ConfigMgr::GetKeysByString(std::string const& name) std::string const ConfigMgr::GetFilename() { std::lock_guard<std::mutex> lock(_configLock); - return _usingDistConfig ? _filename + ".dist" : _filename; + return _filename; } std::vector<std::string> const& ConfigMgr::GetArguments() const @@ -377,18 +376,12 @@ void ConfigMgr::Configure(std::string const& initFileName, std::vector<std::stri bool ConfigMgr::LoadAppConfigs(bool isReload /*= false*/) { - // #1 - Load init config file .conf.dist - if (!LoadInitial(_filename + ".dist", isReload)) + // #1 - Load init config file .conf + if (!LoadInitial(_filename, isReload)) { return false; } - // #2 - Load .conf file - if (!LoadAdditionalFile(_filename, true, isReload)) - { - _usingDistConfig = true; - } - return true; } |