diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2022-01-04 10:11:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 10:11:04 +0100 |
commit | 5736b4bcb179896280cb579ee1dbe0cfa464064c (patch) | |
tree | 3b703557152bf0970cd80cdc72032a00fb6b16e7 | |
parent | 2546c02f89581b0c20f9805d65bd060ad9f8af49 (diff) |
Removes ACLK Legacy (#11841)
* remove legacy from makefiles
* remove ACLK Legacy from installer
* remove ACLK Legacy from configure.ac
* remove legacy from cmake
* aclk api cleanup
* remove legacy files from packaging
* changes for CI from Austin
41 files changed, 58 insertions, 5696 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e13b0e2c6..f178b993e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,10 +223,6 @@ jobs: run: | docker run --security-opt seccomp=unconfined -w /netdata sha256:${{ steps.load.outputs.image }} \ /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud' - - name: netdata-installer on ${{ matrix.distro }}, require cloud, require ACLK-NG - run: | - docker run --security-opt seccomp=unconfined -w /netdata -e NETDATA_CONFIGURE_OPTIONS='--with-aclk-ng' \ - sha256:${{ steps.load.outputs.image }} /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud' - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C if: matrix.rmjsonc != '' run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index d21ea89c4a..76abbef429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -773,26 +773,7 @@ set(ACLK_COMMON_FILES aclk/aclk_collector_list.h ) -set(ACLK_LEGACY_FILES - aclk/legacy/agent_cloud_link.c - aclk/legacy/agent_cloud_link.h - aclk/legacy/aclk_query.c - aclk/legacy/aclk_query.h - aclk/legacy/aclk_lws_wss_client.c - aclk/legacy/aclk_lws_wss_client.h - aclk/legacy/aclk_lws_https_client.c - aclk/legacy/aclk_lws_https_client.h - aclk/legacy/mqtt.c - aclk/legacy/mqtt.h - aclk/legacy/aclk_stats.c - aclk/legacy/aclk_stats.h - aclk/legacy/aclk_rx_msgs.c - aclk/legacy/aclk_rx_msgs.h - aclk/legacy/aclk_common.c - aclk/legacy/aclk_common.h - ) - -set(ACLK_NG_FILES +set(ACLK_FILES aclk/aclk.c aclk/aclk.h aclk/aclk_util.c @@ -854,11 +835,6 @@ set(SPAWN_PLUGIN_FILES spawn/spawn.h ) -set(ACLK_LEGACY_STATIC_LIBS - ${CMAKE_SOURCE_DIR}/externaldeps/mosquitto/libmosquitto.a - ${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/libwebsockets.a - ) - set(EXPORTING_ENGINE_FILES exporting/exporting_engine.c exporting/exporting_engine.h @@ -1070,31 +1046,6 @@ ENDIF() set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT}) -set(ACLK_LEGACY_CAN_BUILD 1) -if(NOT EXISTS "${CMAKE_SOURCE_DIR}/externaldeps/mosquitto/libmosquitto.a") - message(WARNING "Static build of mosquitto not found. Disabling ACLK") - set(ACLK_LEGACY_CAN_BUILD 0) -ENDIF() - -if(NOT EXISTS "${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/libwebsockets.a") - message(WARNING "Static build of libwebsockets not found. Disabling ACLK") - set(ACLK_LEGACY_CAN_BUILD 0) -ENDIF() - -IF(ACLK_LEGACY_CAN_BUILD) - message(STATUS "agent-cloud-link Legacy: enabled") - list(APPEND NETDATA_FILES ${ACLK_LEGACY_FILES}) - list(APPEND NETDATA_COMMON_LIBRARIES ${ACLK_LEGACY_STATIC_LIBS}) - include_directories(BEFORE ${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/include) - IF(LINUX AND CAP_FOUND) - list(APPEND NETDATA_COMMON_LIBRARIES ${CAP_LIBRARIES}) - list(APPEND NETDATA_COMMON_INCLUDE_DIRS ${CAP_INCLUDE_DIRS}) - list(APPEND NETDATA_COMMON_CFLAGS ${CAP_CFLAGS_OTHER}) - ENDIF() -ELSE() - message(STATUS "agent-cloud-link Legacy: disabled") -ENDIF() - find_package(Protobuf REQUIRED) function(PROTOBUF_ACLK_GENERATE_CPP SRCS HDRS) @@ -1133,7 +1084,7 @@ function(PROTOBUF_ACLK_GENERATE_CPP SRCS HDRS) set(${HDRS} ${${HDRS}} PARENT_SCOPE) endfunction() -set(ACLK_NG_PROTO_DEFS +set(ACLK_PROTO_DEFS aclk/aclk-schemas/proto/aclk/v1/lib.proto aclk/aclk-schemas/proto/agent/v1/disconnect.proto aclk/aclk-schemas/proto/agent/v1/connection.proto @@ -1147,13 +1098,13 @@ set(ACLK_NG_PROTO_DEFS aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto ) -PROTOBUF_ACLK_GENERATE_CPP(ACLK_NG_PROTO_BUILT_SRCS ACLK_NG_PROTO_BUILT_HDRS ${ACLK_NG_PROTO_DEFS}) +PROTOBUF_ACLK_GENERATE_CPP(ACLK_PROTO_BUILT_SRCS ACLK_PROTO_BUILT_HDRS ${ACLK_PROTO_DEFS}) list(APPEND NETDATA_COMMON_LIBRARIES ${PROTOBUF_LIBRARIES}) list(APPEND NETDATA_COMMON_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS}) list(APPEND NETDATA_COMMON_CFLAGS ${PROTOBUF_CFLAGS_OTHER}) list(APPEND NETDATA_FILES ${ACLK_ALWAYS_BUILD}) -list(APPEND NETDATA_FILES ${ACLK_NG_FILES} ${ACLK_NG_PROTO_BUILT_SRCS} ${ACLK_NG_PROTO_BUILT_HDRS}) +list(APPEND NETDATA_FILES ${ACLK_FILES} ${ACLK_PROTO_BUILT_SRCS} ${ACLK_PROTO_BUILT_HDRS}) list(APPEND NETDATA_FILES ${ACLK_COMMON_FILES}) include_directories(BEFORE ${CMAKE_SOURCE_DIR}/aclk/aclk-schemas) include_directories(BEFORE ${CMAKE_SOURCE_DIR}/mqtt_websockets/MQTT-C/include) diff --git a/Makefile.am b/Makefile.am index 5d7743c407..e1d0ec4712 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,8 +64,6 @@ dist_noinst_DATA = \ packaging/bundle-ebpf.sh \ packaging/bundle-judy.sh \ packaging/bundle-libbpf.sh \ - packaging/bundle-lws.sh \ - packaging/bundle-mosquitto.sh \ packaging/check-kernel-config.sh \ packaging/ebpf.checksums \ packaging/ebpf.version \ @@ -80,10 +78,6 @@ dist_noinst_DATA = \ packaging/judy.version \ packaging/libbpf.checksums \ packaging/libbpf.version \ - packaging/libwebsockets.checksums \ - packaging/libwebsockets.version \ - packaging/mosquitto.checksums \ - packaging/mosquitto.version \ packaging/protobuf.checksums \ packaging/protobuf.version \ packaging/version \ @@ -121,12 +115,6 @@ SUBDIRS += \ ml \ $(NULL) -if ENABLE_ACLK -SUBDIRS += \ - aclk/legacy \ - $(NULL) -endif - AM_CFLAGS = \ $(OPTIONAL_MATH_CFLAGS) \ $(OPTIONAL_NFACCT_CFLAGS) \ @@ -618,8 +606,8 @@ PARSER_FILES = \ parser/parser.h \ $(NULL) -if ACLK_NG -ACLK_NG_FILES = \ +if ENABLE_ACLK +ACLK_FILES = \ aclk/aclk.c \ aclk/aclk.h \ aclk/aclk_util.c \ @@ -652,7 +640,7 @@ ACLK_NG_FILES = \ $(NULL) if ENABLE_NEW_CLOUD_PROTOCOL -ACLK_NG_FILES += \ +ACLK_FILES += \ aclk/aclk_charts_api.c \ aclk/aclk_charts_api.h \ aclk/aclk_alarm_api.c \ @@ -678,7 +666,7 @@ ACLK_NG_FILES += \ aclk/schema-wrappers/schema_wrapper_utils.h \ $(NULL) -ACLK_NG_PROTO_DEFINITIONS = \ +ACLK_PROTO_DEFINITIONS = \ aclk/aclk-schemas/proto/aclk/v1/lib.proto \ aclk/aclk-schemas/proto/agent/v1/disconnect.proto \ aclk/aclk-schemas/proto/agent/v1/connection.proto \ @@ -693,9 +681,9 @@ ACLK_NG_PROTO_DEFINITIONS = \ aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto \ $(NULL) -dist_noinst_DATA += $(ACLK_NG_PROTO_DEFINITIONS) +dist_noinst_DATA += $(ACLK_PROTO_DEFINITIONS) -ACLK_NG_PROTO_BUILT_FILES = aclk/aclk-schemas/proto/agent/v1/connection.pb.cc \ +ACLK_PROTO_BUILT_FILES = aclk/aclk-schemas/proto/agent/v1/connection.pb.cc \ aclk/aclk-schemas/proto/agent/v1/connection.pb.h \ aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.pb.cc \ aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.pb.h \ @@ -721,9 +709,9 @@ ACLK_NG_PROTO_BUILT_FILES = aclk/aclk-schemas/proto/agent/v1/connection.pb.cc \ aclk/aclk-schemas/proto/nodeinstance/info/v1/info.pb.h \ $(NULL) -BUILT_SOURCES += $(ACLK_NG_PROTO_BUILT_FILES) -nodist_netdata_SOURCES += $(ACLK_NG_PROTO_BUILT_FILES) -CLEANFILES += $(ACLK_NG_PROTO_BUILT_FILES) +BUILT_SOURCES += $(ACLK_PROTO_BUILT_FILES) +nodist_netdata_SOURCES += $(ACLK_PROTO_BUILT_FILES) +CLEANFILES += $(ACLK_PROTO_BUILT_FILES) aclk/aclk-schemas/proto/agent/v1/connection.pb.cc \ aclk/aclk-schemas/proto/agent/v1/connection.pb.h: aclk/aclk-schemas/proto/agent/v1/connection.proto @@ -775,7 +763,7 @@ aclk/aclk-schemas/proto/nodeinstance/info/v1/info.pb.h: aclk/aclk-schemas/proto/ endif #ENABLE_NEW_CLOUD_PROTOCOL -endif #ACLK_NG +endif #ENABLE_ACLK if ENABLE_ACLK ACLK_COMMON_FILES = \ @@ -792,27 +780,6 @@ ACLK_ALWAYS_BUILD_FILES = \ aclk/aclk_proxy.h \ $(NULL) -if ACLK_LEGACY -ACLK_LEGACY_FILES = \ - aclk/legacy/agent_cloud_link.c \ - aclk/legacy/agent_cloud_link.h \ - aclk/legacy/aclk_query.c \ - aclk/legacy/aclk_query.h \ - aclk/legacy/mqtt.c \ - aclk/legacy/mqtt.h \ - aclk/legacy/aclk_rx_msgs.c \ - aclk/legacy/aclk_rx_msgs.h \ - aclk/legacy/aclk_lws_wss_client.c \ - aclk/legacy/aclk_lws_wss_client.h \ - aclk/legacy/aclk_lws_https_client.c \ - aclk/legacy/aclk_lws_https_client.h \ - aclk/legacy/aclk_common.c \ - aclk/legacy/aclk_common.h \ - aclk/legacy/aclk_stats.c \ - aclk/legacy/aclk_stats.h \ - $(NULL) -endif #ACLK_LEGACY - SPAWN_PLUGIN_FILES = \ spawn/spawn.c \ spawn/spawn_server.c \ @@ -929,8 +896,7 @@ NETDATA_FILES = \ $(PARSER_FILES) \ $(ACLK_ALWAYS_BUILD_FILES) \ $(ACLK_COMMON_FILES) \ - $(ACLK_LEGACY_FILES) \ - $(ACLK_NG_FILES) \ + $(ACLK_FILES) \ $(SPAWN_PLUGIN_FILES) \ $(NULL) @@ -994,7 +960,7 @@ netdata_LDADD = \ $(NETDATA_COMMON_LIBS) \ $(NULL) -if ACLK_NG +if ENABLE_ACLK netdata_LDADD += $(OPTIONAL_PROTOBUF_LIBS) \ $(OPTIONAL_ATOMIC_LIBS) \ $(NULL) @@ -1005,14 +971,6 @@ if ENABLE_ML_TESTS $(NULL) endif -if ACLK_LEGACY - netdata_LDADD += \ - $(abs_top_srcdir)/externaldeps/mosquitto/libmosquitto.a \ - $(OPTIONAL_LWS_LIBS) \ - $(OPTIONAL_LIBCAP_LIBS) \ - $(NULL) -endif #ACLK_LEGACY - if ENABLE_CXX_LINKER netdata_LINK = $(CXXLD) $(CXXFLAGS) $(LDFLAGS) -o $@ else diff --git a/aclk/aclk.c b/aclk/aclk.c index 693cb6e4b4..d5f7818c2f 100644 --- a/aclk/aclk.c +++ b/aclk/aclk.c @@ -859,7 +859,7 @@ exit: // fix this in both old and new ACLK extern void health_alarm_entry2json_nolock(BUFFER *wb, ALARM_ENTRY *ae, RRDHOST *host); -void ng_aclk_alarm_reload(void) +void aclk_alarm_reload(void) { ACLK_SHARED_STATE_LOCK; if (unlikely(aclk_shared_state.agent_state == ACLK_HOST_INITIALIZING)) { @@ -871,7 +871,7 @@ void ng_aclk_alarm_reload(void) aclk_queue_query(aclk_query_new(METADATA_ALARMS)); } -int ng_aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae) +int aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae) { BUFFER *local_buffer; json_object *msg; @@ -902,7 +902,7 @@ int ng_aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae) return 0; } -int ng_aclk_update_chart(RRDHOST *host, char *chart_name, int create) +int aclk_update_chart(RRDHOST *host, char *chart_name, int create) { struct aclk_query *query; @@ -926,7 +926,7 @@ int ng_aclk_update_chart(RRDHOST *host, char *chart_name, int create) * Add a new collector to the list * If it exists, update the chart count */ -void ng_aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *module_name) +void aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *module_name) { struct aclk_query *query; struct _collector *tmp_collector; @@ -969,7 +969,7 @@ void ng_aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *m * This function will release the memory used and schedule * a cloud update */ -void ng_aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *module_name) +void aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *module_name) { struct aclk_query *query; struct _collector *tmp_collector; @@ -1010,7 +1010,7 @@ void ng_aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *m aclk_queue_query(query); } -void ng_aclk_host_state_update(RRDHOST *host, int cmd) +void aclk_host_state_update(RRDHOST *host, int cmd) { uuid_t node_id; int ret; diff --git a/aclk/aclk.h b/aclk/aclk.h index 444de86bec..4d85463141 100644 --- a/aclk/aclk.h +++ b/aclk/aclk.h @@ -32,18 +32,18 @@ extern struct aclk_shared_state { int mqtt_shutdown_msg_rcvd; } aclk_shared_state; -void ng_aclk_alarm_reload(void); -int ng_aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae); +void aclk_alarm_reload(void); +int aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae); /* Informs ACLK about created/deleted chart * @param create 0 - if chart was deleted, other if chart created */ -int ng_aclk_update_chart(RRDHOST *host, char *chart_name, int create); +int aclk_update_chart(RRDHOST *host, char *chart_name, int create); -void ng_aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *module_name); -void ng_aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *module_name); +void aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *module_name); +void aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *module_name); -void ng_aclk_host_state_update(RRDHOST *host, int cmd); +void aclk_host_state_update(RRDHOST *host, int cmd); void aclk_send_node_instances(void); diff --git a/aclk/aclk_api.c b/aclk/aclk_api.c index 251f5b7082..172cf29827 100644 --- a/aclk/aclk_api.c +++ b/aclk/aclk_api.c @@ -2,12 +2,9 @@ #include "libnetdata/libnetdata.h" #include "database/rrd.h" -#ifdef ACLK_NG +#ifdef ENABLE_ACLK #include "aclk.h" #endif -#ifdef ACLK_LEGACY -#include "legacy/agent_cloud_link.h" -#endif int aclk_connected = 0; int aclk_kill_link = 0; @@ -20,12 +17,6 @@ int aclk_disable_single_updates = 0; int aclk_stats_enabled; -#ifdef ACLK_NG -int aclk_ng = 1; -#else -int aclk_ng = 0; -#endif - #define ACLK_IMPL_KEY_NAME "aclk implementation" #ifdef ENABLE_ACLK @@ -33,41 +24,13 @@ void *aclk_starter(void *ptr) { char *aclk_impl_req = config_get(CONFIG_SECTION_CLOUD, ACLK_IMPL_KEY_NAME, "ng"); if (!strcasecmp(aclk_impl_req, "ng")) { - aclk_ng = 1; + return aclk_main(ptr); } else if (!strcasecmp(aclk_impl_req, "legacy")) { - aclk_ng = 0; + error("Legacy ACLK is not supported anymore key \"" ACLK_IMPL_KEY_NAME "\" in section \"" CONFIG_SECTION_CLOUD "\" ignored. Using ACLK-NG."); } else { - error("Unknown value \"%s\" of key \"" ACLK_IMPL_KEY_NAME "\" in section \"" CONFIG_SECTION_CLOUD "\". Trying default ACLK %s.", aclk_impl_req, aclk_ng ? "NG" : "Legacy"); - } - -#ifndef ACLK_NG - if (aclk_ng) { - error("Configuration requests ACLK-NG but it is not available in this agent. Switching to Legacy."); - aclk_ng = 0; - } -#endif - -#ifndef ACLK_LEGACY - if (!aclk_ng) { - error("Configuration requests ACLK Legacy but it is not available in this agent. Switching to NG."); - aclk_ng = 1; - } -#endif - -#ifdef ACLK_NG - if (aclk_ng) { - info("Starting ACLK-NG"); - return aclk_main(ptr); - } -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) { - info("Starting ACLK Legacy"); - return legacy_aclk_main(ptr); + error("Unknown value \"%s\" of key \"" ACLK_IMPL_KEY_NAME "\" in section \"" CONFIG_SECTION_CLOUD "\". Using ACLK-NG. This config key will be deprecated.", aclk_impl_req); } -#endif - error_report("No ACLK could be started"); - return NULL; + return aclk_main(ptr); } void aclk_single_update_disable() @@ -79,99 +42,15 @@ void aclk_single_update_enable() { aclk_disable_single_updates = 0; } - -void aclk_alarm_reload(void) -{ -#ifdef ACLK_NG - if (aclk_ng) - ng_aclk_alarm_reload(); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - legacy_aclk_alarm_reload(); -#endif -} - -int aclk_update_chart(RRDHOST *host, char *chart_name, int create) -{ -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_update_chart(host, chart_name, create); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_update_chart(host, chart_name, create); -#endif - error_report("No usable aclk_update_chart implementation"); - return 1; -} - -int aclk_update_alarm(RRDHOST *host, ALARM_ENTRY *ae) -{ -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_update_alarm(host, ae); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_update_alarm(host, ae); -#endif - error_report("No usable aclk_update_alarm implementation"); - return 1; -} - -void aclk_add_collector(RRDHOST *host, const char *plugin_name, const char *module_name) -{ -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_add_collector(host, plugin_name, module_name); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_add_collector(host, plugin_name, module_name); -#endif - error_report("No usable aclk_add_collector implementation"); -} - -void aclk_del_collector(RRDHOST *host, const char *plugin_name, const char *module_name) -{ -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_del_collector(host, plugin_name, module_name); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_del_collector(host, plugin_name, module_name); -#endif - error_report("No usable aclk_del_collector implementation"); -} - -void aclk_host_state_update(RRDHOST *host, int connect) -{ -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_host_state_update(host, connect); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_host_state_update(host, connect); -#endif - error_report("Couldn't use any version of aclk_host_state_update"); -} - #endif /* ENABLE_ACLK */ struct label *add_aclk_host_labels(struct label *label) { -#ifdef ACLK_NG +#ifdef ENABLE_ACLK label = add_label_to_list(label, "_aclk_ng_available", "true", LABEL_SOURCE_AUTO); #else label = add_label_to_list(label, "_aclk_ng_available", "false", LABEL_SOURCE_AUTO); #endif -#ifdef ACLK_LEGACY - label = add_label_to_list(label, "_aclk_legacy_available", "true", LABEL_SOURCE_AUTO); -#else label = add_label_to_list(label, "_aclk_legacy_available", "false", LABEL_SOURCE_AUTO); -#endif #ifdef ENABLE_ACLK ACLK_PROXY_TYPE aclk_proxy; char *proxy_str; @@ -189,7 +68,7 @@ struct label *add_aclk_host_labels(struct label *label) { break; } - label = add_label_to_list(label, "_aclk_impl", aclk_ng ? "Next Generation" : "Legacy", LABEL_SOURCE_AUTO); + label = add_label_to_list(label, "_aclk_impl", "Next Generation", LABEL_SOURCE_AUTO); label = add_label_to_list(label, "_aclk_proxy", proxy_str, LABEL_SOURCE_AUTO); #endif return label; @@ -199,30 +78,14 @@ char *aclk_state(void) { #ifndef ENABLE_ACLK return strdupz("ACLK Available: No"); #else -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_state(); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_state(); + return ng_aclk_state(); #endif -#endif /* ENABLE_ACLK */ - return NULL; } char *aclk_state_json(void) { #ifndef ENABLE_ACLK - return strdupz("{\"aclk-available\": false}"); + return strdupz("{\"aclk-available\":false}"); #else -#ifdef ACLK_NG - if (aclk_ng) - return ng_aclk_state_json(); -#endif -#ifdef ACLK_LEGACY - if (!aclk_ng) - return legacy_aclk_state_json(); + return ng_aclk_state_json(); #endif -#endif /* ENABLE_ACLK */ - return NULL; } diff --git a/aclk/legacy/Makefile.am b/aclk/legacy/Makefile.am deleted file mode 100644 index 1cd876b401..0000000000 --- a/aclk/legacy/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -AUTOMAKE_OPTIONS = subdir-objects -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in - -CLEANFILES = \ - tests/install-fake-charts.d.sh \ - $(NULL) - -include $(top_srcdir)/build/subst.inc -SUFFIXES = .in - -#sbin_SCRIPTS = \ -# tests/install-fake-charts.d.sh \ -# $(NULL) - -dist_noinst_SCRIPTS = tests/install-fake-charts.d.sh -dist_noinst_DATA = tests/install-fake-charts.d.sh.in - diff --git a/aclk/legacy/aclk_common.c b/aclk/legacy/aclk_common.c deleted file mode 100644 index 7f8368e442..0000000000 --- a/aclk/legacy/aclk_common.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "aclk_common.h" - -#include "daemon/common.h" - -#ifdef ENABLE_ACLK -#include <libwebsockets.h> -#endif - -netdata_mutex_t legacy_aclk_shared_state_mutex = NETDATA_MUTEX_INITIALIZER; - -struct legacy_aclk_shared_state legacy_aclk_shared_state = { - .version_neg = 0, - .version_neg_wait_till = 0 -}; - -int aclk_decode_base_url(char *url, char **aclk_hostname, int *aclk_port) -{ - int pos = 0; - if (!strncmp("https://", url, 8)) { - pos = 8; - } else if (!strncmp("http://", url, 7)) { - error("Cannot connect ACLK over %s -> unencrypted link is not supported", url); - return 1; - } - int host_end = pos; - while (url[host_end] != 0 && url[host_end] != '/' && url[host_end] != ':') - host_end++; - if (url[host_end] == 0) { - *aclk_hostname = strdupz(url + pos); - *aclk_port = 443; - info("Setting ACLK target host=%s port=%d from %s", *aclk_hostname, *aclk_port, url); - return 0; - } - if (url[host_end] == ':') { - *aclk_hostname = callocz(host_end - pos + 1, 1); - strncpy(*aclk_hostname, url + pos, host_end - pos); - int port_end = host_end + 1; - while (url[port_end] >= '0' && url[port_end] <= '9') - port_end++; - if (port_end - host_end > 6) { - error("Port specified in %s is invalid", url); - return 0; - } - *aclk_port = atoi(&url[host_end+1]); - } - if (url[host_end] == '/') { - *aclk_port = 443; - *aclk_hostname = callocz(1, host_end - pos + 1); - strncpy(*aclk_hostname, url+pos, host_end - pos); - } - info("Setting ACLK target host=%s port=%d from %s", *aclk_hostname, *aclk_port, url); - return 0; -} diff --git a/aclk/legacy/aclk_common.h b/aclk/legacy/aclk_common.h deleted file mode 100644 index 080680ff11..0000000000 --- a/aclk/legacy/aclk_common.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef ACLK_COMMON_H -#define ACLK_COMMON_H - -#include "../aclk_rrdhost_state.h" -#include "daemon/common.h" - -extern netdata_mutex_t legacy_aclk_shared_state_mutex; |