From c89e96563157ddedcd4a6c8e8ea1e29ca6c41a53 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 3 Feb 2026 04:17:48 +0100 Subject: [PATCH] fix(factory): Suppress ubus output to prevent JSON corruption in CGI responses The factory_audit_log function's ubus call was only redirecting stderr, allowing stdout JSON output to leak into CGI responses when Gitea backup is enabled. This caused JSON parse errors in the Factory dashboard when creating snapshots. Co-Authored-By: Claude Opus 4.5 --- package/secubox/secubox-p2p/root/usr/lib/secubox/factory.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/secubox/secubox-p2p/root/usr/lib/secubox/factory.sh b/package/secubox/secubox-p2p/root/usr/lib/secubox/factory.sh index 44f552c8..008fa403 100644 --- a/package/secubox/secubox-p2p/root/usr/lib/secubox/factory.sh +++ b/package/secubox/secubox-p2p/root/usr/lib/secubox/factory.sh @@ -289,9 +289,9 @@ factory_audit_log() { echo "$(date -Iseconds 2>/dev/null || date)|$node_id|$action|$details" >> "$log_file" - # Push to Gitea if enabled + # Push to Gitea if enabled (suppress all output to avoid corrupting CGI responses) if [ "$(uci -q get secubox-p2p.gitea.enabled)" = "1" ]; then - ubus call luci.secubox-p2p push_gitea_backup "{\"message\":\"Factory: $action\"}" 2>/dev/null + ubus call luci.secubox-p2p push_gitea_backup "{\"message\":\"Factory: $action\"}" >/dev/null 2>&1 fi }