refactor: update agent and core utilities (#12621)

This commit is contained in:
ssongliu
2026-04-28 11:17:30 +08:00
committed by zhengkunwang223
parent 84a27de792
commit d55982bde0
86 changed files with 1854 additions and 924 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"net"
"net/http"
"strings"
"time"
"github.com/1Panel-dev/1Panel/agent/app/api/v2/helper"
"github.com/1Panel-dev/1Panel/agent/global"
@@ -29,7 +30,7 @@ func Certificate() gin.HandlerFunc {
return
}
masterProxyID := c.Request.Header.Get("Proxy-Id")
proxyID, err := cmd.RunDefaultWithStdoutBashC("cat /etc/1panel/.nodeProxyID")
proxyID, err := cmd.NewCommandMgr(cmd.WithTimeout(20*time.Second)).RunWithStdout("cat", "/etc/1panel/.nodeProxyID")
if err == nil && len(proxyID) != 0 && strings.TrimSpace(proxyID) != strings.TrimSpace(masterProxyID) {
helper.InternalServer(c, fmt.Errorf("err proxy id"))
return