Commit graph

4 commits

Author SHA1 Message Date
necronicle
bbd4b5bf1f fix: comprehensive code review — 40 fixes across 14 files
Critical: CRLF→LF in hostlists (broke nfqws2 matching), die in pipe
subshell (errors silently ignored), update_z2k /bin/sh overwrite guard,
missing quic_rutracker blob registration, telemetry race condition
(multi-process merge).

Security: sed injection via user input → grep -vxF, grep -qx → -qxF
for domain matching, chmod 777/666 → 755/644 + chown nobody,
predictable /tmp/z2k cleanup before mkdir.

High: PID path mismatch /opt/var/run → /var/run, zapret2_nat chain in
cleanup, orphaned tcpdump on monitor stop, cross-filesystem mv → cp+rm,
base.sh re-source clobber fix.

Medium: version mismatch, root check for default install path, early
exit for help/version, backup/restore dir fix, awk special chars,
HTTP RKN failure_detector, youtube_tcp_tcp typo, hostlist warning,
kernel module regex anchoring, state eviction + locking in Lua.

Dead code removed (~200 lines): check_installation_status,
menu_view_strategy, apply_category_strategies, update_init_section,
get_init_tcp/udp_params, TEST_DOMAINS, HTTP_STRATEGIES_CONF,
check_keenetic_specifics, discord_tcp variable.

Added .gitattributes to enforce LF line endings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 00:38:58 +03:00
necronicle
d687f5221c revert: rollback to ca46a4d category-based system + preserve bugfixes
Unified ipset/autohostlist migration broke bypass for many sites.
Restores all 12 files to ca46a4d (category-based hostlists) and
preserves two bugfixes: ZAPRET_BASE export (f1251df) and Entware
cron (c69b0ee).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:36:38 +03:00
necronicle
c949d5db3c fix: comprehensive review - 14 bugs fixed, dead code removed, UX improved
Priority 1 (critical):
- NDM hook: fix grep target (config file, ENABLED=1)
- FLOWOFFLOAD: fix variable expansion in single-quoted heredoc
- Remove 7 stray case 3) merge artifacts from install.sh
- Add missing CATEGORY_STRATEGIES_CONF constant
- Fix NFQWS2_OPT multiline validation (sed range extraction)

Priority 2 (UX):
- Restore [5] view strategy and [7] Discord menu options
- Fix all garbled UTF-8 strings in config_official.sh and install.sh
- Replace full service restart with SIGHUP for list reload
- Strip trailing --new from last config profile

Priority 3 (cleanup):
- Remove dead code (TOP20_STRATEGIES, TEST_DOMAINS, DISCORD_DOMAINS, check_keenetic_specifics)
- Extract load_current_categories() helper, replace 8 duplicated blocks
- Fix double </dev/tty in strategies.sh
- Fix generate_gv_domain() dual output
- Fix sed regex for domain deletion (escape dots)
- Remove Z2K_VERSION duplication (fallback in utils.sh)
- Fix undefined $tools_dir reference
- Fix AWK for-in iteration order in discord.sh
- Add iptables cleanup trap in test_strategy_tls()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 13:04:46 +03:00
necronicle
21c3bfe056 fix: Критичные исправления для совместимости с install_easy.sh + автоустановка
Критичные исправления (блокеры PRE-ALPHA → ALPHA):
- Добавлен init_system_vars() для инициализации SYSTEM, UNAME, INIT
- Добавлен crontab_add() для автообновления списков (06:00)

Важные исправления (production готовность):
- step_configure_tmpdir() - автоматический выбор TMPDIR по RAM
- dry_run_nfqws() - валидация опций при создании config
- DISABLE_IPV6=1 по умолчанию для Keenetic
- FLOWOFFLOAD=none по умолчанию (безопасный режим)

Переход к автоустановке:
- Убрано меню [S] Системные настройки (220 строк)
- step_configure_tmpdir() работает БЕЗ вопросов юзеру
- Автоматический выбор всех настроек на основе параметров системы

Новые файлы:
- lib/system_init.sh - инициализация системных переменных
- KEENETIC_RELEVANCE_ANALYSIS.md - анализ релевантности исправлений
- IMPLEMENTATION_SUMMARY.md - описание реализации
- AUTOINSTALL_FIXES.md - переход к автоустановке
- FINAL_CHANGES_SUMMARY.md - полный отчёт
- CRITICAL-FIXES-NEEDED.md - краткий reference
- z2k-vs-official-critical-differences.md - детальный анализ различий
- FIXES_COMPLETED.md - summary выполненных исправлений

Изменённые файлы:
- z2k.sh - вызов init_system_vars()
- lib/install.sh - crontab, tmpdir автоматически
- lib/config_official.sh - DISABLE_IPV6=1, валидация
- lib/menu.sh - удалены интерактивные настройки

z2k теперь полностью автоматический установщик для Keenetic без лишних вопросов.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 14:05:25 +03:00