Commit Graph
100 Commits
Author SHA1 Message Date
Dushnilin 478b99170c fix(snapshots): починка restore и валидации снапшотов под реальным ucode 2026-08-14 11:48:27 +03:00
Dushnilin 85ce7f98c7 feat(snapshots): сохранение и восстановление рабочих конфигов из расширенных настроек 2026-08-14 11:36:48 +03:00
Dushnilin 18bd271bef fix(tests): keep stale-pid test alive when a parallel job wipes /tmp/tmp.* dirs 2026-08-14 10:52:57 +03:00
Dushnilin 5be411994c fix(migration): declare write_cache_format_file before ensure_runtime_cache_format (no hoisting in ucode) 2026-08-14 10:41:00 +03:00
Dushnilin 464dcebc50 fix(ci): harden stale-pid test and cache format writes against parallel test races 2026-08-14 10:37:27 +03:00
Dushnilin 65b216b6a2 feat(p2p): поле портов торрент-клиента для изоляции P2P (issue #31) 2026-08-14 09:46:15 +03:00
Dushnilin 7bd373c392 fix(diagnostics): убрать крокозябры в Глобальной проверке и разорвать цикл повторных фиксов AI Doctor (issue #31) 2026-08-14 09:31:31 +03:00
Dushnilin 2f6941b102 fix(updates): не вешать окно обновления при неизменной версии и мёртвом RPC (issue #31) 2026-08-13 23:11:44 +03:00
Dushnilin 4bc68d7e8e fix(build): пересобрать main.js с фиксом завершения self-update (issue #31) 2026-08-13 22:51:56 +03:00
Dushnilin c1a21ef97b fix(updates): корректно завершать self-update при переиспользовании pid воркера (issue #31) 2026-08-13 22:44:06 +03:00
Dushnilin 25c9160b38 fix(watchdog): не проверять прокси без http/mixed-инбаунда (issue #31) 2026-08-13 22:44:03 +03:00
Dushnilin b099b26a68 feat(doctor): режим восстановления при остановленном сервисе и реальная верификация AI Doctor 2026-08-13 21:59:54 +03:00
Dushnilin ac3fbc90fc fix(watchdog): не перезапускать WAN по одиночному сбою пробы (issue #31) 2026-08-13 21:24:43 +03:00
Dushnilin 305e14d44e feat(reset): кнопка сброса настроек в LuCI и дефолтное состояние при чистой установке
- новый модуль service/reset.uc (режим reset-settings, флаг no-start): остановка сервиса, чистка runtime/кэшей, сохранение tailscale, запись дефолтного конфига
2026-08-13 21:06:39 +03:00
Dushnilin 9b4767a5af fix(tests): убрать повторную декларацию seen_domains и добавить ключ локализации 2026-08-13 09:07:55 +03:00
Dushnilin 4f9bf7153d fix(subscription): использовать синтаксис /[\x01-\x1f\x7f]/ без искажения букв 2026-08-13 09:01:48 +03:00
Dushnilin f67282067a fix(subscription): использовать безопасный regexp() без нулевого байта \x00 2026-08-13 08:55:33 +03:00
Dushnilin 86bc63c809 fix(subscription): исправить повреждение заголовка подписки при декодировании и ширину стилей названия 2026-08-13 08:50:12 +03:00
Dushnilin b39efa02ae fix(backend): полноценное сопоставление всех ID правил, учет отсутствующих профилей и проверка активности секций 2026-08-13 08:43:52 +03:00
Dushnilin 79df32ef7c fix(backend): корректный разбор всех community_lists и дедупликация доменов в режиме активных маршрутов 2026-08-13 08:40:56 +03:00
Dushnilin 443a62ece7 feat(ui): явные русские названия категорий и элементов интерфейса в окне проверки доступности 2026-08-13 08:38:11 +03:00
Dushnilin 715a7fee5c refactor(ui): замена сетки кнопок фильтров на компактный выпадающий список в окне проверки 2026-08-13 08:35:56 +03:00
Dushnilin 657c80da79 feat(ui): привести окно проверки доступности сервисов к нативному стилю LuCI и нормализовать наименования 2026-08-13 08:32:31 +03:00
Dushnilin a8f34ea73f release: v1.2.77 2026-08-13 08:29:32 +03:00
Dushnilin 8724f82d1a feat(ui): добавить кнопку установки при наличии обновления и исправить зависание окна установки 2026-08-13 08:05:43 +03:00
Dushnilin 901c4ea1c1 Fix progress modal hang during self-update by lowering settle delay and status refresh interval 2026-08-12 14:34:38 +03:00
Dushnilin 6f47e83712 Cleanly terminate sing-box PID when MTProxy inbound is active to avoid 5s procd SIGTERM timeout (issue #30) 2026-08-12 14:26:39 +03:00
Dushnilin 19a8e2219b Enhance update progress modal step granularity, timers and theme-agnostic styling 2026-08-12 14:17:08 +03:00
Dushnilin bc161ae3ee Include short git commit SHAs in progress modal version badge 2026-08-12 14:14:52 +03:00
Dushnilin ebf9b7eeea Update service check profile titles with clean descriptive group names and badges 2026-08-12 14:06:58 +03:00
Dushnilin 02496fd9fb Add interactive progress modal dialog with animated progress bar and live steps for component updates 2026-08-12 13:51:08 +03:00
Dushnilin ca77b519ea Restore full Russian translation catalog (2400+ lines) and merge missing UI tab/section keys 2026-08-12 13:41:11 +03:00
Dushnilin 2396197d99 Update Russian translation catalogs for UI tabs, sections, and action buttons 2026-08-12 13:29:00 +03:00
Dushnilin d527b86d4c Fix procd sing-box termination timeout, watchdog backup dir creation, and telegram retry log levels 2026-08-12 13:09:05 +03:00
Dushnilin e1a0f04e4a Update localization catalogs and fill script for Cannot save settings 2026-08-12 12:51:16 +03:00
Dushnilin cb645cad7a Update diagnostic service check configuration and engine helpers 2026-08-12 12:40:50 +03:00
Dushnilin fb1d9dfe5b Fix CI test failures: add missing Russian translation for 'Cannot save settings' and use common.background_command in service_check.uc 2026-08-12 12:39:30 +03:00
Dushnilin 265d7d19cd Fix issue #30: Remove invalid close_timeout property from MTProxy inbound and bypass SIGHUP reload with clean service restart when MTProxy is active 2026-08-12 12:34:58 +03:00
Dushnilin 285ab7910b v1.2.76: Fix ucode syntax error (remove duplicate stub functions in service_check.uc) and release v1.2.76 2026-08-12 12:27:25 +03:00
Dushnilin 5b372f5572 v1.2.75: Add Service Check mode switcher (Active Sections / All Profiles), restore AI Chat Assistant, harmonize action button styles, and fix dark theme compatibility 2026-08-12 12:22:52 +03:00
Dushnilin 8d6041f9fa chore: remove test.uc 2026-08-12 10:50:56 +03:00
Dushnilin 3672af46d8 fix(diagnostics): type error on float conversion in ucode
Replaced non-existent \loat()\ function with unary plus coercion for string to number conversion in service_check.uc.
2026-08-12 10:50:43 +03:00
Dushnilin 2bd2fd7645 feat(diagnostics): нативная кнопка проверки сервисов
Реализована нативная проверка сервисов (watchdog, telegram, sing-box) через ucode, избавляя от внешней зависимости forkop-servicecheck.
2026-08-12 10:42:09 +03:00
Dushnilin 2b4d8cd4e0 fix(i18n): wrap Ollama and LM Studio labels in _() with English defaults and update po/pot 2026-08-11 22:29:34 +03:00
Dushnilin 1a1fd7f4c3 fix(settings): add Ollama & LM Studio to CBI settings tab options and make API key optional for local LLMs 2026-08-11 22:27:57 +03:00
Dushnilin 5db8ed7889 feat(ai-doctor): add dynamic endpoint placeholders and optional API key hint for Ollama and LM Studio 2026-08-11 22:11:48 +03:00
Dushnilin 40e185c143 i18n: actualize translation pot and po files for 1.2.74 2026-08-11 22:01:21 +03:00
Dushnilin da199c236a feat(ai-doctor): super-upgrade with Live Stepper, Root Cause Graph, Smart Fix Badges, Deep Log Inspection & Local LLM Presets 2026-08-11 22:00:20 +03:00
Dushnilin bc8a60fc73 fix(ui): hide legacy doctor repair button and make AI Doctor always clickable 2026-08-11 21:35:27 +03:00
Dushnilin 7c39a5335f ci: enable generate_release_notes in release workflow 2026-08-11 21:21:24 +03:00
Dushnilin a7c391cbdb fix(singbox): preserve cache.db across restarts and ensure parent directory 2026-08-11 21:10:07 +03:00
Dushnilin 15a4f8962e fix(ui): add close and copy buttons to AI Doctor modal footer 2026-08-11 20:15:50 +03:00
Dushnilin e140766215 fix(ci): bypass node tls validation in release step 2026-08-11 19:54:45 +03:00
Dushnilin ee44f21d77 fix(ui): remove duplicate commit sha formatting in header 2026-08-11 19:47:41 +03:00
Dushnilin 999686fea3 fix(ui): display short commit SHA next to Tachyon version in UI and constants 2026-08-11 19:06:00 +03:00
Dushnilin 4d0eb2ea6a fix(action): use explicit else block in check_tachyon for outdated_same_release 2026-08-11 18:44:54 +03:00
Dushnilin c192eb5e5e fix(updater): inline tag normalization in release_metadata_tsv to prevent ucode order warning 2026-08-11 18:36:44 +03:00
Dushnilin 680802a62d fix(updater): strip leading v prefix in tachyon_normalized_release_version 2026-08-11 18:17:56 +03:00
Dushnilin 2ef7092810 feat: Add local heuristic AI Doctor engine, DPI block analyzer, and offline fallback 2026-08-11 17:26:53 +03:00
Dushnilin f790917999 release: v1.2.70 - Tachyon AI Doctor & Agent API 2026-08-11 16:37:24 +03:00
Dushnilin 180c52ecde test: fix BusyBox portability issues in backend test suite 2026-08-11 16:33:46 +03:00
Dushnilin 3ddd321575 docs: add Hosts Engine section detailing static DNS overrides, remote host lists, and mirror retry logic 2026-08-11 16:13:34 +03:00
Dushnilin 5b6e0c6a78 docs: remove explicit year mention from AI section titles 2026-08-11 16:12:51 +03:00
Dushnilin e93928cba2 docs: overhaul README.md and README.en.md with comprehensive 2026 feature list, AI stack, Watchdog architecture, Telegram bot commands, and CLI reference 2026-08-11 16:12:14 +03:00
Dushnilin be5f41a52e feat(ai-stack-2026): add OpenAPI 3.0.3 schema, Telegram /ai_doctor & /fix integration, AI language selector, and log deduplication
- Agent REST API (agent_api.uc): Added GET /openapi.json returning OpenAPI 3.0.3 spec for ChatGPT Custom GPTs, N8N, Dify, and LLM Agents
- AI Doctor (runtime.uc): Added compress_log_snippet() for deduplicating repeated log entries and ai_doctor_lang support (ru/en prompt selection)
- Telegram Bot (telegram.uc): Added /ai_doctor and /fix commands with Inline Keyboards for instant quick-fix execution
- Settings (renderAdvancedSettings.ts, settings.js): Added AI Doctor Language selector (ru/en)
- Documentation: Updated README.md and README.en.md with 2026 AI features
2026-08-11 16:10:31 +03:00
Dushnilin 6dd085b777 feat(ai-doctor): supercharge AI Doctor with multi-fix, log context, history, and 13 quick fix codes
Backend (runtime.uc, agent_api.uc, tachyon CLI):
- Enrich AI Doctor LLM context with Watchdog state (OOM, streaks, active repairs) and last 15 critical log lines
- Support multi-fix parsing (quick_fixes array) and comma-separated FIX tags
- Add persistent history saving to /tmp/ai_doctor_last.json and ai_doctor_last endpoint
- Expand quick fix codes from 9 to 13 (added clear_dns_cache, update_subscriptions, reset_firewall, restart_network)
- Implement apply_quick_fix CLI command and REST API endpoint

Frontend (fe-app-tachyon, LuCI main.js):
- Add AI Doctor action button in Diagnostics tab
- Add shell methods aiDoctor, aiDoctorLast, applyQuickFix
- Render AI Doctor modal with Multi-Fix buttons and 'Fix All' option
- Integrate toast notifications and state updates
2026-08-11 16:06:19 +03:00
Dushnilin 4a6b24ef28 docs(agent): update AGENT.md with comprehensive AI Doctor and Agent API configuration guide
Details include:
- AI Doctor setup (enable, provider, model override, api key, custom url)
- Supported LLM providers and custom model options
- 9 Quick Fix repair codes
- Watchdog CLI commands
- HTTP REST Agent API read/write endpoints and auth
- cURL and SSH integration examples
2026-08-11 15:59:38 +03:00
Dushnilin 1e365a1f9b refactor(ai-doctor): replace model dropdown with free-text input
Simpler UX: user types any model name directly.
Placeholder shows the provider default so field can stay empty.
2026-08-11 12:40:23 +03:00
Dushnilin 3d48a22e3c feat(ai-doctor): add model selection per provider
Backend (runtime.uc):
- query_llm() accepts model_override (5th param), falls back to provider default
- ai_doctor() reads ai_doctor_model from UCI and passes to query_llm

Frontend (renderAdvancedSettings.ts):
- aiDoctorModel state field (type / init / load / save)
- Model dropdown per provider with sensible defaults:
  openai: gpt-4o-mini(default)/gpt-4o/gpt-4.1-mini/gpt-4.1/o4-mini
  anthropic: claude-3-5-haiku(default)/claude-3-5-sonnet/claude-3-7-sonnet
  deepseek: deepseek-chat(default)/deepseek-reasoner
  custom: free-text input
- Switching provider resets model to '' (use new provider default)

Legacy LuCI (settings.js):
- ai_doctor_model Value field with placeholder '(provider default)'
2026-08-11 12:37:31 +03:00
Dushnilin af7941f839 fix(tests): replace printf|grep-qx with grep<<<var to avoid broken-pipe false failures
With set -eo pipefail, when grep -qx exits early after finding a match
printf gets SIGPIPE and returns non-zero, which with pipefail triggers the
|| fail branch even though grep returned 0 (found).
Here-string avoids the pipe entirely.
2026-08-11 12:22:28 +03:00
Dushnilin a1b1531ee8 fix(tests): update watch_recovery signature in heal_escalation.sh 2026-08-11 12:16:05 +03:00
Dushnilin 188a1b4fe8 fix(tests): update tests for watchdog refactoring
heal_suppression.sh:
- claim/release_root_cause -> wan_repair_until/singbox_repair_until
- suppressed_by_root_cause(healer, priority) -> (healer)
- driver updated to use new two-var API

heal_outcome.sh:
- watch_recovery(key, recovery_event, incident, reason) -> (key, incident, reason)
- add check that reason: field still present

heal_dns_idempotent.sh:
- replace ai_enabled mock with settings() mock
- fix suppressed_by_root_cause to single-arg signature
- fix ucode // comment (was #)
2026-08-11 11:16:25 +03:00
Dushnilin 1bf1af3783 fix: is_dns_working() -> controller.is_dns_working() in ai_heal_dns_loop 2026-08-11 11:11:05 +03:00
Dushnilin b194666b84 ponytail: chistka watchdog + event_controller
event_controller.uc:
- check_tachyon_cli_running: zamenen polnyy /proc-skan na pgrep -f
- tproxy_port(): dobavlen kesh cached_tproxy_port

watchdog.uc:
- Udaleny 7 delegatov-oborotok
- active_root_causes zamenen dvumya var wan_repair_until/singbox_repair_until
- watch_recovery: ubrano mertvoe pole event
- ai_setting/ai_enabled udaleny, UCI chitaetsya napryamuyu
- safe_call: ubran flag ai_graceful_degradation_enabled

Testy: 511/511
2026-08-11 11:00:36 +03:00
Dushnilin 7ad428ddc8 refactor(watchdog): оптимизация и устранение дублирования кода
- watchdog: удалён дублирующий check_tachyon_cli_running(), везде используется controller.check_tachyon_cli_running()
- watchdog: smart_detect_process_pending использует controller.proxy_port() вместо повторного парсинга config.json
- watchdog: удалена однострочная обёртка is_dns_dead() — заменена is_dns_working() напрямую
- watchdog: heal_proxy_connectivity требует streak >= 2 перед очисткой cache.db — устраняет ложные ночные уведомления при кратких просадках прокси-ноды
- event_controller: push_history переведён на slice() вместо ручного цикла
- event_controller: direct_ok использует тот же check_url что и proxy check — корректность при кастомном ai_proxy_health_url
- event_controller: добавлен subscription_fail_streak — одиночный таймаут сети больше не триггерит Telegram
- telegram: tg_request больше не создаёт временные файлы в /tmp — JSON передаётся напрямую через curl -d, устранена утечка tg_payload_*.json при kill процесса
- telegram: worker() при старте удаляет оставшиеся tg_payload_*.json от предыдущих сессий
- tests: исправлен шаблон mktemp в background_spawn_fds.sh — busybox не поддерживает двойное расширение (.XXXXXX.uc)
2026-08-11 08:47:47 +03:00
Dushnilin c88acdffa5 fix(dns): использовать --doh-url https://1.1.1.1/dns-query в curl при отсутствии c-ares (--dns-servers)
- В сборках OpenWrt без c-ares libcurl не поддерживает --dns-servers,
  что заставляло curl использовать системный DNS (dnsmasq).
- Во время рестарта или перед стартом sing-box dnsmasq был перенаправлен
  на неработающий порт sing-box 5335, из-за чего curl получал Could not
  resolve host (exit 6), создавая замкнутый круг и бесконечный падеж
  сервиса при скачивании подписок/списков.
- Добавлен автоматический фолбэк на DoH (--doh-url https://1.1.1.1/dns-query),
  который работает без c-ares и считывает IP адреса серверов подписок/списков
  напрямую в обход падающего системного DNS.
2026-08-10 21:42:49 +03:00
Dushnilin 8be248f9fd fix(ui): непрерывная индикация анимации на кнопке обновления без мигания
- При получении 'Another component action is already running' или сетевого
  RPC-сбоя спиннер на нажатой кнопке больше не сбрасывается сразу.
- Добавлено повторное связывание (fallback lookups) с 800ms задержкой, чтобы
  бэкенд успевал прописать запущенный job в state до снятия индикатора.
- При отслеживании запущенного задания теперь учитываются любые фоновые
  акшны для того же компонента.
2026-08-10 21:38:46 +03:00
Dushnilin dd3546f29a fix(updates): предотвратить ложный сброс индикации загрузки при переустановке одинаковых версий
- В waitComponentActionJob добавлен минимальный порог ожидания (10с)
  перед срабатыванием fallback проверки версии Tachyon. При same-release
  обновлениях (одинаковый номер версии, но новый SHA) совпадение версии
  больше не приводит к мгновенному (за 1с) снятию спиннера loading, пока
  бэкенд на самом деле только скачивает и ставит пакет.
- Расширен список транзиентных RPC ошибок (isTransientRpcError) для
  надежного перешивания перезапуска uhttpd/rpcd/ubus во время переустановки.
- Увеличен COMPONENT_ACTION_TRANSIENT_RPC_GRACE_MS до 60с.
2026-08-10 21:30:03 +03:00
Dushnilin 5cbbd0f661 fix(ui): suppress 'Already running' and DNS retry toasts
Lock contention ('Another component action is already running') is an
expected transient state — user clicked a button while a previous action
was still in flight. Showing [error] toast confuses users into thinking
something broke. Filter it from the log watcher notification pipeline.

Also suppress DNS retry debug lines (issue #24 retry logs) from showing
as error toasts.

Added tests for both suppressed patterns.
2026-08-10 21:01:21 +03:00
Dushnilin 7679715fcc fix: curl --dns-servers compatibility + DNS retry on sing-box restart
- Guard --dns-servers behind runtime capability check (requires libcurl
  with c-ares). OpenWrt builds without c-ares now skip the flag silently
  instead of crashing curl with 'option not supported'.
  Affects: subscription/cache.uc, components/updates.uc

- On DNS resolution failure (curl exit 6), retry with increasing backoff
  (5s, 10s, 15s) before giving up, instead of immediately breaking.
  Fixes transient 'Could not resolve host' during sing-box restart when
  Tachyon's intercepting DNS resolver is briefly unavailable (issue #24).

- Fix stale component-action lock deadlock: pid_running now validates
  /proc/<pid>/cmdline against ucode/tachyon/sh pattern + 300s TTL.
  Background check_update exits cleanly on lock contention instead of
  emitting [error] toasts (action.uc, state.uc, initd.uc).
2026-08-10 20:48:52 +03:00
Dushnilin 9b110b226d fix(core): исправить ложное застревание блокировок компонентных действий и отключить всплывающие ошибки при фоновой проверке
- Проверять /proc/<pid>/cmdline при валидации PID (исключает ложное определение dnsmasq/sing-box как владельца блокировки при рециркуляции PID в Linux)
- Добавить автоматическую очистку зависших блокировок старше 300 секунд (TTL)
- При фоновой автоматической проверке обновлений (action == check_update) пропускать занятые блокировки без записи [error] в syslog и появления всплывающих нотификаций
2026-08-10 19:43:30 +03:00
Dushnilin 31c36118ef refactor(ui): сгруппировать все параметры Settings по вкладкам (cbi-tabgroup)
- Настройки разделены на 6 категорий: DNS, Сеть, Сервисы, Обновления, ИИ и Системные
- Устранена длинная простыня прокрутки — каждая категория открывается во вкладке
2026-08-10 19:30:51 +03:00
Dushnilin c930c15dc3 feat(ai): добавить поддержку Anthropic Claude API в AI Doctor
- В query_llm (runtime.uc) добавлена интеграция с Anthropic Messages API (https://api.anthropic.com/v1/messages) с заголовком x-api-key
- В настройки Settings и Dashboard добавлен выпадающий выбор провайдера 'Anthropic (Claude API)'
- Добавлен русский перевод для опций AI Doctor
2026-08-10 19:16:19 +03:00
Dushnilin a15490c67d i18n: добавить русский перевод для AI Agent REST API в PO файлы 2026-08-10 19:14:41 +03:00
Dushnilin 8a71a5a1a4 feat(luci): добавить поле AI Agent REST API Token в стандартную вкладку Settings
- Добавлена опция agent_api_token (AI Agent REST API Bearer Token) в CBI-форму настроек settings.js
- Сохраняет токен через стандартную кнопку Save & Apply в LuCI
2026-08-10 19:13:51 +03:00
Dushnilin 1171cee9fd feat(ui): добавить управление токеном AI Agent REST API в LuCI
- В Advanced Settings (Dashboard) добавлен новый блок 'AI Agent REST API (12 Endpoints)'
- Позволяет просматривать, изменять и генерировать Bearer Auth Token (agent_api_token) для REST API из веб-интерфейса
- Сохраняет токен в UCI (tachyon.settings.agent_api_token)
2026-08-10 19:11:48 +03:00
Dushnilin e67e8c0984 fix(package): исключить воркеры обновления из зачистки процессов при апгрейде
- kill_matching_command и цикл зачистки fd/1000 прокси в package.uc теперь пропускют процессы ucode (action.uc / updates.uc) и их предков, предотвращая выбивание воркера обновлений по SIGKILL во время prerm
- isTransientRpcError теперь учитывает 'failed to execute' в качестве транзиентной ошибки RPC при перезапуске rpcd / служб во время обновления
2026-08-10 18:57:19 +03:00
Dushnilin b11780dec3 fix: ждать TCP-готовности proxy перед загрузкой отложенных подписок
run_deferred_subscription_bootstrap теперь после проверки что процесс
sing-box запущен дополнительно проверяет что proxy-порт реально принимает
соединения (до 10x3s).

Без этого: если порт не готов в момент вызова — fallback на прямой
download, что провалится для URL доступных только через proxy.
При неудаче через 30s запускается retry worker (поведение сохранено).

Также: get_subscription_download_proxy_address делает одиночную проверку
порта — retry worker является safety net для edge cases.
2026-08-10 18:27:38 +03:00
Dushnilin f5929d24f8 fix: дождаться готовности proxy перед загрузкой подписок и списков
При обновлении sing-box Tachyon перезапускается, запускает sing-box
и сразу пытался загрузить списки/подписки через proxy 127.0.0.1:4534,
но sing-box ещё не принял соединения на этом порту.

Исправления:
- updates.uc: dns_probe_passed теперь проверяет TCP-доступность proxy
  вместо немедленного return true; ждёт до 30s (10 попыток по 3s)
- updates.uc: download_to_file при неудаче через proxy делает fallback
  на прямой download с bootstrap DNS 8.8.8.8/1.1.1.1
- cache.uc: get_subscription_download_proxy_address проверяет что proxy-порт
  реально принимает соединения, иначе переходит на прямой download
- cache.uc: download_subscription использует bootstrap DNS при прямом
  скачивании подписок (когда proxy недоступен или не настроен)
2026-08-10 18:10:36 +03:00
Dushnilin 6379361d40 chore: поднять версию до 1.2.67 2026-08-10 14:17:33 +03:00
Dushnilin 3b1eb89124 fix: graceful fallback for unknown inbound fields in sing-box config
Older sing-box versions fail on 'close_timeout' in MTProto inbound
(added in Tachyon to fix SIGHUP hot-reload crash, issue #15).

Instead of hard-failing, runtime.uc now detects 'json: unknown field'
errors from sing-box check, strips the offending inbound field from
all inbounds in the generated JSON, and retries the check once.

This makes Tachyon forward-compatible: new fields for newer sing-box
versions degrade gracefully on older installs without requiring manual
version detection or config changes.
2026-08-10 14:11:06 +03:00
Dushnilin 7def6e556f i18n: fix Russian-source translation keys in AmneziaWG .conf import
section.js had 10 _() calls with Russian strings as keys instead of English.
This is a i18n antipattern: source keys must be language-neutral (English).

Changes:
- section.js: replace 10 Russian msgids with English equivalents
  - 'Загрузить конфиг .conf' -> 'Load .conf config'
  - 'Импортировать настройки AmneziaWG из файла .conf' -> 'Import AmneziaWG settings from .conf file'
  - 'Загрузить .conf' -> 'Load .conf'
  - 'Ошибка' (3x) -> 'Error' (reuses existing key)
  - 'Выберите файл с расширением .conf' -> 'Select a file with .conf extension'
  - 'Не удалось разобрать файл:' -> 'Failed to parse file:'
  - 'Загружено!' -> 'Loaded!'
  - 'Готово' -> 'Done'
  - 'Конфиг AmneziaWG успешно загружен!' -> 'AmneziaWG config loaded successfully!'
  - 'Ошибка чтения' -> 'Read error'

- tachyon.ru.po: add RU translations for 9 new English keys
- calls.json / tachyon.pot / tachyon.po: regenerated via locales:actualize

Result: 1108/1108 translated (no orphaned Russian-source entries)
2026-08-10 14:00:35 +03:00
Dushnilin 92f1b4e991 i18n: complete RU translations — 1109/1109 (was 1030/1109)
Translated 79 missing strings:
- 15 country names (Belarus, China, Finland, France, Germany, Japan,
  Kazakhstan, Netherlands, Russia, Singapore, Sweden, Turkey,
  Ukraine, United Kingdom, United States)
- TUIC URL validation errors (14 strings)
- UI general: Cancel, Conflict, Error, Fixed, Issues, Success, etc.
- Protocol abbreviations kept as-is: DNS, HTTP, MTU, RDP, SSH, TLS
- Doctor/watchdog: 'Doctor failed', 'Doctor repair', 'No issues found'
- WARP: registration detour, proxy, skip TLS cert, country code
- Hosts file descriptions, URL validation message
- Monitoring & Analytics, Optimization, Protection sections
- Checking… and Generating… (Unicode ellipsis U+2026 variants)
- Russian-source keys: 'Ошибка', 'Не удалось разобрать файл:'

Distributed to luci-app-tachyon/po/ via npm run locales:actualize
2026-08-10 13:53:23 +03:00
Dushnilin 23f3c8c587 feat: AI Agent API — HTTP REST + CLI for external LLM agents
Adds a self-healing infrastructure accessible via HTTP REST and CLI:

## New files
- tachyon/files/usr/lib/service/agent_api.uc
  Full REST API handler for /tachyon/agent/v1/* endpoints
  READ (no auth): /health /snapshot /diagnose /logs /config /tools
  WRITE (Bearer): /heal /restart /reload /config/set /section/toggle /domain/add

- tachyon/files/usr/lib/cgi-bin/tachyon-agent
  CGI shell wrapper — installed into /www/cgi-bin by postinst
  Exposes agent API via uhttpd at http://<router>/cgi-bin/tachyon-agent/<endpoint>

- AGENT.md
  Full documentation: curl examples, SSH usage, Claude/Open-WebUI integration

## Modified files
- tachyon/files/usr/bin/tachyon
  + diagnose_json command -> diagnostics/runtime.uc diagnose-json
  + agent_cgi command -> service/agent_api.uc __cgi
  + agent subcommand with special arg-passing (path method body bearer)
  + show_help() updated

- tachyon/files/usr/lib/diagnostics/runtime.uc
  + diagnose_json() — structured JSON output of doctor checks for LLM agents
  + Registered in CLI dispatch as 'diagnose-json'
  Fix: UTF-8 byte offset for arrow character U+2192 (+3 not +2)

- tachyon/Makefile
  + INSTALL_BIN for usr/lib/cgi-bin/tachyon-agent
  + postinst: symlink CGI into /www/cgi-bin on install
2026-08-10 13:14:30 +03:00
Dushnilin 2562420bce Delete CLAUDE.md 2026-08-10 13:12:46 +03:00
Dushnilin df426f9d1e chore: ignore CLAUDE.md 2026-08-10 12:53:50 +03:00
Dushnilin f807b20afb fix: lower min OpenWrt version to 23.05 (matches e2e test image) 2026-08-10 12:38:48 +03:00
Dushnilin e7ed3839ed fix(package): не удалять состояние выполняющегося задания в postinst
Самообновление Tachyon — это компонентное задание, которое устанавливает
пакет, чей postinst и вызывает remove_component_update_cache(). Очистка
стирала каталог component-actions целиком, включая файл состояния того
самого задания, которое ещё выполнялось. LuCI опрашивал задание, не
находил его, не получал ни message, ни stderr и показывал фолбэк
"Failed to execute" поверх успешно прошедшего обновления.

Теперь очистка пропускает задания, помеченные running. Устаревшие
результаты и кэш проверок обновлений убираются как раньше. Зависшее
задание не залипнет: детект по PID и started_at помечает такие stale.

Пути каталогов состояния стали переопределяемыми через окружение, чтобы
тест мог прогнать luci-postinst, не трогая /var/run.
2026-08-10 05:47:42 +03:00
Dushnilin 98d53326d9 fix(bot): добавить недостающий import constants в service/api.uc
Коммит 3d84d96e добавил constants.TACHYON_COMMIT_SHA в get_system_status()
без соответствующего require(). В результате constants == null и каждый
вызов api.get_system_status() крашил с 'left-hand side expression is null'.

Это ломало буквально все команды Telegram-бота (/menu, /status, и т.д.)
так как каждая из них вызывает view_menu() -> api.get_system_status().
2026-08-10 05:23:41 +03:00
Dushnilin 6cf90e3e84 fix(updates): не выдавать успешное обновление за ошибку "Failed to execute"
Воркер компонентного действия перенаправлял stderr в тот же файл, что и
stdout (2>&1). Действие печатает результат в stdout одним JSON-объектом,
а stderr — предупреждения apk/opkg, вывод init-скрипта при рестарте —
попадал в тот же файл после JSON. Разбор всего файла падал, построчный
фолбэк не находил объекта, и finish_component_job писал синтетический
success: false с последней строкой лога в качестве сообщения.

Особенно надёжно это ломало самообновление Tachyon: install_tachyon
рестартует сервис, будучи предком воркера, поэтому вывод рестарта
гарантированно ложился поверх канала результата.

Теперь stderr пишется в отдельный <job>.out.stderr, он же используется
как источник сообщения, когда воркер действительно умер, не напечатав
результат. Файл убирается вместе с заданием и подметается orphan-очисткой.

Заодно валидация sing-box перестала судить о бинарнике по коду возврата:
popen().close() отдаёт сырой wait-статус, а command_output отбрасывал
stdout при любом ненулевом статусе. `sing-box version` печатает версию и
может завершиться ненулевым кодом или получить сигнал от остановки
сервиса перед установкой — валидация получала "", объявляла рабочий
пакет битым и откатывала установку с exit_code 129 (128+SIGHUP). Добавлен
command_output_lenient, он же чинит показ версии в дашборде.
2026-08-10 05:21:19 +03:00