2020-08-21 21:09:42 +08:00
|
|
|
package waf
|
|
|
|
|
|
|
|
|
|
import (
|
2020-12-03 11:03:12 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
2021-01-18 17:09:35 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/waf/ipadmin"
|
2020-08-21 21:09:42 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
|
|
|
|
"github.com/iwind/TeaGo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
|
|
|
|
server.
|
2020-12-03 11:03:12 +08:00
|
|
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
2020-08-21 21:09:42 +08:00
|
|
|
Helper(serverutils.NewServerHelper()).
|
|
|
|
|
Prefix("/servers/server/settings/waf").
|
2020-09-20 20:12:43 +08:00
|
|
|
GetPost("", new(IndexAction)).
|
2021-01-18 17:09:35 +08:00
|
|
|
Get("/ipadmin/allowList", new(ipadmin.AllowListAction)).
|
|
|
|
|
Get("/ipadmin/denyList", new(ipadmin.DenyListAction)).
|
2021-02-02 16:23:23 +08:00
|
|
|
GetPost("/ipadmin/countries", new(ipadmin.CountriesAction)).
|
|
|
|
|
GetPost("/ipadmin/provinces", new(ipadmin.ProvincesAction)).
|
2021-01-18 17:09:35 +08:00
|
|
|
GetPost("/ipadmin/updateIPPopup", new(ipadmin.UpdateIPPopupAction)).
|
|
|
|
|
Post("/ipadmin/deleteIP", new(ipadmin.DeleteIPAction)).
|
2021-02-02 19:30:07 +08:00
|
|
|
GetPost("/ipadmin/test", new(ipadmin.TestAction)).
|
2021-01-18 20:39:58 +08:00
|
|
|
|
|
|
|
|
// 规则相关
|
|
|
|
|
Get("/groups", new(GroupsAction)).
|
|
|
|
|
Get("/group", new(GroupAction)).
|
2020-08-21 21:09:42 +08:00
|
|
|
EndAll()
|
|
|
|
|
})
|
|
|
|
|
}
|