diff --git a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery index 27dda32da..1a4b2b0dc 100755 --- a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery +++ b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery @@ -33,7 +33,7 @@ let timeouts = { 'orphan': 2 * 60 * 60, interval: 10000, expiry_interval: 60 * 60 * 1000, - expiry_threshold: 3 * 24 * 60 * 60, + expiry_threshold: 1 * 365 * 24 * 60 * 60, }; ulog_open(ULOG_SYSLOG | ULOG_STDIO, LOG_DAEMON, "cloud_discover"); @@ -44,14 +44,15 @@ uloop.init(); let cds_server = 'discovery.open-lan.org'; -function set_cds_server() { +function detect_certificate_type() { let pipe = fs.popen(`openssl x509 -in /etc/ucentral/cert.pem -noout -issuer`); let issuer = pipe.read("all"); pipe.close(); if (!match(issuer, /Telecom Infra Project Issuing CA/)) { ulog(LOG_INFO, 'Certificate type is "Demo" \n'); - cds_server = 'openlan.keys.tip.build'; + cds_server = 'discovery-qa.open-lan.org'; + timeouts.expiry_threshold: 3 * 24 * 60 * 60, } else { ulog(LOG_INFO, 'Certificate type is "TIP"\n'); } @@ -401,7 +402,7 @@ let ubus_methods = { }, }; -set_cds_server(); +detect_certificate_type(); if (gateway_available()) { let status = ubus.call('ucentral', 'status');