fix: 解决低版本 OpenResty 创建网站报错的问题 (#4661)

This commit is contained in:
zhengkunwang 2024-04-23 18:04:09 +08:00 committed by GitHub
parent dcc0264b67
commit b6b4bfe195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,6 +288,10 @@ func createWafConfig(website *model.Website, domains []model.WebsiteDomain) erro
if err != nil {
return err
}
if !common.CompareVersion(nginxInstall.Version, "1.21.4.3-2-0") {
return nil
}
wafDataPath := path.Join(nginxInstall.GetPath(), "1pwaf", "data")
fileOp := files.NewFileOp()
if !fileOp.Stat(wafDataPath) {
@ -419,6 +423,9 @@ func delWafConfig(website model.Website, force bool) error {
if err != nil {
return err
}
if !common.CompareVersion(nginxInstall.Version, "1.21.4.3-2-0") {
return nil
}
wafDataPath := path.Join(nginxInstall.GetPath(), "1pwaf", "data")
fileOp := files.NewFileOp()
if !fileOp.Stat(wafDataPath) {