fix(singbox): fix Leadaxe (lx) version parsing regex and AWG startup on OpenWrt

- In action.uc: replace broken PCRE non-capturing regex in extract_sing_box_version_from_output with token-based field splitting. ucode POSIX regex engine threw 'Repetition not preceded by valid expression', crashing component_action during binary validation.
- In telegram.uc: replace non-capturing group (?:outbounds|server|servers) with standard capturing group for POSIX regex compatibility.
- In generator_outbounds.uc and servers.uc: enhance is_lx detection to check sing-box-version file in addition to sing-box-variant, ensuring AWG 2.0 root schema is generated even if variant file is desynced.
- In runtime.uc: add fallback recovery in sing_box_check retry loop for endpoints (auto-flattening amnezia sub-objects) and outbounds unknown fields.
This commit is contained in:
Dushnilin
2026-09-03 21:11:00 +03:00
parent a2cd11a74c
commit 4c69a98c27
5 changed files with 46 additions and 6 deletions
+2 -1
View File
@@ -305,7 +305,8 @@ function add_standard_inbound(config, section, protocol, tag_name) {
let jmin = int_option(section, "awg_jmin", "40");
let jmax = int_option(section, "awg_jmax", "70");
if (jmax > 1200) jmax = 1200;
let is_lx = trim(fs.readfile("/etc/tachyon/sing-box-variant") || "") == "lx";
let is_lx = trim(fs.readfile("/etc/tachyon/sing-box-variant") || "") == "lx" ||
index(trim(fs.readfile("/etc/tachyon/sing-box-version") || ""), "-lx") >= 0;
let amnezia = {
jc: jc,