mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-29 08:07:24 +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()
|
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
|
// read hostname
|
||||||
std::string hostname;
|
std::string hostname;
|
||||||
char* env_hostname = getenv("FALCO_HOSTNAME");
|
char* env_hostname = getenv("FALCO_HOSTNAME");
|
||||||
|
@ -22,6 +22,7 @@ application::run_result application::load_config()
|
|||||||
{
|
{
|
||||||
if (!m_options.conf_filename.empty())
|
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);
|
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);
|
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;
|
m_state->cmdline += *arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initialize default config with cmdline overrides (-o option)
|
||||||
|
m_state->config->init(m_options.cmdline_config_options);
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user