Compare commits

...

2 Commits

Author SHA1 Message Date
gitea-action
4e12fc10d8 nikki: sync upstream
last commit: 057ddba280
2025-04-14 18:00:27 +08:00
gitea-action
4c56bf1d9a luci-app-nikki: sync upstream
last commit: 057ddba280
2025-04-14 18:00:27 +08:00
3 changed files with 122 additions and 26 deletions

View File

@ -67,7 +67,7 @@ const methods = {
},
debug: {
call: function() {
const success = system('/etc/nikki/scripts/debug.sh > /var/log/nikki/debug.log') == 0;
const success = system('/etc/nikki/scripts/debug.sh > /var/log/nikki/debug.log 2>&1') == 0;
return { success: success };
}
}

View File

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

View File

@ -1,15 +1,29 @@
#!/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 \
"
# Nikki Debug Info
## system
\`\`\`shell
$(cat /etc/openwrt_release)
`
cat /etc/openwrt_release
`
\`\`\`
## kernel
\`\`\`
$(uname -a)
`
uname -a
`
\`\`\`
## application
\`\`\`
@ -24,50 +38,132 @@ fi
`
\`\`\`
## config
\`\`\`
$(uci show nikki)
\`\`\`json
`
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
\`\`\`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 list)
`
ip rule list
`
\`\`\`
## ip route
\`\`\`
TPROXY:
$(ip route list table 80)
`
ip route list table "$TPROXY_ROUTE_TABLE"
`
TUN:
$(ip route list table 81)
`
ip route list table "$TUN_ROUTE_TABLE"
`
\`\`\`
## ip6 rule
\`\`\`
$(ip -6 rule list)
`
ip -6 rule list
`
\`\`\`
## ip6 route
\`\`\`
TPROXY:
$(ip -6 route list table 80)
`
ip -6 route list table "$TPROXY_ROUTE_TABLE"
`
TUN:
$(ip -6 route list table 81)
`
ip -6 route list table "$TUN_ROUTE_TABLE"
`
\`\`\`
## nftables
\`\`\`
$(nft list ruleset)
`
nft list table inet nikki
`
\`\`\`
## service
\`\`\`json
$(service nikki info)
\`\`\`
## process
\`\`\`
$(ps | grep mihomo)
\`\`\`
## netstat
\`\`\`
$(netstat -nalp | grep mihomo)
`
/etc/init.d/nikki info
`
\`\`\`
"
if [ "$enabled" == "0" ]; then
uci set nikki.config.enabled=0
uci commit nikki
/etc/init.d/nikki restart
fi