Commit Graph
5 Commits
Author SHA1 Message Date
omarandClaude Opus 4.8 ee7df9f3a1 feat(nodes): per-node mux/XUDP + sockopt (TCP FastOpen/keepalive, mark) [T1]
build / aarch64_cortex-a53 (push) Successful in 3m1s
build / x86_64 (push) Has been cancelled
Adds optional per-node multiplexing and socket options, applied after
ParseShareLink at all three outbound build sites (group members, standalone
node targets, chain hops) and BEFORE withMark so the loop-guard escape mark
(255) is always re-asserted last and wins — a per-node mark that is neither 0
nor 255 is refused (would break the nft escape rule → routing loop).

- model.go: Node.{Mux,MuxConcurrency,XUDPConcurrency,XUDPProxyUDP443,Mark,
  TCPFastOpen,TCPKeepAliveIdle}; uci.go parses them. All zero-value = off, so
  existing nodes emit byte-identical outbounds.
- generate.go: applyNodeOpts() emits outbound-level `mux` (XUDP keys only for
  vless/vmess) + streamSettings.sockopt tcp knobs; skips mux under XTLS Vision.
- nodes.js: modalonly mux/XUDP/sockopt fields (depends on mux).
- tests: node_opts_test.go (mux emitted/off, XUDP gating, vision skip,
  loop-guard mark wins, tcp knobs).

Verified live on the 512M VM: mux node emits {enabled,concurrency:8,
xudpConcurrency:16,xudpProxyUDP443:reject}; sockopt.mark==255 preserved;
xray -test OK. r9.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:22:39 +03:00
omarandClaude Opus 4.8 961dfe4d76 feat(probe): configurable reachability checks — observatory settings + on-demand HTTP/chain probes
Answers "how is a node 'reachable' decided, and can I configure it?".

* Observatory (the node "alive"/latency in Overview & Nodes) is xray fetching a
  probe URL THROUGH each node every interval. That URL + interval are now global
  settings (globals.probe_url / probe_interval, exposed on the Settings page) used
  as the default; a group can still override. Default stays gstatic/generate_204.

* On-demand Node "Test" is now method-selectable, TCP stays the default:
  - tcp  (fast): raw endpoint connect (unchanged behaviour).
  - http: a REAL proxy-path GET/HEAD through the node — spins an ephemeral xray
    (local SOCKS inbound routed through the node), does the request over a tiny
    stdlib SOCKS5 client, and reports status + latency + exit IP. No new deps.
  `xrayctl node test NAME --method http [--url U] [--http-method GET|HEAD]`.

* Chain reachability ("проверку связки"): `xrayctl chain test NAME` probes the WHOLE
  multi-hop chain end-to-end (reusing the real chain machinery incl. its internal
  socks-hop routing) and reports reachable/latency/exit IP. Exposed on the Chains
  page (select a chain -> Test chain).

ubus: node_test gains method/url/http_method; new chain_test (acl updated).

Verified live: node http probe DE-vless-8 -> 200 exit 91.107.150.14; chain
DE-vless-8->NL-ss-4 -> 200 379ms exit 193.29.139.249 (matches the tproxy E2E); UI
selector, chain Test button, and Settings fields all work via Playwright.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 13:54:22 +03:00
omarandClaude Opus 4.8 05920f83ad fix: eliminate reconcile fork-storm (OOM) + resolve UCI config conflict with xray-core
build / aarch64_cortex-a53 (push) Successful in 3m0s
build / x86_64 (push) Successful in 2m59s
Two release-blocking defects found via live 512M OpenWrt VM testing.

1) Fork-storm / OOM (critical). Reconcile() -> reloadXray() ->
   "/etc/init.d/shater reload" -> reload_service -> shater_reconcile ->
   `xrayctl reconcile` -> Reconcile() was an infinite mutual recursion; each
   level blocked on CombinedOutput and spawned a process (854x reconcile +
   853x reload observed), exhausting RAM and pinning both vCPUs -> OOM-killer.
   - Reconcile() no longer calls reloadXray(); procd's file-watch on run.json
     restarts xray. Reconcile runs inside the init lifecycle, so calling the
     init back is the recursion.
   - reloadXray() now runs `/etc/init.d/shater start` (not `reload`); it is only
     invoked from Apply()/Rollback() (LuCI/ubus/CLI), never the init lifecycle.
   - init reload_service() simplified to start/stop (dropped the double reconcile).
   Verified: `xrayctl apply` 0.39s (was >185s hang); 93 procs / load 0.00 stable
   with an active 254-node config on 512M; xray binds :10853 API + :12345 tproxy.

2) UCI config namespace clash. shater shipped /etc/config/xray, which collides
   with the xray-core dependency's own /etc/config/xray (opkg dropped ours to
   /etc/config/xray-opkg, so the schema never took effect). Renamed the UCI
   namespace xray -> shater everywhere (Go uci export/commit, all 11 LuCI views +
   acl, init scripts, hotplug, Makefile conffiles, examples). Runtime paths
   (/etc/xray/run.json, /usr/share/xray), the xray-core package, and the ubus
   object name are intentionally unchanged.

Also: ci/pack-xrayctl.sh (local ipk packer) with a postinst chmod so the binary
is executable regardless of host-tar mode handling; PKG_RELEASE bumped to r3.

Verified end-to-end on a fresh 512M OpenWrt 24.10.3 VM: feed install
(opkg install luci-app-shater pulls xrayctl+shater-core), real LAN client
(netns in br-lan) proxied through a live subscription node -> exit IP changed
(104.156.233.234 vs 45.131.214.140 direct); per-client nft counters + xray
stats API populated. See PROOFS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 11:36:48 +03:00
omar 71a6f127a1 T1 features: egress, kill-switch, full DNS, stats/API, rulesets, live nodes, sub scheduling, all LuCI pages (4-agent build + integration); real xray -test 'Configuration OK' with full-feature config
build / aarch64_cortex-a53 (push) Successful in 3m2s
build / x86_64 (push) Successful in 3m1s
2026-07-09 10:12:55 +03:00
omar 080cbc594d ci: move packages to repo root so gh-action-sdk feed finds them
build / aarch64_cortex-a53 (push) Failing after 2m11s
build / arm_cortex-a7_neon-vfpv4 (push) Failing after 2m19s
build / mipsel_24kc (push) Failing after 1m51s
build / x86_64 (push) Failing after 3m49s
CI failed: 'No feed for package xrayctl found' / 'No rule to make target
package/xrayctl/download' — gh-action-sdk indexes packages at the feed (repo)
ROOT, not a nested package/ dir. Moved xrayctl/, luci-app-shater/, shater-core/
to root; fixed workflow comment and doc paths.
2026-07-09 02:36:22 +03:00