mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 11:13:56 +08:00
🔥 Sync 2026-10-21 04:32:45
This commit is contained in:
1 parent
ea52e0d497
commit
6a9f4a92f2
14 files changed
+196
-69
No files matched your search
+2
-2
@@ -5,8 +5,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gately
|
||||
PKG_VERSION:=0.5.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.5.3
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/wangwanjie/gately/tar.gz/v$(PKG_VERSION)?
|
||||
|
||||
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-daede
|
||||
PKG_VERSION:=1.15
|
||||
PKG_RELEASE:=52
|
||||
PKG_RELEASE:=53
|
||||
PKG_MAINTAINER:=kenzok8
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ const HEALTH_PATHS = {
|
||||
btfDetached: '/usr/lib/debug/boot/vmlinux',
|
||||
netns: '/run/netns/daens'
|
||||
};
|
||||
const INDEX_STATUS_PATH = '/tmp/luci-app-daede.idx.status';
|
||||
let indexStartFailed = false;
|
||||
|
||||
const CSS = [
|
||||
'.dd-up-wrap{padding:6px 0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif}',
|
||||
@@ -122,10 +124,19 @@ function probeFile(path) {
|
||||
|
||||
function probePkg(pkg) {
|
||||
return fs.exec('/usr/share/luci-app-daede/pkg-info.sh', [pkg]).then(function(res) {
|
||||
if (res.code !== 0) throw new Error('package probe failed');
|
||||
const out = (res.stdout || '').replace(/[\r\n]+$/, '').split('\t');
|
||||
return { installed: out[0] || '', latest: out[1] || '' };
|
||||
return { installed: out[0] || '', latest: out[1] || '', state: out[2] || 'absent' };
|
||||
}).catch(function() {
|
||||
return { installed: '', latest: '' };
|
||||
return { installed: '', latest: '', state: 'error' };
|
||||
});
|
||||
}
|
||||
|
||||
function probeIndex() {
|
||||
if (indexStartFailed) return Promise.resolve('failed');
|
||||
return L.resolveDefault(fs.read_direct(INDEX_STATUS_PATH, 'text'), '').then(function(out) {
|
||||
const state = String(out).trim();
|
||||
return state === 'success' || state === 'failed' ? state : 'running';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,14 +148,16 @@ function stamp() {
|
||||
|
||||
return view.extend({
|
||||
load: function() {
|
||||
// background apk update so new versions show on next poll
|
||||
fs.exec('/usr/share/luci-app-daede/refresh-index.sh', []).catch(function() {});
|
||||
// The script starts a background refresh and returns after writing its state.
|
||||
return Promise.all([
|
||||
fs.exec('/usr/share/luci-app-daede/refresh-index.sh', []).then(function(res) {
|
||||
indexStartFailed = res.code !== 0;
|
||||
}).catch(function() { indexStartFailed = true; }),
|
||||
backend.detectBackend(),
|
||||
uci.load('daed').catch(function() {}),
|
||||
uci.load('daede').catch(function() {})
|
||||
]).then(function(r) {
|
||||
return r[0];
|
||||
return r[1];
|
||||
});
|
||||
},
|
||||
|
||||
@@ -342,6 +355,7 @@ return view.extend({
|
||||
probes.push(probePkg(pkg));
|
||||
});
|
||||
probes.push(probePkg('luci-app-daede'));
|
||||
probes.push(probeIndex());
|
||||
|
||||
if (ctx.backend.useNetns)
|
||||
probes.push(probeFile(HEALTH_PATHS.netns));
|
||||
@@ -354,7 +368,8 @@ return view.extend({
|
||||
coreInfo[pkg] = r[pkgOffset + i];
|
||||
});
|
||||
const luci = r[pkgOffset + corePkgs.length];
|
||||
const ns = r[pkgOffset + corePkgs.length + 1];
|
||||
const indexState = r[pkgOffset + corePkgs.length + 1];
|
||||
const ns = r[pkgOffset + corePkgs.length + 2];
|
||||
|
||||
// data rows
|
||||
while (dataBody.firstChild) dataBody.removeChild(dataBody.firstChild);
|
||||
@@ -391,26 +406,36 @@ return view.extend({
|
||||
// a stale compile-jell build) must never be offered as an upgrade.
|
||||
const cmp = (entry.r.installed && entry.r.latest)
|
||||
? cmpVer(entry.r.latest, entry.r.installed) : null;
|
||||
const updatable = cmp !== null && cmp > 0;
|
||||
const updatable = indexState === 'success' && cmp !== null && cmp > 0;
|
||||
let meta;
|
||||
if (!entry.r.installed) {
|
||||
meta = _('not installed via package manager');
|
||||
meta = entry.r.state === 'manual' ? _('not installed via package manager')
|
||||
: entry.r.state === 'foreign' ? _('unsupported package version')
|
||||
: entry.r.state === 'error' ? _('package status unavailable') : _('Not installed');
|
||||
btn.disabled = true;
|
||||
btn.textContent = _('Unavailable');
|
||||
} else if (indexState === 'failed') {
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('package index refresh failed');
|
||||
btn.disabled = true;
|
||||
} else if (indexState !== 'success') {
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('refreshing package indexes');
|
||||
btn.disabled = true;
|
||||
} else if (!entry.r.latest) {
|
||||
// latest unknown (registry unreachable) - nothing to upgrade to
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('latest version unknown');
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('package not found in configured feeds');
|
||||
btn.disabled = true;
|
||||
} else if (updatable) {
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' → ' + _('latest') + ': ' + entry.r.latest;
|
||||
} else if (cmp < 0) {
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('feed version older: %s').format(entry.r.latest);
|
||||
btn.disabled = true;
|
||||
} else {
|
||||
// installed >= feed: already up to date (feed may even be older)
|
||||
meta = _('installed') + ': ' + entry.r.installed + ' · ' + _('up to date');
|
||||
btn.disabled = true;
|
||||
}
|
||||
const uncertain = entry.r.installed && (indexState !== 'success' || !entry.r.latest || cmp < 0);
|
||||
pkgBody.appendChild(mkRow(
|
||||
updatable ? '↑' : (entry.r.installed ? '✓' : '✗'),
|
||||
updatable ? 'dd-up-new' : (entry.r.installed ? 'dd-up-ok' : 'dd-up-err'),
|
||||
updatable ? '↑' : (uncertain ? '⚠' : (entry.r.installed ? '✓' : '✗')),
|
||||
updatable ? 'dd-up-new' : (uncertain ? 'dd-up-warn' : (entry.r.installed ? 'dd-up-ok' : 'dd-up-err')),
|
||||
entry.name,
|
||||
meta,
|
||||
btn
|
||||
|
||||
@@ -314,6 +314,24 @@ msgstr "已是最新"
|
||||
msgid "not installed via package manager"
|
||||
msgstr "非包管理器安装"
|
||||
|
||||
msgid "unsupported package version"
|
||||
msgstr "已安装其他版本,无法在此升级"
|
||||
|
||||
msgid "package status unavailable"
|
||||
msgstr "软件包状态读取失败"
|
||||
|
||||
msgid "package index refresh failed"
|
||||
msgstr "软件源刷新失败,请检查网络和软件源"
|
||||
|
||||
msgid "refreshing package indexes"
|
||||
msgstr "正在刷新软件源"
|
||||
|
||||
msgid "package not found in configured feeds"
|
||||
msgstr "当前软件源中没有此包"
|
||||
|
||||
msgid "feed version older: %s"
|
||||
msgstr "软件源版本较旧:%s"
|
||||
|
||||
msgid "Unavailable"
|
||||
msgstr "不可用"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
# pkg-info.sh <package>
|
||||
# Prints "<installed>\t<latest>" for the named package, where either field is
|
||||
# empty when unknown. Used by the Updates view to decide whether to enable
|
||||
# the [Upgrade] button.
|
||||
# Prints "<installed>\t<latest>\t<state>" for the named package, where either
|
||||
# version is empty when unknown. Used by the Updates view to decide whether to
|
||||
# enable the [Upgrade] button.
|
||||
|
||||
PKG="$1"
|
||||
case "$PKG" in
|
||||
@@ -12,22 +12,26 @@ esac
|
||||
|
||||
installed=""
|
||||
latest=""
|
||||
state="absent"
|
||||
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
if apk info -e "$PKG" >/dev/null 2>&1; then
|
||||
state="managed"
|
||||
installed=$(apk list -I "$PKG" 2>/dev/null | awk -v p="$PKG" '
|
||||
$1 ~ "^" p "-" {
|
||||
$1 ~ "^" p "-[0-9]" {
|
||||
sub("^" p "-", "", $1);
|
||||
print $1;
|
||||
exit
|
||||
}
|
||||
')
|
||||
[ -n "$installed" ] || state="error"
|
||||
fi
|
||||
# apk search treats ^ and $ as literal chars (not regex anchors), so the old
|
||||
# `apk search "^pkg$"` matched nothing. Enumerate the exact-name package
|
||||
# across all feeds via `apk list` and take the highest version. Restricting
|
||||
# to "<pkg>-<digit>" avoids sibling names like <pkg>-geoip / luci-app-<pkg>.
|
||||
latest=$(apk list "$PKG" 2>/dev/null | awk -v p="$PKG" '
|
||||
# across configured feeds via `apk list -a` and take the highest version.
|
||||
# The -a flag excludes locally installed packages that are absent from feeds.
|
||||
# Restricting to "<pkg>-<digit>" avoids sibling names like <pkg>-geoip.
|
||||
latest=$(apk list -a "$PKG" 2>/dev/null | awk -v p="$PKG" '
|
||||
$1 ~ "^" p "-[0-9]" {
|
||||
v = $1; sub("^" p "-", "", v);
|
||||
print v
|
||||
@@ -36,15 +40,22 @@ if command -v apk >/dev/null 2>&1; then
|
||||
elif command -v opkg >/dev/null 2>&1; then
|
||||
installed=$(opkg status "$PKG" 2>/dev/null | awk -F': ' '$1=="Version"{print $2; exit}')
|
||||
latest=$(opkg info "$PKG" 2>/dev/null | awk -F': ' '$1=="Version"{print $2; exit}')
|
||||
[ -n "$installed" ] && state="managed"
|
||||
fi
|
||||
|
||||
case "$PKG" in
|
||||
dae|daed)
|
||||
case "$installed" in
|
||||
20[0-9][0-9].[0-9]*) ;;
|
||||
*) installed="" ;;
|
||||
*) [ -n "$installed" ] && state="foreign"; installed="" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
printf '%s\t%s\n' "$installed" "$latest"
|
||||
if [ "$state" = "absent" ]; then
|
||||
case "$PKG" in
|
||||
dae|daed) [ -x "/usr/bin/$PKG" ] && state="manual" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
printf '%s\t%s\t%s\n' "$installed" "$latest" "$state"
|
||||
@@ -2,20 +2,39 @@
|
||||
# Background apk/opkg update for the Updates view. Returns at once; throttled.
|
||||
|
||||
LOCK=/tmp/luci-app-daede.idx.lock
|
||||
STATUS=/tmp/luci-app-daede.idx.status
|
||||
LOG=/tmp/luci-app-daede.idx.log
|
||||
|
||||
if [ -f "$LOCK" ]; then
|
||||
write_status() {
|
||||
printf '%s\n' "$1" > "${STATUS}.$$" && mv "${STATUS}.$$" "$STATUS"
|
||||
}
|
||||
|
||||
if [ -f "$LOCK" ] && [ -f "$STATUS" ]; then
|
||||
mtime=$(date -r "$LOCK" +%s 2>/dev/null || echo 0)
|
||||
[ "$(( $(date +%s) - mtime ))" -lt 90 ] && exit 0
|
||||
fi
|
||||
: > "$LOCK"
|
||||
write_status running
|
||||
|
||||
(
|
||||
# -n: skip if a package op holds the shared apk lock (no need to refresh then)
|
||||
flock -n 9 || exit 0
|
||||
umask 077
|
||||
# Wait for package upgrades before refreshing the same apk database.
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
flock -n /tmp/luci-app-daede.apk.lock apk update
|
||||
flock /tmp/luci-app-daede.apk.lock apk update > "$LOG" 2>&1
|
||||
rc=$?
|
||||
elif command -v opkg >/dev/null 2>&1; then
|
||||
opkg update
|
||||
opkg update > "$LOG" 2>&1
|
||||
rc=$?
|
||||
else
|
||||
printf '%s\n' 'No supported package manager' > "$LOG"
|
||||
rc=127
|
||||
fi
|
||||
) >/dev/null 2>&1 </dev/null &
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
write_status success
|
||||
else
|
||||
write_status failed
|
||||
fi
|
||||
) 9>/tmp/luci-app-daede.idx.run.lock >/dev/null 2>&1 </dev/null &
|
||||
|
||||
exit 0
|
||||
@@ -50,15 +50,27 @@ fi
|
||||
if command -v apk >/dev/null 2>&1; then
|
||||
# shared apk lock with the bg index refresh (avoid "Unable to lock database")
|
||||
(
|
||||
flock 9
|
||||
apk update 2>&1
|
||||
ver=$(apk list "$PKG" 2>/dev/null | awk -v p="$PKG" '$1 ~ "^" p "-[0-9]" { v=$1; sub("^" p "-", "", v); print v }' | sort -V | tail -1)
|
||||
flock 9 || exit 1
|
||||
if ! apk info -e "$PKG" >/dev/null 2>&1; then
|
||||
echo "result: $PKG 未通过包管理器安装,不能在线升级"
|
||||
exit 1
|
||||
fi
|
||||
if ! apk update 2>&1; then
|
||||
echo "result: 软件源刷新失败,请检查网络和软件源配置"
|
||||
exit 1
|
||||
fi
|
||||
ver=$(apk list -a "$PKG" 2>/dev/null | awk -v p="$PKG" '$1 ~ "^" p "-[0-9]" { v=$1; sub("^" p "-", "", v); print v }' | sort -V | tail -1)
|
||||
if [ -n "$ver" ]; then
|
||||
constraint="$PKG=$ver"
|
||||
else
|
||||
echo "result: 软件源中没有找到 $PKG,请检查网络或软件源配置"
|
||||
exit 1
|
||||
fi
|
||||
installed=$(apk list -I "$PKG" 2>/dev/null | awk -v p="$PKG" '$1 ~ "^" p "-[0-9]" { v=$1; sub("^" p "-", "", v); print v; exit }')
|
||||
if [ -n "$installed" ] && [ "$(printf '%s\n%s\n' "$ver" "$installed" | sort -V | tail -1)" = "$installed" ]; then
|
||||
echo "result: $PKG 已安装版本不低于软件源版本,无需升级"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "--- apk add -s $constraint ---"
|
||||
if ! apk add -s "$constraint" 2>&1; then
|
||||
@@ -66,14 +78,19 @@ fi
|
||||
fi
|
||||
echo "--- apk add $constraint ---"
|
||||
apk add "$constraint" 2>&1
|
||||
add_rc=$?
|
||||
[ "$add_rc" -eq 0 ] || exit 1
|
||||
if ! apk list -I "$PKG" 2>/dev/null | awk -v p="$PKG" -v v="$ver" '$1 == p "-" v { found = 1 } END { exit !found }'; then
|
||||
echo "result: $PKG was not upgraded to $ver"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
) 9>/tmp/luci-app-daede.apk.lock
|
||||
rc=$?
|
||||
if [ "$rc" != 0 ]; then
|
||||
if [ "$rc" = 2 ]; then
|
||||
:
|
||||
elif [ "$rc" != 0 ]; then
|
||||
:
|
||||
elif ! apk list --installed 2>/dev/null | grep -q "^${PKG}-"; then
|
||||
echo "result: $PKG is not installed"
|
||||
rc=1
|
||||
elif apk list -u 2>/dev/null | grep -q "^${PKG}-"; then
|
||||
echo "result: $PKG still has a pending upgrade"
|
||||
rc=1
|
||||
@@ -83,16 +100,26 @@ fi
|
||||
fi
|
||||
elif command -v opkg >/dev/null 2>&1; then
|
||||
echo "--- opkg update ---"
|
||||
opkg update 2>&1
|
||||
echo "--- opkg upgrade $PKG ---"
|
||||
opkg upgrade "$PKG" 2>&1
|
||||
rc=$?
|
||||
if opkg update 2>&1; then
|
||||
echo "--- opkg upgrade $PKG ---"
|
||||
opkg upgrade "$PKG" 2>&1
|
||||
rc=$?
|
||||
else
|
||||
echo "result: 软件源刷新失败,请检查网络和软件源配置"
|
||||
rc=1
|
||||
fi
|
||||
else
|
||||
echo "no package manager found"
|
||||
exit 3
|
||||
rc=3
|
||||
fi
|
||||
|
||||
if [ "$rc" = 0 ]; then echo "$(date '+%F %T') ✓ 完成"; else echo "$(date '+%F %T') ✗ 失败 (rc=$rc)"; fi
|
||||
if [ "$rc" = 0 ]; then
|
||||
echo "$(date '+%F %T') ✓ 完成"
|
||||
elif [ "$rc" = 2 ]; then
|
||||
echo "$(date '+%F %T') ✓ 无需升级"
|
||||
else
|
||||
echo "$(date '+%F %T') ✗ 失败 (rc=$rc)"
|
||||
fi
|
||||
|
||||
# luci-app-daede upgrade replaces ACL JSON — reload rpcd so changes apply.
|
||||
if [ "$PKG" = "luci-app-daede" ] && [ "$rc" = "0" ]; then
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"/tmp/luci-app-daede.pkg-dae.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.pkg-daed.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.pkg-luci-app-daede.log": [ "read" ],
|
||||
"/tmp/luci-app-daede.idx.status": [ "read" ],
|
||||
"/tmp/luci-app-daede.backup.log": [ "read" ],
|
||||
"/bin/pidof dae": [ "exec" ],
|
||||
"/bin/pidof daed": [ "exec" ],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-open-box
|
||||
PKG_VERSION:=0.1.341
|
||||
PKG_RELEASE:=37
|
||||
PKG_VERSION:=0.1.342
|
||||
PKG_RELEASE:=38
|
||||
|
||||
PKG_MAINTAINER:=liandu2024
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
|
||||
@@ -4,7 +4,7 @@ LUCI_TITLE:=luci-app-ssr-plus
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=196
|
||||
PKG_RELEASE:=92
|
||||
PKG_RELEASE:=93
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \
|
||||
|
||||
@@ -473,6 +473,7 @@ o:value("shadowsocks", translate("ShadowSocks"))
|
||||
if is_finded("xray") then
|
||||
o:value("wireguard", translate("WireGuard"))
|
||||
o:value("naive", "NaiveProxy (Xray / Cronet)")
|
||||
o:value("shadowsocksr", "ShadowsocksR (Xray)")
|
||||
end
|
||||
if is_finded("xray") then
|
||||
o:value("hysteria2", translate("Hysteria2"))
|
||||
@@ -565,6 +566,7 @@ o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "trojan"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "anytls"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "naive"})
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
for _, field in ipairs({
|
||||
{"anytls_idle_session_check_interval", "Idle session check interval (seconds)", "30"},
|
||||
@@ -665,6 +667,7 @@ o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "protocol_param", translate("Protocol param (optional)"))
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("Obfs"))
|
||||
for _, v in ipairs(obfs) do
|
||||
@@ -675,7 +678,20 @@ o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param (optional)"))
|
||||
o:depends("type", "ssr")
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
|
||||
-- Xray uses Mihomo's SSR registry, which differs from legacy libev.
|
||||
for _, field in ipairs({
|
||||
{"ssr_method", "Encrypt Method", {"aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "rc4-md5", "chacha20", "chacha20-ietf", "xchacha20", "none"}},
|
||||
{"ssr_protocol", "Protocol", {"origin", "auth_sha1_v4", "auth_aes128_md5", "auth_aes128_sha1", "auth_chain_a", "auth_chain_b"}},
|
||||
{"ssr_obfs", "Obfs", {"plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth", "tls1.2_ticket_fastauth"}}
|
||||
}) do
|
||||
o = s:option(ListValue, field[1], translate(field[2]))
|
||||
for _, value in ipairs(field[3]) do o:value(value) end
|
||||
o.default = field[3][1]
|
||||
o.rmempty = false
|
||||
o:depends({type = "v2ray", v2ray_protocol = "shadowsocksr"})
|
||||
end
|
||||
|
||||
-- [[ Hysteria2 ]]--
|
||||
o = s:option(Flag, "hysteria2_realms", translate("Hysteria2 Realms"))
|
||||
@@ -1421,7 +1437,7 @@ if protocols and type(protocols) == "table" and #protocols > 0 then
|
||||
if not proto:find("^_") then
|
||||
if proto == "hysteria2" then
|
||||
o:depends({type = "v2ray", v2ray_protocol = "hysteria2", hysteria2_realms = false})
|
||||
elseif proto ~= "socks" and proto ~= "http" then
|
||||
elseif proto ~= "socks" and proto ~= "http" and proto ~= "shadowsocksr" then
|
||||
o:depends({type = "v2ray", v2ray_protocol = proto})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -992,8 +992,8 @@ use_mihomo_for_ss_rust_server() {
|
||||
}
|
||||
|
||||
start_v2ray_with_mihomo() {
|
||||
# Naive requires the Cronet-enabled Xray build. Never fall back to Mihomo.
|
||||
[ "$(uci_get_by_name "$1" v2ray_protocol)" = "naive" ] && return 1
|
||||
# These nodes use Xray-specific settings.
|
||||
case "$(uci_get_by_name "$1" v2ray_protocol)" in naive|shadowsocksr) return 1 ;; esac
|
||||
local sid="$1"
|
||||
local local_port="$2"
|
||||
local socks_port="$3"
|
||||
@@ -1798,7 +1798,7 @@ start_udp() {
|
||||
;;
|
||||
v2ray)
|
||||
enable_mihomo=$(uci_get_by_type server_subscribe enable_mihomo "")
|
||||
if [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "naive" ] && [ "$enable_mihomo" = "1" ] && has_mihomo_binary; then
|
||||
if [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "naive" ] && [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "shadowsocksr" ] && [ "$enable_mihomo" = "1" ] && has_mihomo_binary; then
|
||||
redir_udp=0
|
||||
ARG_UDP=""
|
||||
echolog "UDP TPROXY Relay:V2Ray/Xray 单节点由主 Mihomo 实例处理。"
|
||||
@@ -1811,7 +1811,7 @@ start_udp() {
|
||||
echolog "UDP TPROXY Relay:$($(first_type xray) version | head -1) Started!"
|
||||
else
|
||||
# Xray 不存在但 Mihomo 存在,回退到 Mihomo(当 enable_mihomo=0 时)
|
||||
if [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "naive" ] && has_mihomo_binary; then
|
||||
if [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "naive" ] && [ "$(uci_get_by_name "$UDP_RELAY_SERVER" v2ray_protocol)" != "shadowsocksr" ] && has_mihomo_binary; then
|
||||
redir_udp=0
|
||||
ARG_UDP=""
|
||||
echolog "UDP TPROXY Relay:Xray 内核不存在,已回退到 Mihomo 内核启动。"
|
||||
|
||||
@@ -363,6 +363,14 @@ function outbound:handleIndex(index)
|
||||
trojan = function()
|
||||
trojan_shadowsocks()
|
||||
end,
|
||||
shadowsocksr = function()
|
||||
outbound_settings = {
|
||||
address = server.server, port = tonumber(server.server_port),
|
||||
password = server.password, method = server.ssr_method or "aes-128-cfb",
|
||||
protocol = server.ssr_protocol or "origin", protocolParam = server.protocol_param,
|
||||
obfs = server.ssr_obfs or "plain", obfsParam = server.obfs_param
|
||||
}
|
||||
end,
|
||||
shadowsocks = function()
|
||||
trojan_shadowsocks()
|
||||
end,
|
||||
@@ -891,8 +899,9 @@ Xray.outbounds = {
|
||||
}
|
||||
}
|
||||
|
||||
-- Cronet owns TLS and multiplexing. Preserve Xray socket marks and dialer chains.
|
||||
if server.v2ray_protocol == "naive" then
|
||||
-- Naive owns TLS/multiplexing; SSR owns obfuscation and uses native UDP.
|
||||
-- Preserve Xray socket marks and dialer chains for both.
|
||||
if server.v2ray_protocol == "naive" or server.v2ray_protocol == "shadowsocksr" then
|
||||
local ob = Xray.outbounds[1]
|
||||
ob.streamSettings = { network = "raw", sockopt = ob.streamSettings.sockopt }
|
||||
ob.mux = nil
|
||||
|
||||
+17
-16
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018-2025 Nick Peng (pymumu@gmail.com)
|
||||
# Copyright (c) 2018-2026 Nick Peng (pymumu@gmail.com)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
@@ -7,18 +7,18 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=smartdns
|
||||
PKG_VERSION:=1.2026.48.4
|
||||
PKG_RELEASE:=6
|
||||
PKG_TAGS=1.2026.v48.4.3-canary_with_ui-canary-canary
|
||||
PKG_RELEASE:=7
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_TAGS).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_TAGS)
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/PikuZheng/smartdns/tar.gz/$(PKG_TAGS)?
|
||||
PKG_HASH:=skip
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://www.github.com/pymumu/smartdns.git
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_VERSION:=21c940edc65520849ba03544c5cf8d9cf326e680
|
||||
|
||||
SMARTDNS_WEBUI_SOURCE_URL:=https://codeload.github.com/PikuZheng/smartdns-webui/tar.gz
|
||||
SMARTDNS_WEBUI_SOURCE_VERSION:=4667a7dae18b9776576cda6c98be649703fe671a
|
||||
SMARTDNS_WEBUI_FILE:=smartdns-webui-$(SMARTDNS_WEBUI_SOURCE_VERSION).tar.gz
|
||||
SMARTDNS_WEBUI_HASH:=422c920f825b1570f76f1c7d9c2a74bf1c422fddb4f304a0fcb9a1229bc50580
|
||||
SMARTDNS_WEBUI_VERSION:=1.0.0
|
||||
SMARTDNS_WEBUI_SOURCE_PROTO:=git
|
||||
SMARTDNS_WEBUI_SOURCE_URL:=https://github.com/pymumu/smartdns-webui.git
|
||||
SMARTDNS_WEBUI_SOURCE_VERSION:=1c06fee693434ec7c71f06010d3f87416baba9f0
|
||||
SMARTDNS_WEBUI_FILE:=smartdns-webui-$(SMARTDNS_WEBUI_VERSION).tar.gz
|
||||
|
||||
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
@@ -114,18 +114,19 @@ endef
|
||||
|
||||
define Download/smartdns-webui
|
||||
FILE:=$(SMARTDNS_WEBUI_FILE)
|
||||
PROTO:=$(SMARTDNS_WEBUI_SOURCE_PROTO)
|
||||
URL:=$(SMARTDNS_WEBUI_SOURCE_URL)
|
||||
URL_FILE:=$(SMARTDNS_WEBUI_SOURCE_VERSION)
|
||||
MIRROR_HASH:=88adb092ed7b0dc22b3964249f4969870d3b462c4d924aceb18784c0f664f16e
|
||||
VERSION:=$(SMARTDNS_WEBUI_SOURCE_VERSION)
|
||||
HASH:=skip
|
||||
SUBDIR:=smartdns-webui
|
||||
endef
|
||||
$(eval $(call Download,smartdns-webui))
|
||||
|
||||
ifdef CONFIG_PACKAGE_smartdns-ui
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(INSTALL_DIR) $(PKG_BUILD_DIR)/smartdns-webui
|
||||
$(TAR) -xzf $(DL_DIR)/$(SMARTDNS_WEBUI_FILE) \
|
||||
-C $(PKG_BUILD_DIR)/smartdns-webui --strip-components=1
|
||||
$(TAR) -C $(PKG_BUILD_DIR)/ -xf $(DL_DIR)/$(SMARTDNS_WEBUI_FILE)
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -139,4 +140,4 @@ endef
|
||||
|
||||
$(eval $(call BuildPackage,smartdns))
|
||||
$(eval $(call RustBinPackage,smartdns-ui))
|
||||
$(eval $(call BuildPackage,smartdns-ui))
|
||||
$(eval $(call BuildPackage,smartdns-ui))
|
||||
Reference in new issue
Block a user