diff options
author | George Moschovitis <george.moschovitis@gmail.com> | 2018-12-13 15:30:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-13 15:30:21 +0200 |
commit | 6b05a213029d0097a98e26b6c2aa4ff635f37182 (patch) | |
tree | 7099b599cd7a19916f9cbee882e5012b27b2d1f0 /registry | |
parent | a1690b4978675c3ca995d1ec1613a84a66d2a8c0 (diff) |
Pass cloud_base_url from daemon to web/gui through hello endpoint #4980 (#4982)
* Pass cloud_base_url from daemon to web/gui through hello endpoint #4980
* Make sure the [cloud] section goes into the general part of netdata.conf #4980
Diffstat (limited to 'registry')
-rw-r--r-- | registry/registry.c | 6 | ||||
-rw-r--r-- | registry/registry_init.c | 1 | ||||
-rw-r--r-- | registry/registry_internals.h | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/registry/registry.c b/registry/registry.c index 4f97eb58fd..9a38fcbadb 100644 --- a/registry/registry.c +++ b/registry/registry.c @@ -131,8 +131,10 @@ static inline int registry_person_url_callback_verify_machine_exists(void *entry int registry_request_hello_json(RRDHOST *host, struct web_client *w) { registry_json_header(host, w, "hello", REGISTRY_STATUS_OK); - buffer_sprintf(w->response.data, ",\n\t\"registry\": \"%s\"", - registry.registry_to_announce); + buffer_sprintf(w->response.data, + ",\n\t\"registry\": \"%s\",\n\t\"cloud_base_url\": \"%s\"", + registry.registry_to_announce, + registry.cloud_base_url); registry_json_footer(w); return 200; diff --git a/registry/registry_init.c b/registry/registry_init.c index d3e0420d2c..b8af0ad869 100644 --- a/registry/registry_init.c +++ b/registry/registry_init.c @@ -37,6 +37,7 @@ int registry_init(void) { registry.persons_expiration = config_get_number(CONFIG_SECTION_REGISTRY, "registry expire idle persons days", 365) * 86400; registry.registry_domain = config_get(CONFIG_SECTION_REGISTRY, "registry domain", ""); registry.registry_to_announce = config_get(CONFIG_SECTION_REGISTRY, "registry to announce", "https://registry.my-netdata.io"); + registry.cloud_base_url = config_get(CONFIG_SECTION_CLOUD, "cloud base url", "https://netdata.cloud"); registry.hostname = config_get(CONFIG_SECTION_REGISTRY, "registry hostname", netdata_configured_hostname); registry.verify_cookies_redirects = config_get_boolean(CONFIG_SECTION_REGISTRY, "verify browser cookies support", 1); diff --git a/registry/registry_internals.h b/registry/registry_internals.h index baa2dc09dd..c126e454bd 100644 --- a/registry/registry_internals.h +++ b/registry/registry_internals.h @@ -37,6 +37,7 @@ struct registry { char *registry_domain; char *hostname; char *registry_to_announce; + char *cloud_base_url; time_t persons_expiration; // seconds to expire idle persons int verify_cookies_redirects; |