Compare commits

...

8 Commits

Author SHA1 Message Date
jaspreetsachdev
462ff4f813 Merge pull request #915 from Telecominfraproject/release-4.1
Release 4.1
2025-08-18 12:28:42 -04:00
Jaspreet Sachdev
71b738f8ee Merge remote-tracking branch 'origin/main' into release-4.1 2025-08-18 12:26:55 -04:00
John Crispin
b995833a03 cloud_discovery: fix typo
Signed-off-by: John Crispin <john@phrozen.org>
2025-08-14 16:58:33 +02:00
John Crispin
9866d4a86e cloud_discovery: update CDS QA endpoint
Signed-off-by: John Crispin <john@phrozen.org>
2025-08-14 16:14:42 +02:00
jaspreetsachdev
4ad04c7948 Merge pull request #914 from Telecominfraproject/release-4.1
Release 4.1 merge
2025-08-14 09:54:57 -04:00
John Crispin
143d4e3b58 cloud_discovery: make the reenrollment process more robust
Signed-off-by: John Crispin <john@phrozen.org>
2025-08-14 11:44:04 +02:00
John Crispin
0735fd8c9a elfutils: fix build with GCC11
Signed-off-by: John Crispin <john@phrozen.org>
2025-08-14 10:31:04 +02:00
Tanya Singh
c7f9061eee cloud_discovery: Fix typo in cloud_discovery script
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2025-08-14 07:57:59 +02:00
2 changed files with 70 additions and 26 deletions

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');
est_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');
}
@@ -119,9 +120,10 @@ function gateway_write(data) {
if (new[key] != gateway[key])
changed = true;
}
if (changed)
if (changed) {
fs.writefile('/etc/ucentral/gateway.json', new);
system('sync');
}
return changed;
}
@@ -287,6 +289,36 @@ function interval_handler() {
}
}
function trigger_reenroll() {
ulog(LOG_INFO, 'triggering reenroll\n');
if (system('/usr/bin/est_client reenroll')) {
ulog(LOG_INFO, 'reenroll failed\n');
return;
}
ulog(LOG_INFO, 'reenroll succeeded\n');
ulog(LOG_INFO, 'stopping client\n');
system('/etc/init.d/ucentral stop');
set_state(DISCOVER);
}
function expiry_handler() {
let stat = fs.stat('/etc/ucentral/operational.ca');
if (!stat)
return;
let ret = system(`openssl x509 -checkend ${timeouts.expiry_threshold} -noout -in /certificates/operational.pem`);
if (!ret) {
ulog(LOG_INFO, 'checked certificate expiry - all ok\n');
return;
}
ulog(LOG_INFO, 'certificate will expire soon\n');
trigger_reenroll();
}
let ubus_methods = {
discover: {
call: function(req) {
@@ -361,30 +393,16 @@ let ubus_methods = {
},
args: {},
},
reenroll: {
call: function(req) {
trigger_reenroll();
return 0;
},
args: {},
},
};
function expiry_handler() {
let stat = fs.stat('/etc/ucentral/operational.ca');
if (!stat)
return;
let ret = system(`openssl x509 -checkend ${timeouts.expiry_threshold} -noout -in /certificates/operational.pem`);
if (!ret) {
ulog(LOG_INFO, 'checked certificate expiry - all ok\n');
return;
}
ulog(LOG_INFO, 'certificate will expire soon\n');
if (system('/usr/bin/est_client reenroll')) {
ulog(LOG_INFO, 'reenroll failed\n');
return;
}
ulog(LOG_INFO, 'reenroll succeeded\n');
ulog(LOG_INFO, '(re)starting client\n');
system('/etc/init.d/ucentral restart');
}
set_cds_server();
detect_certificate_type();
if (gateway_available()) {
let status = ubus.call('ucentral', 'status');

View File

@@ -0,0 +1,26 @@
From b82a8514a3f52b91ec84f703ef92740dda19d5d9 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 14 Aug 2025 10:29:29 +0200
Subject: [PATCH] elfutils: fix build with GCC11
Signed-off-by: John Crispin <john@phrozen.org>
---
package/libs/elfutils/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
index f7364c36be..76112c89ff 100644
--- a/package/libs/elfutils/Makefile
+++ b/package/libs/elfutils/Makefile
@@ -87,7 +87,7 @@ TARGET_CFLAGS += \
-Wno-unused-result \
-Wno-format-nonliteral
-ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
+ifneq ($(CONFIG_GCC_VERSION_11),y)
TARGET_CFLAGS += \
-Wno-error=use-after-free
endif
--
2.34.1