cloud_discovery: update CDS QA endpoint

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-08-14 16:14:42 +02:00
parent 143d4e3b58
commit 9866d4a86e

View File

@@ -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');