mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 10:57:47 +00:00
cloud_discovery: update CDS QA endpoint
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -33,7 +33,7 @@ let timeouts = {
|
|||||||
'orphan': 2 * 60 * 60,
|
'orphan': 2 * 60 * 60,
|
||||||
interval: 10000,
|
interval: 10000,
|
||||||
expiry_interval: 60 * 60 * 1000,
|
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");
|
ulog_open(ULOG_SYSLOG | ULOG_STDIO, LOG_DAEMON, "cloud_discover");
|
||||||
@@ -44,14 +44,15 @@ uloop.init();
|
|||||||
|
|
||||||
let cds_server = 'discovery.open-lan.org';
|
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 pipe = fs.popen(`openssl x509 -in /etc/ucentral/cert.pem -noout -issuer`);
|
||||||
let issuer = pipe.read("all");
|
let issuer = pipe.read("all");
|
||||||
pipe.close();
|
pipe.close();
|
||||||
|
|
||||||
if (!match(issuer, /Telecom Infra Project Issuing CA/)) {
|
if (!match(issuer, /Telecom Infra Project Issuing CA/)) {
|
||||||
ulog(LOG_INFO, 'Certificate type is "Demo" \n');
|
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 {
|
} else {
|
||||||
ulog(LOG_INFO, 'Certificate type is "TIP"\n');
|
ulog(LOG_INFO, 'Certificate type is "TIP"\n');
|
||||||
}
|
}
|
||||||
@@ -401,7 +402,7 @@ let ubus_methods = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
set_cds_server();
|
detect_certificate_type();
|
||||||
|
|
||||||
if (gateway_available()) {
|
if (gateway_available()) {
|
||||||
let status = ubus.call('ucentral', 'status');
|
let status = ubus.call('ucentral', 'status');
|
||||||
|
|||||||
Reference in New Issue
Block a user