From d9bf21a8474b2635fce50a475d3eaf16f89a5b77 Mon Sep 17 00:00:00 2001 From: aaaamoooo Date: Fri, 23 Oct 2026 12:33:00 +0000 Subject: [PATCH] agent: default sing-box stats API port 10086 -> 10089 Avoids the v2ray_api listen colliding with L-UI's fixed 10086 on dual-homed nodes. NG_SINGBOX_API_PORT env still overrides. Aligns the stats-query --server default and the doctor script fallback to the same value. Agent version stays 0.6.8. --- agent-go/main.go | 2 +- agent/stats-query.go | 2 +- scripts/agent-doctor.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agent-go/main.go b/agent-go/main.go index 1fda2f2..15ec98b 100644 --- a/agent-go/main.go +++ b/agent-go/main.go @@ -82,7 +82,7 @@ func loadConfig() config { KeyFile: envOr("NG_KEY_FILE", "/etc/nexusgate/keys.json"), SessionTokenFile: envOr("NG_SESSION_TOKEN_FILE", root+"/session-token.json"), TLSDir: envOr("NG_TLS_DIR", "/etc/nexusgate/tls"), - APIPort: envOr("NG_SINGBOX_API_PORT", "10086"), + APIPort: envOr("NG_SINGBOX_API_PORT", "10089"), PollMS: int64(pollSec * 1000), } } diff --git a/agent/stats-query.go b/agent/stats-query.go index e701f94..812acf9 100644 --- a/agent/stats-query.go +++ b/agent/stats-query.go @@ -16,7 +16,7 @@ import ( ) func main() { - server := flag.String("server", "127.0.0.1:10086", "sing-box statistics API address") + server := flag.String("server", "127.0.0.1:10089", "sing-box statistics API address") flag.Parse() ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() diff --git a/scripts/agent-doctor.sh b/scripts/agent-doctor.sh index 66d5bc7..a1cb5ad 100644 --- a/scripts/agent-doctor.sh +++ b/scripts/agent-doctor.sh @@ -27,7 +27,7 @@ elif [[ -x /usr/local/bin/nexusgate-sing-box ]]; then if [[ -f /etc/nexusgate/sing-box/config.json ]]; then /usr/local/bin/nexusgate-sing-box check -c /etc/nexusgate/sing-box/config.json 2>&1 | tail -n 12 printf '入站流量统计(累计):\n' - /usr/local/bin/nexusgate-sing-box-stats --server="127.0.0.1:${NG_SINGBOX_API_PORT:-10086}" 2>&1 | head -c 900 + /usr/local/bin/nexusgate-sing-box-stats --server="127.0.0.1:${NG_SINGBOX_API_PORT:-10089}" 2>&1 | head -c 900 printf '\n' else printf '已安装,当前没有节点资源\n'