From 4d6892e733ddca188c6580b4ca5d848b161512cb Mon Sep 17 00:00:00 2001 From: Dushnilin Date: Wed, 16 Sep 2026 09:45:06 +0300 Subject: [PATCH] fix: resolve dashboard tile unselection, fuzzer probe parsing and complete translations --- fe-app-tachyon/fill-po-translations.js | 12 +++++ fe-app-tachyon/locales/calls.json | 14 +++--- fe-app-tachyon/locales/tachyon.pot | 18 ++++---- fe-app-tachyon/locales/tachyon.ru.po | 28 +++++------ .../methods/custom/getDashboardSections.ts | 10 ++-- .../resources/view/tachyon/main.js | 6 +-- luci-app-tachyon/po/ru/tachyon.po | 28 +++++------ luci-app-tachyon/po/templates/tachyon.pot | 18 ++++---- tachyon/files/usr/lib/diagnostics/fuzzer.uc | 46 +++++++++++-------- tachyon/files/usr/lib/service/ui.uc | 25 +++++++++- 10 files changed, 127 insertions(+), 78 deletions(-) diff --git a/fe-app-tachyon/fill-po-translations.js b/fe-app-tachyon/fill-po-translations.js index 2233129b..988e010f 100644 --- a/fe-app-tachyon/fill-po-translations.js +++ b/fe-app-tachyon/fill-po-translations.js @@ -1364,6 +1364,18 @@ const dictionary = { "Subnet %s is a Cloudflare Anycast range used by Discord Voice. Only UDP voice traffic (ports 50000-65535, 3478, 19294-19344, 5000-5020) is routed through this section; web traffic (TCP 80/443) goes direct.": "Подсеть %s — диапазон Cloudflare Anycast, используемый Discord Voice. Только голосовой UDP-трафик (порты 50000-65535, 3478, 19294-19344, 5000-5020) направляется через этот раздел; веб-трафик (TCP 80/443) идет напрямую.", "Add URLs or local paths to .lst / .txt lists containing domains and subnets.": "Добавьте URL или локальные пути к спискам .lst / .txt, содержащим домены и подсети.", "Add URLs or local paths to .lst / .txt lists containing domains. IP entries are ignored.": "Добавьте URL или локальные пути к спискам .lst / .txt, содержащим домены. IP-записи игнорируются.", + "🔍 Analyzing DPI blocking patterns...": "🔍 Анализ паттернов блокировки DPI...", + "🧬 Adaptive Smart Fuzzing (Genetic / Prior Seeds)": "🧬 Адаптивный умный фаззинг (генетический / по базовым шаблонам)", + "🛡️ Stage 2: Stability Verification": "🛡️ Этап 2: Проверка стабильности", + "FPTN Access Token": "Токен доступа FPTN", + "FPTN Bypass Method": "Метод обхода FPTN", + "FPTN Preferred Server": "Предпочитаемый сервер FPTN", + "FPTN SNI": "SNI для FPTN", + "Optional: override bypass method (e.g. quic, tcp)": "Опционально: переопределить метод обхода (напр. quic, tcp)", + "Optional: override TLS SNI for FPTN connection": "Опционально: переопределить TLS SNI для подключения FPTN", + "Optional: preferred FPTN server address": "Опционально: предпочитаемый адрес сервера FPTN", + "stability (3x)": "стабильность (3x)", + "Stage 1: Exploration Scan": "Этап 1: Разведочное сканирование", }; function escapePoString(str) { diff --git a/fe-app-tachyon/locales/calls.json b/fe-app-tachyon/locales/calls.json index ac1a89a5..8f7a6e84 100644 --- a/fe-app-tachyon/locales/calls.json +++ b/fe-app-tachyon/locales/calls.json @@ -2933,7 +2933,7 @@ "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16027", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713", - "src/tachyon/methods/custom/getDashboardSections.ts:1860", + "src/tachyon/methods/custom/getDashboardSections.ts:1864", "src/tachyon/tabs/dashboard/partials/renderSections.ts:335", "src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:172" ] @@ -8836,7 +8836,7 @@ "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16038", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713", - "src/tachyon/methods/custom/getDashboardSections.ts:1863", + "src/tachyon/methods/custom/getDashboardSections.ts:1867", "src/tachyon/tabs/dashboard/partials/renderSections.ts:338", "src/tachyon/tabs/diagnostic/checks/runInboundsCheck.ts:46", "src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:183" @@ -11162,8 +11162,8 @@ "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3108", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3109", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:327", - "src/tachyon/methods/custom/getDashboardSections.ts:1713", - "src/tachyon/methods/custom/getDashboardSections.ts:1858", + "src/tachyon/methods/custom/getDashboardSections.ts:1717", + "src/tachyon/methods/custom/getDashboardSections.ts:1862", "src/tachyon/tabs/dashboard/partials/renderSections.ts:333", "src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:166" ] @@ -12646,8 +12646,8 @@ "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3114", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:333", - "src/tachyon/methods/custom/getDashboardSections.ts:1713", - "src/tachyon/methods/custom/getDashboardSections.ts:1862", + "src/tachyon/methods/custom/getDashboardSections.ts:1717", + "src/tachyon/methods/custom/getDashboardSections.ts:1866", "src/tachyon/tabs/dashboard/partials/renderSections.ts:337", "src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:178" ] @@ -14266,7 +14266,7 @@ "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3131", "../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:354", - "src/tachyon/methods/custom/getDashboardSections.ts:1864", + "src/tachyon/methods/custom/getDashboardSections.ts:1868", "src/tachyon/tabs/dashboard/partials/renderSections.ts:339", "src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:188" ] diff --git a/fe-app-tachyon/locales/tachyon.pot b/fe-app-tachyon/locales/tachyon.pot index 930a6bfe..8fed77e8 100644 --- a/fe-app-tachyon/locales/tachyon.pot +++ b/fe-app-tachyon/locales/tachyon.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: TACHYON\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-16 05:36+0300\n" -"PO-Revision-Date: 2026-09-16 05:36+0300\n" +"POT-Creation-Date: 2026-09-16 06:44+0300\n" +"PO-Revision-Date: 2026-09-16 06:44+0300\n" "Last-Translator: Dushnilin \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1845,7 +1845,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16027 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1860 +#: src/tachyon/methods/custom/getDashboardSections.ts:1864 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:335 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:172 msgid "Conflict" @@ -5477,7 +5477,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16038 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1863 +#: src/tachyon/methods/custom/getDashboardSections.ts:1867 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:338 #: src/tachyon/tabs/diagnostic/checks/runInboundsCheck.ts:46 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:183 @@ -6906,8 +6906,8 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3108 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3109 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:327 -#: src/tachyon/methods/custom/getDashboardSections.ts:1713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1858 +#: src/tachyon/methods/custom/getDashboardSections.ts:1717 +#: src/tachyon/methods/custom/getDashboardSections.ts:1862 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:333 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:166 msgid "Running" @@ -7808,8 +7808,8 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3114 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:333 -#: src/tachyon/methods/custom/getDashboardSections.ts:1713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1862 +#: src/tachyon/methods/custom/getDashboardSections.ts:1717 +#: src/tachyon/methods/custom/getDashboardSections.ts:1866 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:337 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:178 msgid "Stopped" @@ -8813,7 +8813,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3131 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:354 -#: src/tachyon/methods/custom/getDashboardSections.ts:1864 +#: src/tachyon/methods/custom/getDashboardSections.ts:1868 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:339 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:188 msgid "Unknown" diff --git a/fe-app-tachyon/locales/tachyon.ru.po b/fe-app-tachyon/locales/tachyon.ru.po index 026f1998..6f01b9e3 100644 --- a/fe-app-tachyon/locales/tachyon.ru.po +++ b/fe-app-tachyon/locales/tachyon.ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: TACHYON\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-16 08:36+0300\n" -"PO-Revision-Date: 2026-09-16 08:36+0300\n" +"POT-Creation-Date: 2026-09-16 09:44+0300\n" +"PO-Revision-Date: 2026-09-16 09:44+0300\n" "Last-Translator: Dushnilin\n" "Language-Team: none\n" "Language: ru\n" @@ -138,7 +138,7 @@ msgid "🔄 Reset to Factory Defaults" msgstr "🔄 Сбросить к заводским настройкам" msgid "🔍 Analyzing DPI blocking patterns..." -msgstr "" +msgstr "🔍 Анализ паттернов блокировки DPI..." msgid "🔍 Combinatorial Deep Fuzzing (~150-300+)" msgstr "🔍 Комбинаторный глубокий фаззинг (~150-300+)" @@ -156,7 +156,7 @@ msgid "🧠 Synthesizing..." msgstr "🧠 Генерация..." msgid "🧬 Adaptive Smart Fuzzing (Genetic / Prior Seeds)" -msgstr "" +msgstr "🧬 Адаптивный умный фаззинг (генетический / по базовым шаблонам)" msgid "🚀 Initializing benchmark in sandbox..." msgstr "🚀 Инициализация бенчмарка в песочнице..." @@ -180,7 +180,7 @@ msgid "🛡️ SECURE: Public IP is concealed behind the proxy outbound." msgstr "🛡️ ЗАЩИЩЕНО: Публичный IP-адрес скрыт за исходящим прокси." msgid "🛡️ Stage 2: Stability Verification" -msgstr "" +msgstr "🛡️ Этап 2: Проверка стабильности" msgid "🟣 Twitch Suite (Live Stream + HLS CDN)" msgstr "🟣 Twitch (Прямой эфир + HLS CDN)" @@ -2190,16 +2190,16 @@ msgid "Found" msgstr "Найдено" msgid "FPTN Access Token" -msgstr "" +msgstr "Токен доступа FPTN" msgid "FPTN Bypass Method" -msgstr "" +msgstr "Метод обхода FPTN" msgid "FPTN Preferred Server" -msgstr "" +msgstr "Предпочитаемый сервер FPTN" msgid "FPTN SNI" -msgstr "" +msgstr "SNI для FPTN" msgid "France (fr)" msgstr "Франция (fr)" @@ -3579,13 +3579,13 @@ msgid "Optional values must be attached with '=' here; a separate token would be msgstr "Опциональные значения должны быть присоединены через '=' здесь; отдельный токен будет игнорироваться nfqws2." msgid "Optional: override bypass method (e.g. quic, tcp)" -msgstr "" +msgstr "Опционально: переопределить метод обхода (напр. quic, tcp)" msgid "Optional: override TLS SNI for FPTN connection" -msgstr "" +msgstr "Опционально: переопределить TLS SNI для подключения FPTN" msgid "Optional: preferred FPTN server address" -msgstr "" +msgstr "Опционально: предпочитаемый адрес сервера FPTN" msgid "Optionally specify individual devices not in a profile. MAC addresses (e.g. AA:BB:CC:DD:EE:FF) work even if the IP changes." msgstr "При необходимости укажите отдельные устройства вне профилей. MAC-адреса (напр. AA:BB:CC:DD:EE:FF) работают даже при смене IP." @@ -4773,10 +4773,10 @@ msgid "SSH" msgstr "SSH" msgid "stability (3x)" -msgstr "" +msgstr "стабильность (3x)" msgid "Stage 1: Exploration Scan" -msgstr "" +msgstr "Этап 1: Разведочное сканирование" msgid "Standalone ByeDPI autostart is enabled" msgstr "Автозапуск отдельной службы ByeDPI включен" diff --git a/fe-app-tachyon/src/tachyon/methods/custom/getDashboardSections.ts b/fe-app-tachyon/src/tachyon/methods/custom/getDashboardSections.ts index c29d9077..011e64ce 100644 --- a/fe-app-tachyon/src/tachyon/methods/custom/getDashboardSections.ts +++ b/fe-app-tachyon/src/tachyon/methods/custom/getDashboardSections.ts @@ -128,9 +128,9 @@ type ChildType = | 'priority_level'; const DASHBOARD_SECTION_CACHE_DIR = '/var/run/tachyon/section-cache'; -const CLASH_API_FETCH_TIMEOUT_MS = 1200; +const CLASH_API_FETCH_TIMEOUT_MS = 2500; let directClashApiFailedAt = 0; -const DIRECT_CLASH_API_COOLDOWN_MS = 60_000; +const DIRECT_CLASH_API_COOLDOWN_MS = 10_000; export function resetDirectClashApiState() { directClashApiFailedAt = 0; @@ -1274,7 +1274,11 @@ function buildProxyGroupOutbounds( ...priorityCodes, ]); - const selectorNow = selector?.value?.now; + const selectorNow = + selector?.value?.now || + (selectorCodes.length > 0 ? selectorCodes[0] : undefined) || + urlTestCodes[0] || + priorityCodes[0]; const outbounds = uniqueCodes(groupCodes).flatMap((code) => { const item = proxyByCode.get(code); diff --git a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js index c44a0759..ecf61c49 100644 --- a/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js +++ b/luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js @@ -4485,9 +4485,9 @@ var TachyonShellMethods = { // src/tachyon/methods/custom/getDashboardSections.ts var DASHBOARD_SECTION_CACHE_DIR = "/var/run/tachyon/section-cache"; -var CLASH_API_FETCH_TIMEOUT_MS = 1200; +var CLASH_API_FETCH_TIMEOUT_MS = 2500; var directClashApiFailedAt = 0; -var DIRECT_CLASH_API_COOLDOWN_MS = 6e4; +var DIRECT_CLASH_API_COOLDOWN_MS = 1e4; function getDisplayName(section) { return section.label || section[".name"]; } @@ -5298,7 +5298,7 @@ function buildProxyGroupOutbounds(section, proxies, outboundMetadata, urltestGro ...urlTestCodes, ...priorityCodes ]); - const selectorNow = selector?.value?.now; + const selectorNow = selector?.value?.now || (selectorCodes.length > 0 ? selectorCodes[0] : void 0) || urlTestCodes[0] || priorityCodes[0]; const outbounds = uniqueCodes(groupCodes).flatMap((code) => { const item = proxyByCode.get(code); const urlTestConfig = urlTestConfigByCode.get(code); diff --git a/luci-app-tachyon/po/ru/tachyon.po b/luci-app-tachyon/po/ru/tachyon.po index 026f1998..6f01b9e3 100644 --- a/luci-app-tachyon/po/ru/tachyon.po +++ b/luci-app-tachyon/po/ru/tachyon.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: TACHYON\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-16 08:36+0300\n" -"PO-Revision-Date: 2026-09-16 08:36+0300\n" +"POT-Creation-Date: 2026-09-16 09:44+0300\n" +"PO-Revision-Date: 2026-09-16 09:44+0300\n" "Last-Translator: Dushnilin\n" "Language-Team: none\n" "Language: ru\n" @@ -138,7 +138,7 @@ msgid "🔄 Reset to Factory Defaults" msgstr "🔄 Сбросить к заводским настройкам" msgid "🔍 Analyzing DPI blocking patterns..." -msgstr "" +msgstr "🔍 Анализ паттернов блокировки DPI..." msgid "🔍 Combinatorial Deep Fuzzing (~150-300+)" msgstr "🔍 Комбинаторный глубокий фаззинг (~150-300+)" @@ -156,7 +156,7 @@ msgid "🧠 Synthesizing..." msgstr "🧠 Генерация..." msgid "🧬 Adaptive Smart Fuzzing (Genetic / Prior Seeds)" -msgstr "" +msgstr "🧬 Адаптивный умный фаззинг (генетический / по базовым шаблонам)" msgid "🚀 Initializing benchmark in sandbox..." msgstr "🚀 Инициализация бенчмарка в песочнице..." @@ -180,7 +180,7 @@ msgid "🛡️ SECURE: Public IP is concealed behind the proxy outbound." msgstr "🛡️ ЗАЩИЩЕНО: Публичный IP-адрес скрыт за исходящим прокси." msgid "🛡️ Stage 2: Stability Verification" -msgstr "" +msgstr "🛡️ Этап 2: Проверка стабильности" msgid "🟣 Twitch Suite (Live Stream + HLS CDN)" msgstr "🟣 Twitch (Прямой эфир + HLS CDN)" @@ -2190,16 +2190,16 @@ msgid "Found" msgstr "Найдено" msgid "FPTN Access Token" -msgstr "" +msgstr "Токен доступа FPTN" msgid "FPTN Bypass Method" -msgstr "" +msgstr "Метод обхода FPTN" msgid "FPTN Preferred Server" -msgstr "" +msgstr "Предпочитаемый сервер FPTN" msgid "FPTN SNI" -msgstr "" +msgstr "SNI для FPTN" msgid "France (fr)" msgstr "Франция (fr)" @@ -3579,13 +3579,13 @@ msgid "Optional values must be attached with '=' here; a separate token would be msgstr "Опциональные значения должны быть присоединены через '=' здесь; отдельный токен будет игнорироваться nfqws2." msgid "Optional: override bypass method (e.g. quic, tcp)" -msgstr "" +msgstr "Опционально: переопределить метод обхода (напр. quic, tcp)" msgid "Optional: override TLS SNI for FPTN connection" -msgstr "" +msgstr "Опционально: переопределить TLS SNI для подключения FPTN" msgid "Optional: preferred FPTN server address" -msgstr "" +msgstr "Опционально: предпочитаемый адрес сервера FPTN" msgid "Optionally specify individual devices not in a profile. MAC addresses (e.g. AA:BB:CC:DD:EE:FF) work even if the IP changes." msgstr "При необходимости укажите отдельные устройства вне профилей. MAC-адреса (напр. AA:BB:CC:DD:EE:FF) работают даже при смене IP." @@ -4773,10 +4773,10 @@ msgid "SSH" msgstr "SSH" msgid "stability (3x)" -msgstr "" +msgstr "стабильность (3x)" msgid "Stage 1: Exploration Scan" -msgstr "" +msgstr "Этап 1: Разведочное сканирование" msgid "Standalone ByeDPI autostart is enabled" msgstr "Автозапуск отдельной службы ByeDPI включен" diff --git a/luci-app-tachyon/po/templates/tachyon.pot b/luci-app-tachyon/po/templates/tachyon.pot index 930a6bfe..8fed77e8 100644 --- a/luci-app-tachyon/po/templates/tachyon.pot +++ b/luci-app-tachyon/po/templates/tachyon.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: TACHYON\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-09-16 05:36+0300\n" -"PO-Revision-Date: 2026-09-16 05:36+0300\n" +"POT-Creation-Date: 2026-09-16 06:44+0300\n" +"PO-Revision-Date: 2026-09-16 06:44+0300\n" "Last-Translator: Dushnilin \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1845,7 +1845,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16027 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1860 +#: src/tachyon/methods/custom/getDashboardSections.ts:1864 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:335 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:172 msgid "Conflict" @@ -5477,7 +5477,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:16038 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:2069 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1863 +#: src/tachyon/methods/custom/getDashboardSections.ts:1867 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:338 #: src/tachyon/tabs/diagnostic/checks/runInboundsCheck.ts:46 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:183 @@ -6906,8 +6906,8 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3108 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3109 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:327 -#: src/tachyon/methods/custom/getDashboardSections.ts:1713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1858 +#: src/tachyon/methods/custom/getDashboardSections.ts:1717 +#: src/tachyon/methods/custom/getDashboardSections.ts:1862 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:333 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:166 msgid "Running" @@ -7808,8 +7808,8 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3114 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:333 -#: src/tachyon/methods/custom/getDashboardSections.ts:1713 -#: src/tachyon/methods/custom/getDashboardSections.ts:1862 +#: src/tachyon/methods/custom/getDashboardSections.ts:1717 +#: src/tachyon/methods/custom/getDashboardSections.ts:1866 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:337 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:178 msgid "Stopped" @@ -8813,7 +8813,7 @@ msgstr "" #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/main.js:5713 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:3131 #: ../luci-app-tachyon/htdocs/luci-static/resources/view/tachyon/settings.js:354 -#: src/tachyon/methods/custom/getDashboardSections.ts:1864 +#: src/tachyon/methods/custom/getDashboardSections.ts:1868 #: src/tachyon/tabs/dashboard/partials/renderSections.ts:339 #: src/tachyon/tabs/diagnostic/checks/runSectionsCheck.ts:188 msgid "Unknown" diff --git a/tachyon/files/usr/lib/diagnostics/fuzzer.uc b/tachyon/files/usr/lib/diagnostics/fuzzer.uc index d145846a..cd2d2789 100644 --- a/tachyon/files/usr/lib/diagnostics/fuzzer.uc +++ b/tachyon/files/usr/lib/diagnostics/fuzzer.uc @@ -188,14 +188,14 @@ function wrap_cmd_timeout(cmd, sec, pid_file) { } if (pid_file && pid_file != "") { if (_has_timeout) { - return sprintf("sh -c 'echo $$ > %s; exec timeout -s KILL %d %s'", shell_quote(pid_file), sec, cmd); + return sprintf("( echo $$ > %s; timeout -s KILL %d %s )", shell_quote(pid_file), sec, cmd); } - return sprintf("sh -c 'echo $$ > %s; ( %s ) & p=$!; ( sleep %d; kill -9 $p 2>/dev/null ) & w=$!; wait $p 2>/dev/null; r=$?; kill -9 $w 2>/dev/null; wait $w 2>/dev/null; [ $r -ne 0 ] && printf \"\\t%%d\\n\" $r; exit $r'", shell_quote(pid_file), cmd, sec); + return sprintf("( echo $$ > %s; %s )", shell_quote(pid_file), cmd); } if (_has_timeout) { return sprintf("timeout -s KILL %d %s", sec, cmd); } - return sprintf("( %s ) & p=$!; ( sleep %d; kill -9 $p 2>/dev/null ) & w=$!; wait $p 2>/dev/null; r=$?; kill -9 $w 2>/dev/null; wait $w 2>/dev/null; [ $r -ne 0 ] && printf \"\\t%%d\\n\" $r; exit $r", cmd, sec); + return cmd; } let _fuzzer_curl_dns_flags = null; @@ -2156,7 +2156,19 @@ function parse_curl_output(output, result) { return result; } - let parts = split(output, "\t"); + // In case there are multiple lines (e.g. warnings or messages), find the tab-delimited metrics line + let lines = split(output, "\n"); + let target_line = ""; + for (let l in lines) { + let tl = trim(l); + if (index(tl, "\t") >= 0) { + target_line = tl; + break; + } + } + if (target_line == "") target_line = trim(lines[length(lines) - 1]); + + let parts = split(target_line, "\t"); if (length(parts) < 4) { result.success = false; result.http_code = 0; @@ -2169,9 +2181,9 @@ function parse_curl_output(output, result) { } let http_code = int(parts[0]); - let appconnect = double(parts[1]); - let starttransfer = double(parts[2]); - let speed_bytes = double(parts[3]); + let appconnect = 1.0 * parts[1]; + let starttransfer = 1.0 * parts[2]; + let speed_bytes = 1.0 * parts[3]; let size_download = length(parts) >= 5 ? int(parts[4]) : 0; let exit_code = length(parts) >= 6 ? int(parts[5]) : 0; @@ -2414,6 +2426,9 @@ function rerank_strategies_by_dpi(strategies, dpi_type) { function run_probe(engine, args_str, target_key, custom_url, job_id) { cleanup_temp_daemons(job_id); + if (job_id && job_id != "") { + ensure_job_dir(job_id); + } let job_dir = get_job_dir(job_id); let probe_pid_path = job_dir ? (job_dir + "/probe.pid") : (STATE_DIR + "/fuzzer_probe.pid"); try { fs.unlink(probe_pid_path); } catch (e) {} @@ -2459,7 +2474,7 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { system(common.background_command_with_pid(spawn_cmd, ">/dev/null", ">" + shell_quote(pid_path))); let pid_running = false; - for (let wait_i = 0; wait_i < 10; wait_i++) { + for (let wait_i = 0; wait_i < 15; wait_i++) { system("sleep 0.1"); let pid_str = fs.readfile(pid_path); if (pid_str) { @@ -2469,10 +2484,6 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { break; } } - let err_content = fs.readfile(stderr_log); - if (err_content && trim(as_string(err_content)) != "") { - break; - } } if (!pid_running) { @@ -2658,7 +2669,7 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { system(common.background_command(spawn_cmd)); let pid_running = false; - for (let wait_i = 0; wait_i < 10; wait_i++) { + for (let wait_i = 0; wait_i < 15; wait_i++) { system("sleep 0.1"); let pid_str = fs.readfile(pid_path); if (pid_str) { @@ -2668,10 +2679,6 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { break; } } - let err_content = fs.readfile(stderr_log); - if (err_content && trim(as_string(err_content)) != "") { - break; - } } if (!pid_running) { @@ -2683,7 +2690,7 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { for (let i = length(lines) - 1; i >= 0; i--) { let l = trim(lines[i]); if (l == "") continue; - if (index(l, "version") < 0 && index(l, "Running as") < 0 && index(l, "LUA v") < 0 && index(l, "JIT:") < 0 && index(l, "we have") < 0 && index(l, "initializing") < 0) { + if (index(l, "version") < 0 && index(l, "Running as") < 0 && index(l, "LUA v") < 0 && index(l, "JIT:") < 0 && index(l, "we have") < 0 && index(l, "initializing") < 0 && index(l, "opening nfq") < 0 && index(l, "unbinding") < 0 && index(l, "binding") < 0 && index(l, "setting copy") < 0 && index(l, "chdir") < 0) { err_line = l; break; } @@ -2829,6 +2836,9 @@ function run_probe(engine, args_str, target_key, custom_url, job_id) { } function run_fuzzer_worker(engine, target, custom_url, rule_section, custom_file, mode, job_id) { + if (job_id && job_id != "") { + ensure_job_dir(job_id); + } let target_url = resolve_target_url(target, custom_url); let state = get_fuzzer_state(); diff --git a/tachyon/files/usr/lib/service/ui.uc b/tachyon/files/usr/lib/service/ui.uc index 805ba7ab..0c362820 100644 --- a/tachyon/files/usr/lib/service/ui.uc +++ b/tachyon/files/usr/lib/service/ui.uc @@ -1523,6 +1523,28 @@ function action_dir(kind) { return ""; } +function get_clash_url(endpoint) { + let host = "127.0.0.1:9090"; + let config_data = fs.readfile("/etc/sing-box/config.json"); + if (config_data) { + try { + let sb_cfg = json(config_data); + let ext = sb_cfg.experimental?.clash_api?.external_controller; + if (ext) { + let parts = split(ext, ":"); + let ip = (length(parts) > 1) ? parts[0] : ""; + let port = (length(parts) > 1) ? parts[length(parts) - 1] : "9090"; + if (ip == "0.0.0.0" || ip == "") { + host = "127.0.0.1:" + port; + } else { + host = ext; + } + } + } catch (e) {} + } + return "http://" + host + "/" + (endpoint || ""); +} + function latency_boot_sweep() { let guard_file = "/var/run/tachyon/boot-sweep-done"; if (fs.stat(guard_file) != null) @@ -1545,7 +1567,8 @@ function latency_boot_sweep() { return; } - let clash_api_check = command_status("curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:9090/ 2>/dev/null | grep -q '200\\|404'") == 0; + let clash_url = get_clash_url(""); + let clash_api_check = command_status(sprintf("curl -s -o /dev/null -w '%%{http_code}' %s 2>/dev/null | grep -q '200\\|404'", shell_quote(clash_url))) == 0; if (!clash_api_check) { fs.writefile(guard_file, as_string(time())); return;