Commit Graph
15 Commits
Author SHA1 Message Date
Dushnilin 8a56361bfd fix: prevent package removal during web update and fix zapret2 installation
- Fix package postrm scripts to strictly require \ to be 'remove' or 'purge' before running cleanup, preventing destructive cleanup when opkg runs postrm with empty arguments during reinstalls/upgrades.
- In action.uc install_files, ensure tachyon backend package is installed before luci-app-tachyon to prevent opkg dependency removal races.
- In action.uc install_zapret2, ensure ::1 localhost exists in /etc/hosts before package installation to prevent nftables IPv6 resolution errors, and cleanly stop/disable standalone zapret2 daemon.
- In zapret2 provider common.uc and nfqueue runtime.uc, automatically resolve required blob binary payloads and default filter parameters for strategies.
- In fe-app-tachyon, add 'access denied' / 'Доступ запрещён' to transient RPC error patterns and track install_version as self-update so rpcd reload during self-update does not abort the progress modal with an error.
- In tests/package_lifecycle.sh, avoid grep -q in pipefail pipelines to prevent upstream SIGPIPE failures.
2026-09-09 07:37:55 +03:00
Dushnilin 510fb48dd8 fix(packaging): предотвращение сброса служб и зависания LuCI при обновлении пакетов 2026-09-06 20:15:23 +03:00
Dushnilin 180c52ecde test: fix BusyBox portability issues in backend test suite 2026-08-11 16:33:46 +03:00
DushnilinandClaude Opus 5 84924a0fff fix(build): bound the prerm hooks build.sh writes into the packages
build.sh assembles the APK and IPK packages itself rather than going through
OpenWrt's packaging, so it carries its own copies of the prerm-family hooks.
Bounding Package/tachyon/prerm in tachyon/Makefile therefore never reached the
released artifacts: 1.2.66 shipped with

    exit(system("/usr/bin/tachyon package_prerm upgrade >/dev/null 2>&1"));

which is both unbounded and status-propagating. `exit(system(...))` returns a raw
wait status, so a cleanup that was merely killed took the upgrade down with it —
on the router that surfaced as

    ERROR: lib/apk/exec/tachyon-1.2.66.pre-upgrade: exited with error 247

247 being 128+119, the cleanup SIGKILLed by its own sweep.

All three hooks written here (APK pre-upgrade, APK pre-deinstall, backend IPK
prerm) now probe the BusyBox timeout spelling against /bin/true, bound the
cleanup at 90s, and exit 0 unconditionally — matching the Makefile.

tests/package_lifecycle.sh gains contracts over all three: each must be bounded,
must not propagate the cleanup's status, and must compile. They live inside
heredocs, so ucode_syntax_lint.sh never sees them and a syntax error would only
surface on a router mid-upgrade.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 21:13:33 +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
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 509cf128b8 Merge: объединить изменения из upstream forkop в tachyon, разрешить конфликты и исправить тесты E2E 2026-07-15 17:56:18 +03:00
Dushnilin 46ef97fe89 Release 1.0.6: синхронизировать изменения из upstream и исправить баг фильтра URLTest/Priority 2026-07-14 08:56:31 +03:00
Dushnilin bb1de1fd83 Merge branch 'temp-upstream-rebrand' into main
Resolves merge conflicts:
- install.sh, build.sh, .github/workflows/build.yml: Reverted to Dushnilin's versions to avoid installing SourceForge mirrors.
- fe-app-tachyon: Resolved type, formatting and copyOutbound conflicts, keeping both Dushnilin's custom features and ushan0v's frontend performance optimizations.
- backend: Kept Dushnilin's ucode refactorings, Telegram bot integration, and release repository URL (Dushnilin/tachyon) while merging updates.uc cache format v8 & persistent cache format v7.
- tests: Merged tests from both branches, preserving ucode -L wrappers for local test execution.
2026-07-14 08:01:45 +03:00
Dushnilin 14df12a18d Rebrand upstream: переименовать forkop в tachyon 2026-07-14 07:48:33 +03:00
ushan0v 80d20cd8ef Refactor runtime and harden package lifecycle 2026-07-14 05:06:27 +03:00
Dushnilin f57dac6b52 refactor(rebrand): полный ребрендинг в Tachyon и перенос служб watchdog/doctor на Ucode 2026-07-13 14:09:38 +03:00
ushan0v 8f8e0de4e1 Stop Forkop before removing its route table 2026-07-12 15:29:25 +03:00
ushan0v b5f2eb3724 Rebrand project as Forkop 2026-07-11 18:23:20 +03:00
ushan0v dc052f03a7 Simplify build and backend test layout 2026-07-11 05:11:50 +03:00