Commit Graph
167 Commits
Author SHA1 Message Date
Dushnilin 1c48422511 fix(luci): ensure Tachyon menu item reliably appears in LuCI
- Remove 'uci: { tachyon: true }' dependency from menu.d/luci-app-tachyon.json so LuCI does not hide the menu node if UCI config is uncommitted/reloading
- Add portable timeout normalization in install.sh ucode to handle Busybox timeout and systems without timeout applet
- Ensure luci_postinst is called directly in IPK postinst (build.sh) and after install in install.sh
- Restart uhttpd alongside rpcd and purge LuCI caches in post-install and uninstaller
- Fix uninstall.sh to remove packages individually with lock retry and omit non-existent luci-i18n-tachyon-en
- In install_ui_packages, verify that menu.d/luci-app-tachyon.json actually exists on disk before proceeding
2026-09-03 19:14:22 +03:00
Dushnilin 2d551bd2d1 fix(service): исправить fs.stat в lifecycle.uc, очистку кэша LuCI и перезапуск rpcd/uhttpd 2026-09-01 15:15:42 +03:00
Dushnilin 23aae78147 feat(migration): 1.3.11 - CLI команда import_settings и исправление миграции Forkop
- Добавлена CLI команда tachyon import_settings [файл] (и алиас import-settings) для автоматического сканирования и бесшовного импорта настроек из Forkop, Forkop Plus, Podkop, Netshift или резервных копий
- Поддержка in-place миграции прямо из активного /etc/config/tachyon при обнаружении унаследованных правил config rule
- Расширенное сканирование резервных копий и файлов конфигураций в /etc/config/, /root/ и /tmp/
- Исправлен режим миграции Forkop в Makefile, build.sh и install.sh (использование migrate-podkop для корректного преобразования старых секций config rule в config section)
- Добавлен интеграционный тест tests/import_settings.sh (119 тестов бэкенда пройдены)
2026-09-01 12:15:00 +03:00
Dushnilin 4e57a9649d feat(installer): add jsdelivr.net CDN as primary mirror for download failover 2026-08-27 19:28:59 +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 f807b20afb fix: lower min OpenWrt version to 23.05 (matches e2e test image) 2026-08-10 12:38:48 +03:00
DushnilinandClaude Opus 5 4ce5d7ebac fix: prerm kill sweep must not kill its own ancestors
`ps | grep '/usr/bin/tachyon'` matches the hook itself, because
/usr/bin/tachyon is what invoked it. The sweep therefore killed its own
parent, the parent died on SIGKILL, and apk saw
`tachyon-<version>.pre-upgrade: exited with error 247` (128+119) and
reported a failed hook.

The sweep now walks /proc/<pid>/stat to collect its own ancestor chain and
skips those pids.

Holders of procd's serialization lock are also cleared by descriptor rather
than by name. procd_lock() does `exec 1000>` on
/var/lock/procd_tachyon.lock and then `flock 1000` with no -w, so any
background spawn inheriting fd 1000 keeps the lock held. On a live router
the holders were watchdog workers, logread, the zapret2 supervisors, nfqws2
and a stray curl — none of which match a tachyon name pattern. While any of
them lives, every init.d call blocks in flock until the package manager
gives up on the hook.

Same descriptor-based sweep added to install.sh, which faces the same lock
left behind by pre-fix builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 20:50:08 +03:00
DushnilinandClaude Opus 5 547f42e92d fix(install): fail when a rolled-back upgrade leaves an unstamped build
installed_backend_sha() rejects the unsubstituted __COMPILED_COMMIT_SHA__
placeholder and the literal "unknown", so a stale build on disk reports no SHA at
all. install_backend_package treated that empty value as "fresh install" and fell
through to the presence check, which passes trivially after an apk rollback — the
package and its version are still there. The run printed

  WARN Package manager reported errors during installation, but tachyon is
       installed — continuing

directly after the backend install had been rolled back, and then continued
through the remaining steps to a green banner over a failed upgrade.

Record whether tachyon was installed before the install and treat "was present,
still reports no SHA afterwards" as the failure it is. A genuine first install has
no package present beforehand and is unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 20:25:32 +03:00
Dushnilin 2fc57d383d fix(installer): free the rc.common lock before the package manager runs
Bounding the hooks fixes future upgrades, but the hook that runs during
THIS one belongs to the build already installed, and every release up to
1.2.66 shipped a prerm with no timeout. It blocks on rc.common's
flock -w 1000, which procd keeps re-populating with retry_start_on_wan_up
waiters between pre- and post-upgrade, so apk's pre-upgrade outlives its
patience and the transaction is rolled back.

cleanup_legacy already stops and disables the service; it now also kills
the flock waiters, so the old unbounded hook has nothing left to wait on.
2026-08-09 18:35:42 +03:00
Dushnilin f770316345 fix: bound package hooks so apk cannot roll the upgrade back
The router upgrade died at the installer's 120s ceiling while apk was
running tachyon-1.2.66.pre-upgrade, so apk rolled the transaction back
and the old build stayed installed.

prerm reached INIT_PATH status through rc.common, which waits on
flock -w 1000. A stuck start or retry_start_on_wan_up holding that lock
stalls the hook for up to a quarter of an hour. Every init call in the
hooks is now bounded, the status probe moved after the flock waiters are
killed, and the Makefile hook bounds the old version's cleanup from the
outside since that code cannot be trusted to bound itself.

The installer also called a rollback a success: a rebuilt tag keeps its
version, so both the presence and version checks still passed. It now
compares the commit SHA baked into the installed constants module and
fails loudly when it did not move. Package installs get 300s, since a
kill mid-transaction is what caused the rollback.
2026-08-09 18:23:16 +03:00
Dushnilin af2d07b056 fix(updates): установка пересобранных релизов в рамках одного тега
opkg считает пакет уже установленным при равенстве версий, поэтому
пересборка под тем же тегом молча не применялась: задание завершалось
успехом, билд оставался старым. Добавлен --force-reinstall в
pkg_install_files_command (opkg) и в install.sh; apk не тронут, он
всегда пишет переданный файл.

Детект пересборки больше не зависит только от SHA, которого нет в
релизах старше f974e4a0: добавлен отпечаток билда по published_at и
метаданным ipk-ассета, решение вынесено в tachyon_build_differs с
префиксным сравнением SHA разной длины. Отпечаток установленного
билда пишется в state-файл и попадает в extra.

Telegram уведомляет о пересборках: check_notified_updates пропускает
outdated_same_release, дедуп идёт по версии и SHA, текст показывает
короткие SHA вместо пары одинаковых версий.

Кэш проверки обновлений сохраняет current_sha из результата действия
вместо безусловного latest, иначе неудачная установка выглядела как
"актуально".

Фронт пересобран из TS, ручная правка main.js снята. Добавлен
describeSameReleaseBuild с фолбэк-текстом, когда SHA недоступен.
2026-08-09 16:57:10 +03:00
Dushnilin e47704ff14 fix(prerm/postinst): use BIN_PATH stop, clear flock in postinst, always return true; fix(install): verify package VERSION not just existence on APK error 2026-08-09 11:44:33 +03:00
Dushnilin 9b3066c846 fix(install): retry APK commands on database lock (exit 227) in install.sh 2026-08-09 09:43:37 +03:00
Dushnilin 43853f5e3f fix(installer): make package removal warnings non-fatal during upgrade 2026-08-07 18:13:00 +03:00
Dushnilin cb62d7e006 feat(installer): comprehensive command and system execution audit logging 2026-08-05 17:14:11 +03:00
Dushnilin f4bc3255c6 i18n(installer): full Russian localization support for installer steps and status summary 2026-08-05 16:47:32 +03:00
Dushnilin c38dfc792d fix(installer): fallback to run_with_deadline when timeout binary is missing 2026-08-05 16:15:54 +03:00
Dushnilin 0eda44e26c installer: show package manager errors on failure
pkg_list_update, pkg_install_name, and pkg_install_files now capture
stderr and display last 10 lines when package operations fail.
2026-08-05 15:31:56 +03:00
Dushnilin efe002b43d installer: reliability improvements
- Abort on failed package removal instead of continuing
- Improve run_with_deadline with process group kill (kill -- -PID)
- Add timeout 120s for package install/update/remove (apk/opkg)
- Add timeout 10-30s for all service operations (enabled/running/status)
- installer_deactivate_legacy_base returns false on failure
2026-08-05 14:35:48 +03:00
Dushnilin 7b6f607257 installer: don't fail when apk reports non-critical errors
- Capture apk output to log file instead of /dev/null
- Show last 5 lines of apk output on screen when installation fails
- Fix package name parsing to strip version (tachyon_1.2.58 -> tachyon)
- Continue installation if package is actually installed despite apk errors
- Apply same resilience to backend, luci-app, and i18n packages
2026-08-05 08:18:18 +03:00
Dushnilin c7febcb0dc fix: atomic writes, crash safety, deadlock prevention across 10 files
watchdog.uc:
- H-4: ai_heal_uci_config atomic write (tmp → rename)
- H-5: backup validation via uci valid before restart
- H-6: proxy restart cooldown (max 3 per 10 min)
- H-7: restart lock file prevents parallel restarts
- H-13: ai_heal_wan_interface reads 'network' not 'tachyon' config
- M-3: nslookup -port=53 → plain nslookup (BusyBox compat)

generator.uc: atomic_write_json_file for main config output
hosts.uc: atomic cache write (tmp + mv), TOCTOU double stat fix
telegram.uc: atomic config restore, persistent /etc/.tachyon/ paths
migration.uc: UCI commit before cache removal
updates.uc: background reload inside locked section (deadlock prevention)
lifecycle.uc: uci commit return check, watchdog/telegram failure logging
package.uc: postinst_restore returns actual start result
build.sh/install.sh: Wave 1 backup/restore fixes
2026-08-03 19:43:10 +03:00
Dushnilin 51f9f1e43e installer: fix shellcheck SC1072 in tui_progress 2026-08-03 15:17:49 +03:00
Dushnilin 0cbbf3bd15 installer: fix TUI colors on OpenWrt busybox, clean output 2026-08-03 15:13:26 +03:00
Dushnilin 7a10fc9486 installer: inline TUI, remove tools dir, remove installer_tui.sh 2026-08-03 14:55:02 +03:00
Dushnilin e371f7a52e installer: TUI without ASCII logo 2026-08-03 14:48:04 +03:00
Dushnilin 280aa2bfac fix(install): tolerate apk non-critical errors when package is actually installed
On some OpenWrt builds (e.g., FriendlyWRT with ip-full conflict), apk
reports '1 error' even though the package installed successfully
(pre/post scripts ran). The install script now checks if the package
is actually installed after apk returns non-zero, and continues if so.
2026-08-03 14:22:20 +03:00
Dushnilin 254595c9b4 Исправлено зависание установки из-за блокировок GitHub (добавлены зеркала gh-proxy) и исправлено удаление sing-box при ошибке обновления 2026-07-21 15:16:12 +03:00
Dushnilin d30150d80e feat: добавлены все варианты sing-box в интерактивное меню install.sh 2026-07-21 10:24:02 +03:00
Dushnilin bf24983bc4 Fix install.sh overwriting Leadaxe sing-box with extended-compressed sing-box due to legacy detection logic 2026-07-21 08:42:41 +03:00
Dushnilin e1d7b00ba8 feat(installer): add seamless NetShift migration support 2026-07-19 23:16:08 +03:00
Dushnilin 509cf128b8 Merge: объединить изменения из upstream forkop в tachyon, разрешить конфликты и исправить тесты E2E 2026-07-15 17:56:18 +03:00
ushan0v 28ca142662 Restore dnsmasq after legacy backend failure 2026-07-14 22:34:57 +03:00
ushan0v 80d20cd8ef Refactor runtime and harden package lifecycle 2026-07-14 05:06:27 +03:00
ushan0v c05752fd5f Bound installer service checks 2026-07-14 01:38:42 +03:00
Dushnilin f017d01a52 Рефакторинг кода: дедупликация ucode, исправления shellcheck и глобальное улучшение install.sh 2026-07-13 22:38:24 +03:00
Dushnilin e41f30213f Установка лимитов скорости curl в установщике для предотвращения зависаний 2026-07-13 20:33:25 +03:00
Dushnilin 8c9bb8734b Рефакторинг и стабилизация: обновление установщика, бэкенд-утилит и оптимизация фронтенда
- Установщик (install.sh): внедрена верификация хешей sha256sums.txt, нормализована очерёдность бутстрапа ucode до языковых проверок.
- Сборщик (build.sh): добавлена автоматическая генерация sha256sums.txt для пакетов релиза.
- Бэкенд: права на honeypot FIFO ограничены до 0660 в watchdog.uc, исправлена опечатка в SUBNETS_TELEGRAM, удалён helpers.old.uc.
- Тесты бэкенда: написаны тесты для core_ip, core_url и config_connections.
- Фронтенд: реализовано автопереподключение WebSocket с экспоненциальным бэкоффом, проведена дедупликация виджетов и модальных окон в initController.ts, мигрирован CSS-префикс с fkp_ на tachyon_.
- Тесты фронтенда: добавлен initController.test.ts для тестирования загрузки дашборда.
2026-07-13 20:23:33 +03:00
Dushnilin 04f8ed0e9b fix: инициализация секции Telegram и улучшение детализации вывода установщика 2026-07-13 16:15:24 +03:00
Dushnilin c65a33fd37 ci: принудительная перезапись временного скрипта ucode в установщике install.sh 2026-07-13 15:02:52 +03:00
Dushnilin 4c5575ddbe ci: добавление резервного списка релизов и обработки массивов в установщике install.sh 2026-07-13 15:02:09 +03:00
Dushnilin 9fafa73468 ci: удаление жестких зависимостей kmod из бэкенд-пакета и добавление мягкой установки в install.sh 2026-07-13 14:55:57 +03:00
Dushnilin d3cd52adca ci: отключение критичности ошибок при удалении устаревших пакетов в установщике 2026-07-13 14:46:39 +03:00
Dushnilin c7934b9321 ci: добавление альтернативных зеркал для загрузки релизов и API-запросов в install.sh 2026-07-13 14:45:08 +03:00
Dushnilin f57dac6b52 refactor(rebrand): полный ребрендинг в Tachyon и перенос служб watchdog/doctor на Ucode 2026-07-13 14:09:38 +03:00
Dushnilin cd3591fbff refactor: обновление URL репозитория на github.com/Dushnilin/tachyon 2026-07-13 11:03:35 +03:00
Dushnilin e5c022c2c6 refactor: оптимизация хелперов бэкенда и очистка фронтенд-зависимостей
Проведен рефакторинг кодовой базы для устранения дублирования кода и оптимизации скриптов сборки:

- Бэкенд (ucode):
  - Перенесена функция экранирования шелл-аргументов `shell_quote` в общий модуль `core.common`.
  - Удалены дублирующиеся инлайновые объявления функций `as_string`, `shell_quote` и `read_json_file` из всех 23 файлов бэкенда. Вместо них настроен импорт из общего модуля `core.common`.
  - Валидация IP-адресов и CIDR в файле `core/helpers.uc` переведена на использование методов из модуля `core.ip` (`core_ip.valid_ipv4` и `core_ip.valid_ipv4_cidr`).
  - Проверка исполняемости файла (`test -x`) в скрипте `install.sh` заменена на нативную побитовую проверку прав через `fs.stat`.

- Локализация и сборка перевода:
  - Создан общий модуль `fe-app-forkop/locales-utils.js` для получения информации о пользователе Git (`getGitUser`) в скриптах перевода.
  - Из скриптов `generate-po.js` и `generate-pot.js` удалены локальные копии `getGitUser()`, они импортируют общую функцию.

- Зависимости Node.js фронтенда:
  - В скрипте `fe-app-forkop/watch-upload.js` стандартная библиотека `glob` заменена на `fast-glob`.
  - Устаревший пакет `glob` удален из `devDependencies` в `fe-app-forkop/package.json`.
2026-07-13 10:57:21 +03:00
ushan0v afc05c9100 Restore per-interface domain resolvers 2026-07-12 21:38:58 +03:00
ushan0v bcb9794cb9 Keep installer wget timeouts portable 2026-07-12 16:05:06 +03:00
ushan0v c1f6cbe6b7 Preserve Tailscale state during legacy migration 2026-07-12 15:23:24 +03:00
ushan0v 00b7a400ec Bound installer network requests 2026-07-12 15:01:11 +03:00