Commit Graph
54 Commits
Author SHA1 Message Date
Dushnilin 603c0df91b feat(security,ci,ui): harden CI/CD, LuCI ACL, low-space updates and mobile layout
- ci: make frontend CI read-only with strict diff check and deterministic calls.json
- ci: pin external GitHub Actions in workflows to immutable commit SHAs
- ci: add openwrt-e2e blocking gate job running docker_e2e_test.sh
- fix(diagnostic): fix contstants.ts typo and update all 13 import sites
- fix(acl): remove unused /bin/busybox exec from rpcd ACL and add regression test
- feat(updates): add low-space update fallback when creating sing-box.old is impossible
- fix(routes): preserve dedicated Discord gateway subnets (162.159.128.0/21)
- feat(ui): implement responsive auto-fit grid and mobile modal viewport bounds
- test: add viewport regression test suite in vitest
2026-09-14 23:00:18 +03:00
Dushnilin 4cbf32ee3f fix: resolve server inbound DNS & routing, strategy fuzzer UI sync, and sing-box-extended latency 2026-09-13 16:43:51 +03:00
Dushnilin 4b7faf18a8 fix(discord): restore voice UDP routing on Cloudflare Anycast while isolating web traffic
- Preserve raw Cloudflare subnets in community-subnets-discord.lst in updates.uc instead of destructive deletion.
- In singbox/generator_routes.uc:
  * Exclude Cloudflare Anycast CIDRs from general IP route rules (preventing web hijacking).
  * Generate a dedicated Discord Voice route rule for Cloudflare subnets scoped to network: 'udp' and voice port ranges (50000-65535, 3478, 19302, 5000-5020).
  * Provide DEFAULT_DISCORD_VOICE_SUBNETS fallback in core/ip.uc.
- In nft/apply.uc:
  * Route Cloudflare subnets to ip_ports set with Discord voice ports (5000-5020, 3478, 19302, 50000-65535).
  * Automatically enable ip_port rules when section has community_subnets for Discord.
- In section.js (Routing Rule Tracer):
  * Filter out Cloudflare subnets when resolving domain web traffic to Discord community subnets.
  * Accurately display voice UDP routing notice for Anycast ranges.
- Update tests/community_subnets_sanitization.sh with voice UDP and sing-box validation.
2026-09-13 11:06:28 +03:00
Dushnilin e834971919 fix(singbox): prioritize proxy outbounds for ip.podkop.fyi check and failover regardless of DPI section order 2026-09-12 20:53:47 +03:00
Dushnilin 2019ddd12a release: 1.3.26 — Watchdog proxy restart protection, WAN monitor debounce, and subscription bootstrap resilience
- Fix #52: Watchdog proxy restart on single URL failure:
  * Validate failure against secondary independent probe URL before declaring proxy down
  * Skip restart when direct WAN is also degraded or down (!direct_ok)
  * Implement 120s cooldown between automated proxy restarts
  * Fix Telegram notification to accurately state 'Перезапуск sing-box' instead of 'Перезапуск роутера'
- Fix #51: Telegram bot spamming WAN up/down notifications:
  * Filter hotplug events strictly by badwan_monitored_interfaces (defaults to wan)
  * Add atomic directory lock with debounce delay and real ubus state query
  * Prevent repeated notifications when interface state has not transitioned
- Feat: 2-VPN deadlock elimination & self-download subscription proxy:
  * Isolate unbootstrapped dependent subscription sections on initial boot (deferred_sections)
  * Allow self-download proxy target for subscriptions with explicit UI hint '(текущее правило при активности)'
  * Enable automatic local proxy fallback for subscription refresh when direct WAN download fails while sing-box is active
  * Add regression test in tests/subscription_bootstrap_deadlock.sh
- Fix: Parental control quota enforcement:
  * Correct route rule filtering when daily quota minutes are exhausted without a fixed time interval
- i18n & Version bump:
  * Bump fe-app-tachyon to 1.3.26 and update Russian PO/POT translations
2026-09-12 16:50:04 +03:00
Dushnilin 0bec2f6f86 fix: resolve -1ms latency display, diagnostic outbounds check timeout, country.is fallback, and docker AGH false positive
- Fix -1ms badge and green coloring in dashboard sections when node latency check fails or returns -1
- Handle Clash API group delay responses properly in dashboard single and batch latency tests
- Target active outbound node in diagnostics outbounds check instead of group tag to prevent router timeout
- Add nslookup fallback in country.uc resolve_service_host and retain system DNS resolution
- Ensure flag emoji country deduction acts as fallback in URLTest groups when exclude_countries is specified
- Ignore processes in container network namespaces when diagnosing system port 53 / DNS conflicts for AdGuardHome
- Bump fe-app-tachyon version to 1.3.25 and rebuild LuCI bundle
2026-09-11 23:53:41 +03:00
Dushnilin 0ea1c73832 fix: sanitize Discord community subnets and resolve WAN monitor hotplug spam (fixes #50, #51)
- Fix #50: Discord community subnets hijacking Cloudflare Anycast traffic:
  * Filter broad Cloudflare shared subnets (104.16.0.0/12, 172.64.0.0/13, etc.) for Discord preset in generator_routes.uc, nft/apply.uc, and updates.uc.
  * Add tachyon resolve_domain CLI and runtime.uc helper for DNS queries with rpcd ACL support.
  * Update LuCI Routing Rule Tracer to resolve queried domains against section subnets/CIDRs (including community subnets) and show shared CDN/Anycast warnings.
  * Add unit tests in tests/community_subnets_sanitization.sh.

- Fix #51: Telegram bot spamming WAN up/down notifications on hotplug:
  * Check enable_badwan_interface_monitoring, telegram.enabled, and badwan_monitored_interfaces list in 99-tachyon-wan-monitor.
  * Add background debounce with atomic directory locking and ubus interface status verification.
  * Implement state transition tracking to only notify on actual UP->DOWN and DOWN->UP changes without duplicates.
  * Preserve retry_start_on_wan_up behavior on ifup.
  * Add comprehensive integration test suite in tests/wan_monitor_hotplug.sh.
2026-09-11 23:07:10 +03:00
Dushnilin 94708d8251 fix: resolve MAC routing crash in sing-box, fallback dashboard on secondary nodes, and unify dashboard naming 2026-09-11 20:34:18 +03:00
Dushnilin 26431f50d3 feat: per-section MAC/DNS exclusions, boot latency sweep, WDTT/OlcRTC providers, DNS hijack socket collision fix
Features:
- Per-Section MAC Exclusions: nft, generator_routes, section.js, i18n
- Per-Section Routed DNS: connections, generator_routes, nft, validator,
  types.ts, section.js, state.uc, reload.uc
- Boot Latency Sweep: ui.uc latency boot sweep with fixture dispatchers
- WDTT provider: full backend (common, validator, runtime), sing-box
  outbound, diagnostics, component install, updater, i18n, section.js UI
- OlcRTC provider: full backend (common, validator, runtime), sing-box
  outbound, diagnostics, component install, updater, i18n, section.js UI
- WireGuard-over-TURN tunnel (WDTT) and TCP-over-WebRTC tunnel (OlcRTC)
  as sidecar processes with local SOCKS5, routed through sing-box outbound

Bug fixes:
- route.uc: restrict hijack-dns to local DNS inbounds only (dns-in,
  source-dns-in, dns-health-*) — fixes socket collision between sing-box
  and dnsmasq on port 53 via SO_REUSEADDR transparent write-back sockets
- runtime.uc: add Port 53 socket collision diagnostic with auto-fix
  (sing-box restart to clear parasitic UNCONN sockets with Recv-Q)
- runtime.uc: add dnsmasq dns_redirect check with auto-fix — disables
  firewall4 DNAT that causes TProxy to rewrite destination to router :53
- failover.uc: add wdtt/olcrtc to failover candidate actions
- telegram.uc: show WDTT/OlcRTC installed status in /info

Tests: 135/155 shell + 591/591 frontend
2026-09-11 18:04:03 +03:00
Dushnilin bc4f12913f fix(providers): resolve zapret2 startup crash, nft desync EPERM, and mieru ruleset crash loop
- fix(zapret2): add safe_str fallback and avoid default --filter-tcp=443 injection on UDP rules in prepare_strategy_args()
- fix(providers): make individual rule failures non-fatal in start_runtime() so one bad rule does not rollback all running rules
- fix(binaries): dynamic candidate resolution for nfqws and nfqws2 across standard OpenWrt and custom paths (/opt/zapret2/nfq2, /opt/zapret2/nfq, /opt/zapret2, /usr/bin)
- fix(nft): add raw_output notrack chain and mangle_output/forward counter return rules for desync marks (0x40000000, 0x20000000) and musl/nobody skuid (2147483647, 65534) to prevent EPERM rawsend failure on reload
- fix(reload): ensure nft_rebuild is triggered on zapret and zapret2 runtime updates
- fix(singbox): reject mieru outbounds from rule_set download_detour and http_clients dial_detour to prevent fatal startup crash loop
- fix(singbox): detect sing-box 1.14+ and omit deprecated download_detour on remote rule-sets when http_clients is active
- fix(action): pre-seed /etc/config/zapret2 with enabled=0 via core.uci before package install to prevent conflicting upstream daemon startup
- test(ruleset): add verification tests for mieru download_detour and dial_detour rejection
2026-09-10 20:18:00 +03:00
Dushnilin 240a939bbe fix(routing): resolve real IP for zapret routes, add IPv6 sniffing, and fix monitoring route display 2026-09-10 11:02:51 +03:00
Dushnilin b51809c81d feat: add DoH blocking, subscription keyword filtering, bulk proxy text inputs, and insecure TLS flag 2026-09-09 22:36:12 +03:00
Dushnilin 3ee5cf2598 fix(singbox): cascade section-level server exclusions to URLTest and Priority groups (#89) 2026-09-09 21:56:00 +03:00
Dushnilin 142fff6b4a fix: zapret2 strategy args, snapshot restore output leak, and opkg update lock handling
- providers/zapret2/common.uc: import core.common and declare as_string helper to resolve type error during zapret2 strategy argument preparation.
- service/snapshot.uc: redirect command output to /dev/null in command_success_from_args to prevent stdout leakage breaking LuCI JSON parsing on snapshot restore.
- settings.js: robustly parse JSON from snapshot command output using regex delimiter.
- components/action.uc: add --force-depends to opkg install arguments, detect opkg lock contention and retry with backoff, and log non-zero exit stdout as warning.
- providers/nfqueue/runtime.uc: ensure standalone services are cleanly stopped and disabled before starting Tachyon-managed runtime.
- section.js, generator_routes.uc, apply.uc: add community_subnets option to conditionally include community CIDRs in routing and nftables.
2026-09-09 11:55:12 +03:00
Dushnilin 4ed85f5b30 feat: add mixed proxy support for AmneziaWG sections and allow UDP on tunnel endpoints 2026-09-08 09:22:06 +03:00
Dushnilin 203bb9b433 fix(singbox): prevent cold-start crash loop on missing community rulesets (#46)
- Bundle universal 17-byte empty SRS stub and add is_valid_srs_file/ensure_empty_srs_stub in rulesets.uc
- Add prepare_community_rulesets in lifecycle.uc to pre-fetch via gh-proxy mirrors or initialize safe local stub before sing-box start
- Support local community rulesets and stubs in generator_routes.uc
- Add fallback to component proxy for list downloads in updates.uc and preserve cached stubs
- Skip non-functional jsdelivr for release downloads and prioritize gh-proxy mirrors in core/url.uc
- Add tests/cold_boot_community_stub.sh testing cold boot fallback behavior
2026-09-07 23:50:01 +03:00
Dushnilin 5539b9701f fix(singbox): prevent UDP routing to HTTP outbounds (#45) and improve dashboard metadata
- Ensure selector and urltest groups require all member outbounds to support UDP
- Add explicit reject rule for UDP on non-UDP outbounds to avoid sing-box router log spam
- Add http/s:// to connection URL description in LuCI settings and update localization
- Display transport protocol badges on dashboard outbound cards and modal rows
- Deduplicate and collapse UDP routing error lines in telegram logs and bug report
2026-09-07 22:50:10 +03:00
Dushnilin 394c717bf9 fix(diagnostics): prevent sing-box listening ports check failure when IPv6 is disabled 2026-09-07 17:27:29 +03:00
Dushnilin dd6b877adb feat: поддержка AmneziaWG 3.1, keepalive ranges, безопасный ruleset HTTP client и Source-Aware DNS 2026-09-07 10:14:12 +03:00
Dushnilin fbeadb48ed fix: разделение правил маршрутизации секции (fix коллизии AND) и поддержка http/https ссылок 2026-09-06 19:23:07 +03:00
Dushnilin fd79c4e317 feat: поддержка HTTP/HTTPS прокси (#45), комплексная доработка деинсталляции и отката конфигурации (1.3.22) 2026-09-06 14:12:27 +03:00
Dushnilin db45d5d84d fix(singbox): устранение утечки Discord в direct на Sing-box 1.14 и верификация троттлинга DPI
- singbox/generator_routes.uc: восстановлена маршрутизация IP-подсетей сервисов в ip_cidr, добавлены сиды для холодного старта
- nft/apply.uc: наполнение sets.subnets сидами подсетей Discord и Telegram до первой загрузки .lst
- components/updates.uc: автоматический reload ядра Sing-box после фонового list_update при обновлении ruleset
- diagnostics/fuzzer.uc: учет объема скачанных данных, детектирование троттлинга DPI 16KB и вердикты проходимости
- fe-app-tachyon: отображение статусов верификации данных и DPI вердиктов в UI фаззера
2026-09-06 13:05:00 +03:00
Dushnilin 6d921d963c fix: корректный порядок применения секций сверху вниз и совместимость со всеми ядрами sing-box (1.3.21)
- Исправлена совместимость с Official (1.13.x), Tiny, LX и Extended ядрами sing-box
- Устранена фатальная ошибка unknown field store_dns на sing-box 1.13.x (автоопределение store_rdrc vs store_dns)
- Добавлена плавная деградация в runtime при неподдерживаемых параметрах cache_file и неизвестных транспортах
- Разделены правила маршрутизации доменов/наборов правил и IP CIDR, устраняя конфликт логики AND в sing-box 1.14+
- Исключены подсети общих CDN (Cloudflare, CloudFront, Hetzner, OVH, DigitalOcean) из nftables L4 для предотвращения перехвата сторонних ресурсов (включая Discord) вышестоящими секциями
- Обеспечено строгое соблюдение порядка следования секций сверху вниз во всех конфигурациях
2026-09-06 08:33:18 +03:00
Dushnilin a4a757223f fix(awg): support AmneziaWG 2.0/3.0/3.1, fix WARP generator safety & update release 1.3.20 2026-09-05 12:00:14 +03:00
Dushnilin e901f9d41a fix: zapret2 startup, dnsmasq fakeip rebind protection, dns detour routes (1.3.19) 2026-09-04 13:56:48 +03:00
Dushnilin e8932d3f2d fix(core): prevent ruleset download_detour crash, resilient selector fallback, and clean legacy migration 2026-09-02 16:49:10 +03:00
Dushnilin 706b35328c feat(ruleset): auto-assign download_detour for remote rulesets & add watchdog self-heal for ruleset DNS stalls 2026-08-30 21:22:23 +03:00
Dushnilin 3c04a62479 feat(server): support per-user LAN isolation with auth_user and custom route rules 2026-08-29 08:33:24 +03:00
Dushnilin 9bc6fe28fd feat(failover): автоматическое переключение прокси-секций
- генератор: при section_failover_enabled catch-all указывает на селектор tachyon-failover со всеми секциями-кандидатами
- выбор по умолчанию переживает рестарты через /etc/tachyon/failover_section, устаревшее имя откатывается на первую секцию
- service/failover.uc: пробер каждой секции через Clash API delay, порог N подряд — переключение на живую, TG-уведомление
- watchdog: вызов проверки в slow-тире (модуль сам отключён при выключенной опции)
- настройки: флаг + порог во вкладке Advanced, RU-локализация
- тесты: генерация вкл/выкл/персист/устаревшее состояние + логика переключения со стабом Clash API
2026-08-26 14:15:23 +03:00
Dushnilin 7f0b085a07 feat(tailscale): нативный режим tailscaled и компонент Tailscale
- новый компонент Tailscale: установка пакета из фида, карточка в Обновлениях
- режим native для секций Tailscale: системный tailscaled вместо sing-box endpoint
- доступ к тейлнету с LAN без клиента: маршруты 100.64.0.0/10 и MagicDNS через dnsmasq
- masquerade и exit-node (opt-in) с обходом tproxy по зарезервированной маске
- validator: требование tailscaled и auth-key для native; bypass-правила в mangle
- тесты: генерация конфига, смоук рантайма с моками, обновлена сигнатура состояния
2026-08-26 11:30:52 +03:00
Dushnilin fc45498a8b feat(singbox): поддержка составных длительностей и автоподнятие urltest idle_timeout, зеркала gh-proxy в README и расширение Knowledge Base 2026-08-16 10:56:27 +03:00
Dushnilin e02e9169d4 fix(core): исправление forward-reference в AI Doctor и фильтрации селектора 2026-08-15 16:02:31 +03:00
Dushnilin 1437997153 fix(core): повышение стабильности, фоновый поиск MTU AWG, zero-fork проверка WAN и защита от OOM 2026-08-15 15:51:10 +03:00
Dushnilin 5d8e0bbfcc fix(smart-detect): маршрутизировать user_domains через прокси секции 2026-08-14 12:39:42 +03:00
Dushnilin 7125e1a48e feat: карточки сервисов на дашборде + секция Hosts в правилах + скрытие вкладки Conditions для Hosts
Дашборд:
- Добавлены карточки статуса Zapret, Zapret2, ByeDpi на панель мониторинга
- Показывают статус (работает/остановлен), количество перезапусков, предупреждения
- Баг: API возвращает boolean а не число — исправлено сравнение

Секция Hosts:
- Перенесены опции hosts из глобальных настроек в отдельный тип секции (action=hosts)
- Опции: пользовательские DNS записи, удалённые списки хостов, автообновление, интервал
- Миграция: автоматический перенос глобальных настроек hosts в секцию
- Вкладка «Условия» скрыта для секций типа Hosts (hosts записи применяются глобально)
- Возвращена кнопка «Import Hosts File» с модальным окном загрузки из файла
- Убраны неиспользуемые опции из settings.js (~280 строк)

Локализация:
- Переведены 6 новых строк для превью импорта hosts
2026-08-06 14:16:18 +03:00
Dushnilin 5eef78b877 fix: DNS петля + watchdog автоисправление + централизация file_is_usable
Ключевые изменения:

1. core/helpers.uc: file_is_usable(path, min_bytes) + file_size_value(path)
   для единообразной проверки файлов (минимальный размер порог).

2. singbox/dns.uc: WAN fallback DNS серверы (fallback_wan_main) теперь
   используют прямой UDP без detour — исправлена петля когда
   DNS шёл через мёртвую прокси-секцию.
   Health probes для ВСЕХ DNS серверов (включая DoH) идут direct —
   failover может определить доступность DNS серверов.

3. watchdog.uc: ai_heal_empty_sections() — автообнаружение пустых
   proxy-секций с подписками → запуск subscription_update_async.
   ai_heal_dns_loop() — при обнаружении DNS-петли (dead proxy +
   dead DNS) → временно отключает DNS detour → загружает подписку →
   восстанавливает настройки.

4. Единая file_is_usable: nft/apply.uc, generator_routes.uc,
   components/{updates,action}.uc, config/validator.uc,
   subscription/cache.uc — все используют helpers.file_is_usable.

5. Тест tests/file_usable.sh для проверки helpers CLI.

6. Исправлен components_updater_job.sh mock lib — добавлен core/helpers.uc
2026-08-03 14:07:57 +03:00
Dushnilin 9b956e1bb4 fix(singbox+nft): skip broken local .srs/.lst rulesets and raise size guards
- generator_routes.uc: ensure_custom_ruleset() returns null and local
  file references with size <100 bytes are skipped (previously would
  silently reference a nonexistent/broken path, leaving sing-box with
  no domain matchers)
- generator_routes.uc: ruleset/rule_sets_with_subnets loops guard
  against null ensured result before accessing .tag/.kind
- nft/apply.uc: community-subnets .lst files with size <50 bytes are
  skipped before handing data to nftables
2026-08-03 09:37:37 +03:00
Dushnilin f98819b1e9 fix(singbox): guard against broken/truncated .srs rulesets (min 100 bytes)
Tiny or zero-byte .srs files can appear after interrupted downloads or
failed remote fetches. If such a file is picked as a local ruleset, the
section silently loses its domain matchers. Raise the size threshold to
100 bytes so damaged snapshots fall back to the remote rule_set URL.
2026-08-02 21:49:07 +03:00
Dushnilin f3d8c5a264 fix: решение зацикливания TPROXY FakeIP для ip.podkop.fyi и синхронизация тестов с локалями 2026-07-30 10:39:55 +03:00
Dushnilin c7ff142a48 Release 1.2.43 - Pre-download and cache all preset rulesets & databases 2026-07-29 08:58:00 +03:00
Dushnilin 53e3f1f041 feat(routing): add traffic type / protocol filtering and exclusion per section 2026-07-28 21:46:18 +03:00
Dushnilin eef4d587bd feat: custom multi-country GeoIP grouping and filter modes (include/exclude) 2026-07-27 18:30:02 +03:00
Dushnilin 3c3a4b7035 feat(section): add DSCP mark matching for QoS application routing 2026-07-27 17:09:48 +03:00
Dushnilin 5ff4c448bd fix: nft populate community subnets on reload + generator_routes return fix for Telegram 2026-07-27 09:02:44 +03:00
Dushnilin 197013f043 fix: persistent community subnet storage & reboot fallback for Telegram in section Main 2026-07-27 08:38:55 +03:00
Dushnilin b3e6fcd0c1 fix: load community subnets from /tmp/sing-box/rulesets path & bump v1.2.34 2026-07-26 22:56:16 +03:00
Dushnilin c012a5710b refactor: remove hardcoded Telegram IP arrays in favor of fully dynamic community subnet loading
- updates.uc: cache downloaded built-in subnet lists (telegram, meta, twitter, etc.) to community-subnets-<service>.lst.
- generator_routes.uc: dynamically load community list IP CIDRs from cached subnet files for all community lists into sing-box route rules. Zero hardcoded IP arrays.
2026-07-26 21:45:15 +03:00
Dushnilin e9ad56df56 fix: complete Telegram routing, AmneziaWG action support & flowtable bypass
- nft/apply.uc: add 'awg' and 'warp' to action_captures_traffic so nftables
  creates priority sets for AmneziaWG / Cloudflare WARP sections.
- nft/apply.uc: insert flowtable bypass in fw4 forward for marked TPROXY packets
  so OpenWrt flow offloading doesn't hijack proxied connections.
- singbox/generator_routes.uc: include official Telegram IP CIDRs in route rules
  for telegram community list so direct IP connections match sing-box rules.
2026-07-26 21:31:31 +03:00
Dushnilin 9c04276aac fix(geoip): запрет geoip_country для block/bypass/dns секций - предотвращение блокировки всего зарубежного трафика 2026-07-26 19:15:04 +03:00
Dushnilin dc071a5064 feat(routing): Selective GeoIP Routing (Региональный умный маршрутизатор по странам non-ru/ru/us/cn) 2026-07-26 18:33:53 +03:00