mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2026-11-19 19:34:49 +08:00
refactor: update agent and core utilities (#12621)
This commit is contained in:
committed by
zhengkunwang223
parent
84a27de792
commit
d55982bde0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user