Commit Graph
2139 Commits
Author SHA1 Message Date
zxlhhyccc 6041e5c4b4 luci-app-ssr-plus: fix(clash): validate DNS server and domain before ECH lookup
Problem:
fetch_ech_config() trusted the raw dns_server string:
- port extracted with dns_server:match(":(%d+)"), which misreads
  "https://1.1.1.1/dns-query:8080" as port 8080 and
  "[2001:db8::5353]:53" as port 5353.
- safe_server = server:match("^[%w%-%._]+$") accepted
  999.999.999.999, "::::" and bad..hostname.
- safe_domain = domain:match("^[%w%-%._]+$") accepted
  -example.com, example..com and a..b.
- No protocol allowlist, so tcp:// / quic:// silently degraded
  to a plain UDP 53 query.
- dig had no timeout; an unreachable DoH could stall the
  subscription conversion for the default 5s * 3 attempts.

Fix:
- Add parse_dns_server() that strips scheme, path, query and
  fragment, then extracts host[:port] with explicit handling for
  IPv6 literals. Trailing colons and empty ports are rejected.
- Add valid_dns_domain() for label-level DNS validation
  (empty label, leading/trailing hyphen, label length,
  total length).
- Add valid_ipv4() (dotted quad, no leading zeros) and
  valid_ipv6() (hextet count, single "::", max 4 hex per group).
- Add a protocol allowlist ("" / https / doh / tls / dot);
  other schemes return nil immediately.
- Enforce port range 1-65535.
- Add "+time=3 +tries=1" to dig.
- Fix command_exists() to treat whitespace-only output as absent.

Scope:
Only affects ECH config generation (fetch_ech_config) and
command_exists. ECHConfigList extraction, YAML dumping and all
other actions are unchanged. The generated ech-opts.config /
query-server-name values are byte-identical for valid inputs.
2026-11-27 22:13:50 +08:00
zxlhhyccc 3549072608 luci-app-ssr-plus: fix builtin DNS detection for v2ray nodes
Problem:
  With pdnsd_enable=7 on a v2ray node, ssr-monitor kept logging
  "builtin dns error.restart!" and restarting the service every 30
  seconds.

Cause:
  is_builtin_dns_active() only accepted a process command line
  matching "$TMP_PATH/.*ssr-retcp\.(json|yaml)". When the node runs
  on Mihomo (server_subscribe.enable_mihomo=1), the actual command
  line is:
    /var/etc/ssrplus/bin/ssr-retcp -d .../v2ray-<sid> -f .../config.yaml
  which never matches that pattern, so the check returned false and
  triggered a restart loop.

Fix:
  - enable_mihomo=1: match "ssr-retcp.*v2ray-"
  - enable_mihomo=0: keep the original ssr-retcp.json/yaml match
  This covers both Mihomo and Xray backends and stops the false
  positive.
2026-11-27 22:13:50 +08:00
zxlhhyccc de89c71329 luci-app-ssr-plus: repair TCP-only UDP block path (setup, scope, fake-IP, rejection)
The TCP-only UDP block path (TPROXY empty, DISABLE_UDP_RULES=1) added to
tp_rule_nft() and tp_rule_iptables() has four regressions. Verified on
iptables-nft 1.8.10 / nftables 1.0.9: 52 passing, 12 failing in the
expanded matrix; all failures are TCP-only cases addressed here.

1. Setup returns 1 when OUTPUT is empty.
   The trailing `[ -n "$OUTPUT" ] && $ipt ...` evaluates false when
   OUTPUT is unset, and `return $?` propagates that false as exit
   status 1. This breaks the service's `setup &&` chain even though the
   rules were installed. Replace the trailing test with an explicit
   optional if-block so the function always reaches `return 0`.

2. Block path ignores proxy scope.
   With OUTPUT=1, both backends DROP UDP/443 even when the LAN source
   is excluded by LAN_AC_IP, the input interface is outside Interface,
   or PROXY_PORTS permits only 8443. These direct exclusions are
   honored in the relay-enabled path; keep them direct here as well so
   the block only covers traffic the proxy would otherwise handle.

3. TCP-only fake-IP UDP/443 is still forwarded directly.
   Both new filter blocks exempt 198.18.0.0/16, but TCP-only mode has
   no UDP listener or interception. The packet test reaches the
   forwarding path instead of the core or a rejection. Reject the
   fake-IP range when ENABLE_FAKE_IP=1 and UDP is not proxied.

4. Selected UDP is blocked without a prompt TCP fallback.
   The blocked selected paths do not consistently return ICMP
   port-unreachable, so the client must wait for the raw socket to
   time out before retrying over TCP. Return
   `-j REJECT --reject-with icmp-port-unreachable` on the blocked
   selected paths so the fallback is immediate.
2026-11-27 22:13:50 +08:00
zxlhhyccc 0258e24fc5 luci-app-ssr-plus: Improve dashboard panel management and add panel chooser.
This PR improves the Dashboard Update section in luci-app-ssr-plus:

- Refactor dashboard panel layout with CSS Grid for better alignment
- Add a panel chooser dialog to let users pick which panel to open
- Support dynamic panel detection based on installed directories
- Unify button fonts and styles across desktop and mobile
- Add ETag-based download caching for `update_dashboard.sh`
2026-11-27 22:13:50 +08:00
zxlhhyccc f29a519cb9 luci-app-ssr-plus: Add fake-ip mode and Fix Upload yaml config cannot use external DNS resolution. 2026-11-27 22:13:49 +08:00
zxlhhyccc 4f7eaaf740 luci-app-ssr-plus: adjust Mihomo node alias naming. 2026-11-27 22:09:53 +08:00
zxlhhyccc 1616f98d9e luci-app-ssr-plus: fix(shadow-tls): normalize SIP003 plugin_opts across LuCI and ss parser
- priority: prefer ?shadow-tls=<base64(JSON)> over ?plugin=... when both present
- plugin branch: rewrite shadow-tls opts from non-standard
  `password=xxx;version=N` to SIP003 `passwd=xxx;vN=1`
- shadow-tls branch: accept passwd/password/pwd/pass as password key,
  strip optional v/V prefix from version, only accept positive integers
- drop version suffix when missing or invalid instead of guessing v3
- keep simple-obfs -> obfs-local mapping unchanged

Affected:
- luci-app-ssr-plus: parseSSPluginInfo() in ss:// importer
- subconverter: processData() "ss" branch (plugin / shadow-tls)

Fixes: subscription emitting `plugin=shadow-tls;host=h;password=p;version=3`
was passed verbatim to ss-rust, causing invalid `plugin_opts` and
silent startup failure of the shadow-tls plugin.
2026-11-27 21:58:57 +08:00
zxl hhyccc a8ae1e4a7e mihomo: update to 1.19.34 2026-11-22 21:07:29 +08:00
coolsnowwolf 16e05545d6 luci-app-ssr-plus: silence routine rules status checks
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-22 20:26:40 +08:00
zxlhhyccc 5c43a70865 luci-app-ssr-plus: replace unavailable GitHub proxy mirrors
- Replace the unavailable mirror.ghproxy.com with gh-proxy.com
- Replace the unavailable ghproxy.cc with gh-proxy.org
- Add ghproxy.link as an alternative proxy mirror
2026-11-22 20:14:05 +08:00
zxlhhyccc e2cfe66d69 luci-app-ssr-plus: fix component page dispatch
Use `form()` instead of `cbi()` to dispatch the component page,
which returns a `SimpleForm` model.
2026-11-22 14:50:49 +08:00
zxlhhyccc 8134e2fff2 luci-app-ssr-plus: add IDN domain handling in gfw2ipset
- Convert internationalized domains to Punycode using idn2
- Skip non-ASCII domains when idn2 is unavailable to prevent dnsmasq startup failures
- Normalize domain list entries by removing CRLF, inline comments and whitespace
- Process all blacklist, whitelist and denylist entries before generating dnsmasq rules
- Apply normalized domains to GFW list and adblock filtering
- Log IDN2 conversion status and skipped domains
2026-11-21 14:38:02 +08:00
zxlhhyccc 260ff84a43 luci-app-ssr-plus: fix Makefile dependency drift
Several declarations had drifted out of sync with the Kconfig options
defined in Package/.../config:

  - CONFIG_PACKAGE_..._INCLUDE_GeoData was missing from
    PKG_CONFIG_DEPENDS, so toggling it did not trigger a rebuild
  - INCLUDE_Http_Proxy, INCLUDE_Mihomo, INCLUDE_GeoData and
    INCLUDE_Xray only used select, leaving the corresponding package
    behind when the option is turned off. Mirror them in LUCI_DEPENDS
    as +PACKAGE_...:pkg so the dependency is released cleanly.
2026-11-21 14:34:03 +08:00
coolsnowwolf 67449c6593 luci-app-ssr-plus: guard runtime selections when the package is disabled
Feature choices otherwise select runtime packages even when luci-app-ssr-plus is disabled. Condition external package selections on the parent package while leaving internal feature selects unchanged to avoid dependency cycles.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-20 12:17:48 +08:00
coolsnowwolf e825742c1e luci-app-ssr-plus: select coreutils for timeout dependency
Select the coreutils parent package explicitly so the timeout dependency does not hide SSR Plus in menuconfig.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-17 21:07:24 +08:00
coolsnowwolf c9525e6912 luci-app-ssr-plus: bump version to v198.5 v198.5 2026-11-17 13:19:22 +08:00
coolsnowwolf fa29e87710 xray-core: allow Cronet archive linker flag in cgo
Allow the exact -l:libcronet.a flag when Naive outbound is enabled to fix builds with Go 1.27.4. Bump the package release.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-17 13:18:18 +08:00
coolsnowwolf 6fbc9f563c luci-app-ssr-plus: default to Xray and require timeout for all cores
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
v198.4
2026-11-13 11:16:43 +08:00
coolsnowwolf 3e6fcaa375 xray-core: update to 26.11.9 and refresh patches
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-13 10:41:32 +08:00
coolsnowwolf e8efa31ae4 xray-core: disable cronet build when in non-x64 host os 2026-11-10 10:08:59 +08:00
coolsnowwolf 425d4805ef luci-app-ssr-plus: remove NaiveProxy component updater
Remove the unsupported NaiveProxy online update option, controller support, helper functions, and related translations.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-08 11:34:14 +08:00
zxl hhyccc c4a72267ce luci-app-ssr-plus: fix(clash): fix YAML generation defects for xhttp-opts. 2026-11-07 10:32:15 +08:00
coolsnowwolf 81c6320d40 luci-app-ssr-plus: bump version to v198.3 v198.3 2026-11-04 18:55:30 +08:00
zxl hhyccc c66d5d3fbf naiveproxy: update to 154.0.8037.49-5 2026-11-03 23:40:07 +08:00
zxlhhyccc 8b632b586c luci-app-ssr-plus: add MASQUE support (Xray) 2026-11-03 21:32:20 +08:00
coolsnowwolf b130d224e0 mihomo: fix source mirror hash to avoid repeated rebuilds
Use the SHA256 of the v1.19.33 archive generated by the OpenWrt download helper with the standard build umask. The previous hash caused cached downloads to be deleted and recreated on every build, invalidating the prepare and compile stamps.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-03 15:02:50 +08:00
coolsnowwolf 04fe559424 xray-core: update to 26.10.31 and harden EIP93 backend fallback
Refresh the TUIC and Kcptun dependency contexts against the new archive. Try the Linux 7.3 GHASH library backend after any legacy bind error and cover backend selection with ARM64 regression tests.

Validated zero-fuzz/zero-offset patch replay, protocol regressions, ARM64 QEMU GCM tests, and the ARM64 OpenWrt Naive/Cronet package build and UPX integrity.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-11-01 00:53:31 +08:00
coolsnowwolf aaef491041 mihomo: bump to 1.19.33 and support Linux 7.3 EIP93
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-31 12:40:16 +08:00
coolsnowwolf 41959d166f xray-core: update to 26.10.29 and refresh patches
Synchronize the validated packages feed update, retaining Naive/Cronet, the local protocol integrations and both EIP93 GHASH backends.

Validated the independent ARM64 package build and UPX integrity, plus a packaged AES-256-GCM transfer on AN7581 Linux 7.3 with hardware interrupts increasing only when acceleration is enabled.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-31 00:20:20 +08:00
coolsnowwolf 09afd16261 xray-core: support legacy and library GHASH EIP93 backends
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-29 21:23:25 +08:00
zxlhhyccc 31b180df83 luci-app-ssr-plus: fix layer order of mkcp-legacy entries in Xray finalmask
Xray 260601+ expects finalmask.udp to be ordered from the innermost
layer to the outermost. The KCP branch built the list as:

  udp[1] = header  (mkcp-legacy, settings.header = ...)
  udp[2] = seed    (mkcp-legacy, settings.value  = ...)

so the header was treated as the inner layer and the seed as the
outer one. Swap the two so the seed/security entry is appended
first and the header entry second:

  udp[1] = seed    (innermost)
  udp[2] = header  (outermost)

Entry contents are unchanged; only their order in finalmask.udp is
adjusted. The old-format branch for Xray < 260601 keeps its existing
order.
2026-10-25 10:57:08 +08:00
coolsnowwolf 20756eaad8 xray-core,mihomo: reuse UPX binaries during packaging
Compress a separate binary during Build/Install under the .built stamp and only copy it during Package/install. Forced IPK regeneration reuses the compressed binaries without invoking UPX; AArch64 integrity and QEMU version checks pass.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-25 00:44:18 +08:00
zxlhhyccc 652714ba38 luci-app-ssr-plus: add Hysteria2 realm UPnP option and Xray 260601+ KCP support
Hysteria2:
  Add a "hysteria2_realm_upnp" flag in the LuCI node config, shown only
  when hysteria2_realms is enabled. When set to 1, the generated config
  asks Xray to map the realm port on the gateway via UPnP/NAT-PMP,
  improving hole-punching success behind NAT.

KCP:
  Xray 260601 and later renamed the finalmask KCP entries and moved the
  header/seed into "mkcp-legacy" with settings.header / settings.value.
  Teach gen_config.lua to emit the new format when
  xray_version_val >= 260601, while keeping the old
  header-srtp / mkcp-original / mkcp-aes128gcm form for older cores.

  New-format mapping:
    none         -> (no header entry)
    srtp         -> header = "srtp"
    utp          -> header = "utp"
    wechat-video -> header = "wechat"
    dtls         -> header = "dtls"
    wireguard    -> header = "wireguard"
    dns          -> header = "dns" (+ value = kcp_domain)
  A trailing { type = "mkcp-legacy" } entry is always emitted, carrying
  settings.value = seed when a seed is configured.
2026-10-24 21:27:44 +08:00
zxl hhyccc 69840fb577 luci-app-ssr-plus: fix builtin DNS detection for v2ray nodes.
Problem:
  With pdnsd_enable=7 on a v2ray node, ssr-monitor kept logging
  "builtin dns error.restart!" and restarting the service every 30
  seconds.

Cause:
  is_builtin_dns_active() only accepted a process command line
  matching "$TMP_PATH/.*ssr-retcp\.(json|yaml)". When the node runs
  on Mihomo (server_subscribe.enable_mihomo=1), the actual command
  line is:
    /var/etc/ssrplus/bin/ssr-retcp -d .../v2ray-<sid> -f .../config.yaml
  which never matches that pattern, so the check returned false and
  triggered a restart loop.

Fix:
  - enable_mihomo=1: match "ssr-retcp.*v2ray-"
  - enable_mihomo=0: keep the original ssr-retcp.json/yaml match
  This covers both Mihomo and Xray backends and stops the false
  positive.
2026-10-24 19:57:46 +08:00
coolsnowwolf 9213963c6a mihomo: add automatic AN7581 EIP93 hybrid AES-GCM acceleration
Port Xray's private Go overlay with DT/CPU/FIPS guards, per-key verification,
bounded AF_ALG sockets, authentication checks and software fallback. Keep
AN7583 and other platforms on their existing crypto path. MIHOMO_EIP93=off
provides an explicit opt-out.

Use .go.in templates so recursive package discovery does not compile the
standard-library overlay files as application packages. Bump release to 3
and document the pristine/patched interoperability results.

Built the ARM64 OpenWrt package with Go 1.27.1. On Nokia XG-040G-MD BSP 5.4,
the hardware GCM and Go cipher regressions pass. Pristine and accelerated
Mihomo exchanged client/server roles for Shadowsocks AES-256-GCM and
Shadowsocks 2022, with 16 bidirectional SHA256 checks, hardware IRQ evidence
and off-switch controls. Classic Shadowsocks improved from about 34/33 to
146-149/100-110 Mbps (router send/receive).

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-22 23:56:02 +08:00
zxlhhyccc c2a6340e35 luci-app-ssr-plus: normalize whitespace and indentation
- Remove extra blank lines between statements
- Align indentation with surrounding code
- No functional change
2026-10-22 20:38:50 +08:00
coolsnowwolf 45893d7787 luci-app-ssr-plus: bump version to v198.2 v198.2 2026-10-22 11:38:30 +08:00
coolsnowwolf bb3bf448f4 xray-core: use selected Go toolchain for ARM64 EIP93 overlay
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-22 10:48:20 +08:00
coolsnowwolf 676e99c921 xray-core: document distinct Airoha EIP93 kernel package
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-22 10:36:44 +08:00
coolsnowwolf 80d7bfff62 luci-app-ssr-plus: bump version to v198.1 2026-10-22 02:02:50 +08:00
coolsnowwolf 854782053b xray-core: update to 26.10.21 and accelerate AN7581 AES-GCM
Refresh the existing patch stack and repair the TLS protobuf descriptor. Add a private Go overlay using AF_ALG EIP93 CTR with software GHASH, gated by AN7581 DT identity, with per-key verification and software fallback.

Validate zero-fuzz patch replay, configuration and crypto tests, the ARM64 Cronet package build and alternating ordinary/optimized client-server transfers. Document 3-4x bulk throughput gains and exclude AN7583 pending separate measurements.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-22 01:47:19 +08:00
coolsnowwolf b87e1d602a ci: fix Cronet linker selection and SDK configuration cycle
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-22 00:46:18 +08:00
coolsnowwolf 4e4dee0c06 ci: fix Xray preparation and require complete release builds
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 21:58:58 +08:00
coolsnowwolf f68187146e xray-core: add Kcptun transport and LuCI settings
Add Mihomo-compatible Kcptun inbound and outbound in protocol patch 180,
with cipher selection, FEC, Snappy compression, smux v1/v2, per-outbound
connection pools, expiration and lifecycle cleanup. Expose Kcptun as a
separate transport from mKCP and preserve Xray socket/gateway handling.

Add native Kcptun settings to LuCI and retain Xray for these nodes. Only
route UDP through Kcptun when the inner VMess/VLESS/Trojan protocol carries
it over the stream. Bump xray-core to release 9 and LuCI to 197-3.

Validate 99 bidirectional Xray/Mihomo traffic groups on the final static
artifact, loss/reordering/FEC tests, IPv6, pool expiry, invalid settings,
lifecycle race tests, LuCI generation and existing protocol regressions.
Replay all patches with fuzz=0; build static musl and MIPSLE artifacts.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 12:41:17 +08:00
coolsnowwolf a8d8c74d9c xray-core: add ShadowTLS transport and LuCI configuration
Port Mihomo v1.19.32 ShadowTLS v1/v2/v3 inbound and outbound as RAW/TCP
security in patch 170. Include verified TLS/uTLS clients, handshake timeouts,
v3 users, SNI-selected handshake endpoints and unauthenticated fallback.
Expose native Xray ShadowTLS settings in LuCI and retain Xray for these nodes.
Bump xray-core release to 8 and LuCI release to 197-2. Correct the AnyTLS and
ShadowsocksR patch sign-offs to coolsnowwolf.

Validated Xray/Mihomo bidirectional TCP and encapsulated UDP traffic with
VLESS, Shadowsocks and Trojan, negative authentication/trust cases, race
checks, zero-fuzz patch replay, static musl build, MIPSLE build, generated
LuCI configs and existing protocol regressions. V2 TLS 1.3 session-ticket
instability also reproduces with unmodified Mihomo; v3 is the default.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 12:17:29 +08:00
coolsnowwolf 12b7dd50d5 luci-app-ssr-plus: bump to 197 and disable legacy package defaults
Default ShadowsocksR Libev client and ChinaDNS-NG to disabled. Keep SSR server disabled by default and reset the package release to 1.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 11:56:39 +08:00
coolsnowwolf 63a8904fbb xray-core: add ShadowsocksR inbound and consolidate protocol patch
Merge server authentication, obfuscation, TCP and native UDP routing into renamed 140-add-shadowsocksr-proxy.patch. Add the Xray SSR server to LuCI and validate Mihomo-to-Xray interoperability plus Xray-to-reference-server regressions.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 11:50:50 +08:00
coolsnowwolf a97080214e xray-core: add AnyTLS inbound and consolidate protocol patch
Merge inbound support into renamed 110-add-anytls-proxy.patch and expose the TLS server in LuCI. Validate bidirectional TCP/UDP interoperability with Mihomo v1.19.32, session reuse, authentication failures and existing protocol regressions.

Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 10:47:38 +08:00
coolsnowwolf 092886c665 xray-core: add Mihomo Snell support and LuCI integration
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 10:31:53 +08:00
coolsnowwolf 2a70c30fd8 xray-core: add Mihomo TUIC v4/v5 support and LuCI integration
Signed-off-by: coolsnowwolf <coolsnowwolf@gmail.com>
2026-10-21 10:07:57 +08:00