triggerHostNodeSync 在 Host 保存后自动触发相关节点的 NodeGate sync: 落地节点(https_port 影响 servers 端口)+ 前置节点(portforward 目标端口)。
(h inbounds.Host)
| 463 | // triggerHostNodeSync 在 Host 保存后自动触发相关节点的 NodeGate sync: |
| 464 | // 落地节点(https_port 影响 servers 端口)+ 前置节点(portforward 目标端口)。 |
| 465 | func (a *inboundAPI) triggerHostNodeSync(h inbounds.Host) { |
| 466 | if a.syncNode == nil { |
| 467 | return |
| 468 | } |
| 469 | triggered := make(map[string]struct{}) |
| 470 | // 落地节点 |
| 471 | if ib, err := a.store.GetInbound(h.InboundID); err == nil && ib.NodeID != "" { |
| 472 | triggered[ib.NodeID] = struct{}{} |
| 473 | a.syncNode(ib.NodeID) |
| 474 | } |
| 475 | // 前置节点 |
| 476 | if h.RelayNodeID != "" { |
| 477 | if _, done := triggered[h.RelayNodeID]; !done { |
| 478 | a.syncNode(h.RelayNodeID) |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | // trimInbound 对 Inbound 的所有字符串字段做 TrimSpace。 |
| 484 | func trimInbound(ib *inbounds.Inbound) { |
no test coverage detected