feat: Support backup for master (#9498)

This commit is contained in:
ssongliu
2025-07-16 17:53:04 +08:00
committed by GitHub
parent 700076f278
commit 7cbebc8236
27 changed files with 159 additions and 19 deletions
+7
View File
@@ -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()
}
}