nikki: sync upstream

last commit: 057ddba280
This commit is contained in:
gitea-action 2025-04-14 18:00:27 +08:00
parent 4c56bf1d9a
commit 4e12fc10d8
2 changed files with 121 additions and 25 deletions

View File

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git
PKG_SOURCE_DATE:=2025-04-12 PKG_SOURCE_DATE:=2025-04-13
PKG_SOURCE_VERSION:=cedb36df5fe58d5d972b1507c1ab656aca5f046d PKG_SOURCE_VERSION:=8fa4e8122c83ec6ad2330f6115863a83ac5a042e
PKG_MIRROR_HASH:=b2f9fe4e2ebd38036eac0f2c5af79362cb2afbb780c36c236259ecace9db11da PKG_MIRROR_HASH:=9f3e790d459e8c932b4219e75b5733eb16ed92fd0a94e4860e6e1152e1c87846
PKG_LICENSE:=GPL3.0+ PKG_LICENSE:=GPL3.0+
PKG_MAINTAINER:=Joseph Mory <morytyann@gmail.com> PKG_MAINTAINER:=Joseph Mory <morytyann@gmail.com>
@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16 PKG_BUILD_FLAGS:=no-mips16
PKG_BUILD_VERSION:=alpha-cedb36d PKG_BUILD_VERSION:=alpha-8fa4e81
PKG_BUILD_TIME:=$(shell date -u -Iseconds) PKG_BUILD_TIME:=$(shell date -u -Iseconds)
GO_PKG:=github.com/metacubex/mihomo GO_PKG:=github.com/metacubex/mihomo

View File

@ -1,15 +1,29 @@
#!/bin/sh #!/bin/sh
. "$IPKG_INSTROOT/etc/nikki/scripts/include.sh"
enabled=`uci get nikki.config.enabled`
if [ "$enabled" == "0" ]; then
uci set nikki.config.enabled=1
uci commit nikki
/etc/init.d/nikki restart
fi
echo \ echo \
" "
# Nikki Debug Info # Nikki Debug Info
## system ## system
\`\`\`shell \`\`\`shell
$(cat /etc/openwrt_release) `
cat /etc/openwrt_release
`
\`\`\` \`\`\`
## kernel ## kernel
\`\`\` \`\`\`
$(uname -a) `
uname -a
`
\`\`\` \`\`\`
## application ## application
\`\`\` \`\`\`
@ -24,50 +38,132 @@ fi
` `
\`\`\` \`\`\`
## config ## config
\`\`\` \`\`\`json
$(uci show nikki) `
ubus call uci get '{"config": "nikki"}' | yq -M -P -p json -o json '
.values | to_entries | group_by(.value[".type"]) | map({"key": .[0].value[".type"], "value": [.[].value]}) | from_entries |
. |= (
del(.status) |
del(.editor) |
del(.log)
) |
.*[] |= (
del(.[".type"]) |
del(.[".name"]) |
del(.[".index"]) |
del(.[".anonymous"])
) |
.subscription[] |= .url = "*" |
.lan_access_control[] |= (
select(has("ip")) |= .ip[] |= "*" |
select(has("ip6")) |= .ip6[] |= "*" |
select(has("mac")) |= .mac[] |= "*"
)
'
`
\`\`\` \`\`\`
## profile ## profile
\`\`\`yaml \`\`\`yaml
$(cat /etc/nikki/run/config.yaml) `
yq -M -P '
. |= (
select(has("secret")) | .secret = "*" |
select(has("authentication")) | .authentication = []
) |
.proxy-providers.* |= (
select(has("url")) |= .url = "*" |
select(has("payload")) |= .payload[] |= (
select(has("server")) |= .server = "*" |
select(has("servername")) |= .servername = "*" |
select(has("sni")) |= .sni = "*" |
select(has("port")) |= .port = "*" |
select(has("ports")) |= .ports = "*" |
select(has("port-range")) |= .port-range = "*" |
select(has("uuid")) |= .uuid = "*" |
select(has("private-key")) |= .private-key = "*" |
select(has("public-key")) |= .public-key = "*" |
select(has("token")) |= .token="*" |
select(has("username")) |= .username = "*" |
select(has("password")) |= .password = "*" |
select(has("peers")) |= .peers[] |= (
select(has("server")) |= .server = "*" |
select(has("public-key")) |= .public-key = "*"
)
)
) |
.proxies[] |= (
select(has("server")) |= .server = "*" |
select(has("servername")) |= .servername = "*" |
select(has("sni")) |= .sni = "*" |
select(has("port")) |= .port = "*" |
select(has("ports")) |= .ports = "*" |
select(has("port-range")) |= .port-range = "*" |
select(has("uuid")) |= .uuid = "*" |
select(has("private-key")) |= .private-key = "*" |
select(has("public-key")) |= .public-key = "*" |
select(has("token")) |= .token="*" |
select(has("username")) |= .username = "*" |
select(has("password")) |= .password = "*" |
select(has("peers")) |= .peers[] |= (
select(has("server")) |= .server = "*" |
select(has("public-key")) |= .public-key = "*"
)
)
' < /etc/nikki/run/config.yaml
`
\`\`\` \`\`\`
## ip rule ## ip rule
\`\`\` \`\`\`
$(ip rule list) `
ip rule list
`
\`\`\` \`\`\`
## ip route ## ip route
\`\`\` \`\`\`
TPROXY: TPROXY:
$(ip route list table 80) `
ip route list table "$TPROXY_ROUTE_TABLE"
`
TUN: TUN:
$(ip route list table 81) `
ip route list table "$TUN_ROUTE_TABLE"
`
\`\`\` \`\`\`
## ip6 rule ## ip6 rule
\`\`\` \`\`\`
$(ip -6 rule list) `
ip -6 rule list
`
\`\`\` \`\`\`
## ip6 route ## ip6 route
\`\`\` \`\`\`
TPROXY: TPROXY:
$(ip -6 route list table 80) `
ip -6 route list table "$TPROXY_ROUTE_TABLE"
`
TUN: TUN:
$(ip -6 route list table 81) `
ip -6 route list table "$TUN_ROUTE_TABLE"
`
\`\`\` \`\`\`
## nftables ## nftables
\`\`\` \`\`\`
$(nft list ruleset) `
nft list table inet nikki
`
\`\`\` \`\`\`
## service ## service
\`\`\`json \`\`\`json
$(service nikki info) `
\`\`\` /etc/init.d/nikki info
## process `
\`\`\`
$(ps | grep mihomo)
\`\`\`
## netstat
\`\`\`
$(netstat -nalp | grep mihomo)
\`\`\` \`\`\`
" "
if [ "$enabled" == "0" ]; then
uci set nikki.config.enabled=0
uci commit nikki
/etc/init.d/nikki restart
fi