2023-11-16 06:40:08 +00:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ToolboxRouter struct{}
|
|
|
|
|
2023-12-20 14:44:09 +00:00
|
|
|
func (s *ToolboxRouter) InitRouter(Router *gin.RouterGroup) {
|
2023-11-16 06:40:08 +00:00
|
|
|
toolboxRouter := Router.Group("toolbox").
|
|
|
|
Use(middleware.JwtAuth()).
|
|
|
|
Use(middleware.SessionAuth()).
|
|
|
|
Use(middleware.PasswordExpired())
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2023-12-14 08:38:22 +00:00
|
|
|
toolboxRouter.POST("/device/base", baseApi.LoadDeviceBaseInfo)
|
2023-11-20 07:28:09 +00:00
|
|
|
toolboxRouter.GET("/device/zone/options", baseApi.LoadTimeOption)
|
|
|
|
toolboxRouter.POST("/device/update/conf", baseApi.UpdateDeviceConf)
|
|
|
|
toolboxRouter.POST("/device/update/host", baseApi.UpdateDeviceHost)
|
2023-11-27 04:02:08 +00:00
|
|
|
toolboxRouter.POST("/device/update/passwd", baseApi.UpdateDevicePasswd)
|
|
|
|
toolboxRouter.POST("/device/update/swap", baseApi.UpdateDeviceSwap)
|
|
|
|
toolboxRouter.POST("/device/update/byconf", baseApi.UpdateDeviceByFile)
|
2023-11-20 07:28:09 +00:00
|
|
|
toolboxRouter.POST("/device/check/dns", baseApi.CheckDNS)
|
|
|
|
toolboxRouter.POST("/device/conf", baseApi.LoadDeviceConf)
|
|
|
|
|
2023-12-05 07:50:10 +00:00
|
|
|
toolboxRouter.POST("/scan", baseApi.ScanSystem)
|
|
|
|
toolboxRouter.POST("/clean", baseApi.SystemClean)
|
|
|
|
|
2023-11-16 06:40:08 +00:00
|
|
|
toolboxRouter.GET("/fail2ban/base", baseApi.LoadFail2BanBaseInfo)
|
|
|
|
toolboxRouter.GET("/fail2ban/load/conf", baseApi.LoadFail2BanConf)
|
|
|
|
toolboxRouter.POST("/fail2ban/search", baseApi.SearchFail2Ban)
|
|
|
|
toolboxRouter.POST("/fail2ban/operate", baseApi.OperateFail2Ban)
|
|
|
|
toolboxRouter.POST("/fail2ban/operate/sshd", baseApi.OperateSSHD)
|
|
|
|
toolboxRouter.POST("/fail2ban/update", baseApi.UpdateFail2BanConf)
|
|
|
|
toolboxRouter.POST("/fail2ban/update/byconf", baseApi.UpdateFail2BanConfByFile)
|
|
|
|
}
|
|
|
|
}
|