Revert "fix: 保留用户/规则高级设置并增强节点运行时恢复 (#468)"

This reverts commit 3f374df724.
This commit is contained in:
sagitchu
2026-04-25 22:45:27 +08:00
parent 325baa8adc
commit a5c33c68d9
30 changed files with 123 additions and 744 deletions
@@ -96,7 +96,6 @@ func TestMaxConnLimit(t *testing.T) {
"remoteAddr": "1.1.1.1:443",
"strategy": "fifo",
"maxConn": 42,
"proxyProtocol": 2,
}
body, err := json.Marshal(payload)
if err != nil {
@@ -121,47 +120,6 @@ func TestMaxConnLimit(t *testing.T) {
t.Fatalf("get forward ID: %v", err)
}
listOut := requestContractEnvelope(t, router, adminToken, "/api/v1/forward/list", nil)
if listOut.Code != 0 {
t.Fatalf("expected /forward/list success, got code=%d msg=%s", listOut.Code, listOut.Msg)
}
rows := mustContractSlice(t, listOut.Data, "forward list")
var target map[string]interface{}
for _, row := range rows {
item, ok := row.(map[string]interface{})
if !ok {
t.Fatalf("expected forward item to be object, got %T", row)
}
idVal, ok := item["id"].(float64)
if !ok {
t.Fatalf("expected forward id to be float64, got %T", item["id"])
}
if int64(idVal) == forwardID {
target = item
break
}
}
if target == nil {
t.Fatalf("forward %d not found in /forward/list response", forwardID)
}
maxConnVal, ok := target["maxConn"].(float64)
if !ok {
t.Fatalf("expected maxConn to be float64, got %T (%v)", target["maxConn"], target["maxConn"])
}
if int(maxConnVal) != 42 {
t.Fatalf("expected maxConn 42 in /forward/list, got %v", maxConnVal)
}
proxyProtocolVal, ok := target["proxyProtocol"].(float64)
if !ok {
t.Fatalf("expected proxyProtocol to be float64, got %T (%v)", target["proxyProtocol"], target["proxyProtocol"])
}
if int(proxyProtocolVal) != 2 {
t.Fatalf("expected proxyProtocol 2 in /forward/list, got %v", proxyProtocolVal)
}
commandMu.Lock()
defer commandMu.Unlock()