优化WAF区域/省份封禁:增加仅允许、增加中国香港澳台、内地等特殊区域

This commit is contained in:
GoEdgeLab
2023-07-07 09:53:00 +08:00
parent 3b8a483933
commit e27c0280ff
30 changed files with 751 additions and 237 deletions

View File

@@ -7,13 +7,12 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/regionconfigs"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/maps"
)
const ChinaCountryId = 1
type ProvincesAction struct {
actionutils.ParentAction
}
@@ -43,7 +42,7 @@ func (this *ProvincesAction) RunGet(params struct {
}
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{
RegionCountryId: int64(ChinaCountryId),
RegionCountryId: regionconfigs.RegionChinaId,
})
if err != nil {
this.ErrorPage(err)