diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-05-11 08:34:29 +0200 |
---|---|---|
committer | James Mills <prologic@shortcircuit.net.au> | 2020-05-11 16:37:27 +1000 |
commit | aa3ec552c896aebafd03b9d2c1864272dcb34749 (patch) | |
tree | 02f7cd95ed84d888c27fb4bfb55df2b251b97b7b /libnetdata | |
parent | fd05e1d87751ecaa45ebd3aed2499435b1627cea (diff) |
Enable support for Netdata Cloud.
This PR merges the feature-branch to make the cloud live. It contains the following work:
Co-authored-by: Andrew Moss <1043609+amoss@users.noreply.github.com(opens in new tab)>
Co-authored-by: Jacek Kolasa <jacek.kolasa@gmail.com(opens in new tab)>
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud(opens in new tab)>
Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)>
Co-authored-by: Markos Fountoulakis <44345837+mfundul@users.noreply.github.com(opens in new tab)>
Co-authored-by: Timotej S <6674623+underhood@users.noreply.github.com(opens in new tab)>
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com(opens in new tab)>
* dashboard with new navbars, v1.0-alpha.9: PR #8478
* dashboard v1.0.11: netdata/dashboard#76
Co-authored-by: Jacek Kolasa <jacek.kolasa@gmail.com(opens in new tab)>
* Added installer code to bundle JSON-c if it's not present. PR #8836
Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)>
* Fix claiming config PR #8843
* Adds JSON-c as hard dep. for ACLK PR #8838
* Fix SSL renegotiation errors in old versions of openssl. PR #8840. Also - we have a transient problem with opensuse CI so this PR disables them with a commit from @prologic.
Co-authored-by: James Mills <prologic@shortcircuit.net.au(opens in new tab)>
* Fix claiming error handling PR #8850
* Added CI to verify JSON-C bundling code in installer PR #8853
* Make cloud-enabled flag in web/api/v1/info be independent of ACLK build success PR #8866
* Reduce ACLK_STABLE_TIMEOUT from 10 to 3 seconds PR #8871
* remove old-cloud related UI from old dashboard (accessible now via /old suffix) PR #8858
* dashboard v1.0.13 PR #8870
* dashboard v1.0.14 PR #8904
* Provide feedback on proxy setting changes PR #8895
* Change the name of the connect message to update during an ongoing session PR #8927
* Fetch active alarms from alarm_log PR #8944
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/config/appconfig.c | 19 | ||||
-rw-r--r-- | libnetdata/libnetdata.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/libnetdata/config/appconfig.c b/libnetdata/config/appconfig.c index 39a57e5ff5..e01698f028 100644 --- a/libnetdata/config/appconfig.c +++ b/libnetdata/config/appconfig.c @@ -289,18 +289,21 @@ char *appconfig_get_by_section(struct section *co, const char *name, const char { struct config_option *cv; + // Only calls internal to this file check for a NULL result and they do not supply a NULL arg. + // External caller should treat NULL as an error case. cv = appconfig_option_index_find(co, name, 0); - if(!cv) { + if (!cv) { + if (!default_value) return NULL; cv = appconfig_value_create(co, name, default_value); - if(!cv) return NULL; + if (!cv) return NULL; } cv->flags |= CONFIG_VALUE_USED; if((cv->flags & CONFIG_VALUE_LOADED) || (cv->flags & CONFIG_VALUE_CHANGED)) { // this is a loaded value from the config file - // if it is different that the default, mark it + // if it is different than the default, mark it if(!(cv->flags & CONFIG_VALUE_CHECKED)) { - if(strcmp(cv->value, default_value) != 0) cv->flags |= CONFIG_VALUE_CHANGED; + if(default_value && strcmp(cv->value, default_value) != 0) cv->flags |= CONFIG_VALUE_CHANGED; cv->flags |= CONFIG_VALUE_CHECKED; } } @@ -308,11 +311,17 @@ char *appconfig_get_by_section(struct section *co, const char *name, const char return(cv->value); } + char *appconfig_get(struct config *root, const char *section, const char *name, const char *default_value) { - debug(D_CONFIG, "request to get config in section '%s', name '%s', default_value '%s'", section, name, default_value); + if (default_value == NULL) + debug(D_CONFIG, "request to get config in section '%s', name '%s' or fail", section, name); + else + debug(D_CONFIG, "request to get config in section '%s', name '%s', default_value '%s'", section, name, default_value); struct section *co = appconfig_section_find(root, section); + if (!co && !default_value) + return NULL; if(!co) co = appconfig_section_create(root, section); return appconfig_get_by_section(co, name, default_value); diff --git a/libnetdata/libnetdata.h b/libnetdata/libnetdata.h index 6ad150edaa..45ac6e81bf 100644 --- a/libnetdata/libnetdata.h +++ b/libnetdata/libnetdata.h @@ -323,6 +323,6 @@ extern char *netdata_configured_host_prefix; #include "string/utf8.h" // BEWARE: Outside of the C code this also exists in alarm-notify.sh -#define DEFAULT_CLOUD_BASE_URL "https://netdata.cloud" +#define DEFAULT_CLOUD_BASE_URL "https://app.netdata.cloud" #endif // NETDATA_LIB_H |