From 75e3f5920798c43d8a25dcc319e4eec4b847b903 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 3 Feb 2026 16:57:53 +0100 Subject: [PATCH] fix(wireguard-dashboard): Bypass jshn for QR code output to avoid argument size limit The base64-encoded SVG QR code exceeded jshn's argument list limit, causing "Argument list too long" errors. Build the JSON response manually via file I/O so the large string is never passed as a command argument. Co-Authored-By: Claude Opus 4.5 --- .../root/usr/libexec/rpcd/luci.wireguard-dashboard | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/package/secubox/luci-app-wireguard-dashboard/root/usr/libexec/rpcd/luci.wireguard-dashboard b/package/secubox/luci-app-wireguard-dashboard/root/usr/libexec/rpcd/luci.wireguard-dashboard index f57b15f2..8790fccc 100755 --- a/package/secubox/luci-app-wireguard-dashboard/root/usr/libexec/rpcd/luci.wireguard-dashboard +++ b/package/secubox/luci-app-wireguard-dashboard/root/usr/libexec/rpcd/luci.wireguard-dashboard @@ -788,13 +788,17 @@ PersistentKeepalive = 25" PresharedKey = ${psk}" fi - # Generate QR code as SVG (PNG disabled in OpenWrt qrencode) and convert to base64 - local qr_base64=$(echo "$config" | qrencode -t SVG -o - | base64 -w 0) + # Generate QR code as SVG and convert to base64 + # Build JSON manually to avoid jshn "Argument list too long" with large base64 strings + local tmpfile="/tmp/wg_qr_$$.json" + local config_escaped=$(printf '%s' "$config" | sed 's/\\/\\\\/g; s/"/\\"/g' | awk '{printf "%s\\n", $0}' | sed '$ s/\\n$//') - json_add_string "qrcode" "data:image/svg+xml;base64,$qr_base64" - json_add_string "config" "$config" + printf '{"qrcode":"data:image/svg+xml;base64,' > "$tmpfile" + echo "$config" | qrencode -t SVG -o - | base64 -w 0 >> "$tmpfile" + printf '","config":"%s"}\n' "$config_escaped" >> "$tmpfile" - json_dump + cat "$tmpfile" + rm -f "$tmpfile" } # Get bandwidth history (if vnstat available)