diff options
author | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-01-15 12:49:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 12:49:28 +0100 |
commit | 08649bec373555144878b4314e87c9a8eb38c82e (patch) | |
tree | 23c9246e606f948944af8bc33f976085fa455848 /daemon | |
parent | 67834f184ff3d67f6c8b6005ac68b568d7573118 (diff) |
Port ACLs, Management API and Health commands (#4969)
##### Summary
fixes #2673
fixes #2149
fixes #5017
fixes #3830
fixes #3187
fixes #5154
Implements a command API for health which will accept commands via a socket to selectively suppress health checks.
Allows different ports to accept different request types (streaming, dashboard, api, registry, netdata.conf, badges, management)
Removes support for multi-threaded and single-threaded web servers.
##### Component Name
health, daemon
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/main.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/daemon/main.c b/daemon/main.c index b2c4c80bf5..1ec5f6ed5a 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -67,8 +67,6 @@ struct netdata_static_thread static_threads[] = { // common plugins for all systems {"BACKENDS", NULL, NULL, 1, NULL, NULL, backends_main}, - {"WEB_SERVER[multi]", NULL, NULL, 1, NULL, NULL, socket_listen_main_multi_threaded}, - {"WEB_SERVER[single]", NULL, NULL, 0, NULL, NULL, socket_listen_main_single_threaded}, {"WEB_SERVER[static1]", NULL, NULL, 0, NULL, NULL, socket_listen_main_static_threaded}, {"STREAM", NULL, NULL, 0, NULL, NULL, rrdpush_sender_thread}, @@ -81,18 +79,10 @@ struct netdata_static_thread static_threads[] = { void web_server_threading_selection(void) { web_server_mode = web_server_mode_id(config_get(CONFIG_SECTION_WEB, "mode", web_server_mode_name(web_server_mode))); - int multi_threaded = (web_server_mode == WEB_SERVER_MODE_MULTI_THREADED); - int single_threaded = (web_server_mode == WEB_SERVER_MODE_SINGLE_THREADED); int static_threaded = (web_server_mode == WEB_SERVER_MODE_STATIC_THREADED); int i; for (i = 0; static_threads[i].name; i++) { - if (static_threads[i].start_routine == socket_listen_main_multi_threaded) - static_threads[i].enabled = multi_threaded; - - if (static_threads[i].start_routine == socket_listen_main_single_threaded) - static_threads[i].enabled = single_threaded; - if (static_threads[i].start_routine == socket_listen_main_static_threaded) static_threads[i].enabled = static_threaded; } @@ -113,6 +103,8 @@ void web_server_config_options(void) { web_allow_registry_from = simple_pattern_create(config_get(CONFIG_SECTION_REGISTRY, "allow from", "*"), NULL, SIMPLE_PATTERN_EXACT); web_allow_streaming_from = simple_pattern_create(config_get(CONFIG_SECTION_WEB, "allow streaming from", "*"), NULL, SIMPLE_PATTERN_EXACT); web_allow_netdataconf_from = simple_pattern_create(config_get(CONFIG_SECTION_WEB, "allow netdata.conf from", "localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*"), NULL, SIMPLE_PATTERN_EXACT); + web_allow_mgmt_from = simple_pattern_create(config_get(CONFIG_SECTION_WEB, "allow management from", "localhost"), NULL, SIMPLE_PATTERN_EXACT); + #ifdef NETDATA_WITH_ZLIB web_enable_gzip = config_get_boolean(CONFIG_SECTION_WEB, "enable gzip compression", web_enable_gzip); @@ -367,13 +359,6 @@ void log_init(void) { } static void backwards_compatible_config() { - // allow existing configurations to work with the current version of netdata - - if(config_exists(CONFIG_SECTION_GLOBAL, "multi threaded web server")) { - int mode = config_get_boolean(CONFIG_SECTION_GLOBAL, "multi threaded web server", 1); - web_server_mode = (mode)?WEB_SERVER_MODE_MULTI_THREADED:WEB_SERVER_MODE_SINGLE_THREADED; - } - // move [global] options to the [web] section config_move(CONFIG_SECTION_GLOBAL, "http port listen backlog", CONFIG_SECTION_WEB, "listen backlog"); @@ -876,7 +861,6 @@ int main(int argc, char **argv) { load_netdata_conf(NULL, 0); } - backwards_compatible_config(); get_netdata_configured_variables(); const char *section = argv[optind]; @@ -1056,7 +1040,6 @@ int main(int argc, char **argv) { rrd_init(netdata_configured_hostname); - // ------------------------------------------------------------------------ // enable log flood protection |