mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2026-11-19 19:34:49 +08:00
feat: Support backup for master (#9498)
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/1Panel-dev/1Panel/agent/app/api/v2/helper"
|
||||
"github.com/1Panel-dev/1Panel/agent/global"
|
||||
"github.com/1Panel-dev/1Panel/agent/utils/cmd"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -24,6 +25,12 @@ func Certificate() gin.HandlerFunc {
|
||||
helper.InternalServer(c, fmt.Errorf("err certificate"))
|
||||
return
|
||||
}
|
||||
masterProxyID := c.Request.Header.Get("Proxy-ID")
|
||||
proxyID, err := cmd.RunDefaultWithStdoutBashC("cat /etc/1panel/.nodeProxyID")
|
||||
if err == nil && len(proxyID) != 0 && proxyID != masterProxyID {
|
||||
helper.InternalServer(c, fmt.Errorf("err proxy id"))
|
||||
return
|
||||
}
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user