mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-28 15:47:25 +00:00
update(userspace/falco): load default config at app initialization
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
57cafcb65a
commit
09d9ae135b
@ -23,6 +23,11 @@ using namespace falco::app;
|
||||
|
||||
application::run_result application::init_outputs()
|
||||
{
|
||||
if (m_state->config->m_outputs.empty())
|
||||
{
|
||||
return run_result::fatal("No outputs configured. Please configure at least one output file output enabled but no filename in configuration block");
|
||||
}
|
||||
|
||||
// read hostname
|
||||
std::string hostname;
|
||||
char* env_hostname = getenv("FALCO_HOSTNAME");
|
||||
|
@ -22,6 +22,7 @@ application::run_result application::load_config()
|
||||
{
|
||||
if (!m_options.conf_filename.empty())
|
||||
{
|
||||
m_state->config = std::make_shared<falco_configuration>();
|
||||
m_state->config->init(m_options.conf_filename, m_options.cmdline_config_options);
|
||||
falco_logger::set_time_format_iso_8601(m_state->config->m_time_format_iso_8601);
|
||||
|
||||
|
@ -159,6 +159,8 @@ bool application::init(int argc, char **argv, std::string &errstr)
|
||||
m_state->cmdline += *arg;
|
||||
}
|
||||
|
||||
// initialize default config with cmdline overrides (-o option)
|
||||
m_state->config->init(m_options.cmdline_config_options);
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user