diff --git a/backend/app/api/v1/host.go b/backend/app/api/v1/host.go index a36aa7094..588aa545d 100644 --- a/backend/app/api/v1/host.go +++ b/backend/app/api/v1/host.go @@ -7,7 +7,7 @@ import ( "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/constant" "github.com/1Panel-dev/1Panel/backend/global" - "github.com/1Panel-dev/1Panel/backend/utils/copier" + "github.com/1Panel-dev/1Panel/backend/utils/encrypt" "github.com/gin-gonic/gin" ) @@ -36,7 +36,12 @@ func (b *BaseApi) CreateHost(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - req.Password = string(password) + passwordItem, err := encrypt.StringEncrypt(string(password)) + if err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + req.Password = passwordItem } if req.AuthMode == "key" && len(req.PrivateKey) != 0 { privateKey, err := base64.StdEncoding.DecodeString(req.PrivateKey) @@ -44,7 +49,12 @@ func (b *BaseApi) CreateHost(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - req.PrivateKey = string(privateKey) + keyItem, err := encrypt.StringEncrypt(string(privateKey)) + if err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + req.Password = keyItem } host, err := hostService.Create(req) @@ -148,33 +158,6 @@ func (b *BaseApi) SearchHost(c *gin.Context) { }) } -// @Tags Host -// @Summary Load host info -// @Description 加载主机信息 -// @Accept json -// @Param id path integer true "request" -// @Success 200 {object} dto.HostInfo -// @Security ApiKeyAuth -// @Router /hosts/:id [get] -func (b *BaseApi) GetHostInfo(c *gin.Context) { - id, err := helper.GetParamID(c) - if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) - return - } - host, err := hostService.GetHostInfo(id) - if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) - return - } - var hostDto dto.HostInfo - if err := copier.Copy(&hostDto, host); err != nil { - helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) - return - } - helper.SuccessWithData(c, hostDto) -} - // @Tags Host // @Summary Delete host // @Description 删除主机 @@ -227,7 +210,12 @@ func (b *BaseApi) UpdateHost(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - req.Password = string(password) + passwordItem, err := encrypt.StringEncrypt(string(password)) + if err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + req.Password = passwordItem } if req.AuthMode == "key" && len(req.PrivateKey) != 0 { privateKey, err := base64.StdEncoding.DecodeString(req.PrivateKey) @@ -235,7 +223,12 @@ func (b *BaseApi) UpdateHost(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - req.PrivateKey = string(privateKey) + keyItem, err := encrypt.StringEncrypt(string(privateKey)) + if err != nil { + helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) + return + } + req.PrivateKey = keyItem } upMap := make(map[string]interface{}) diff --git a/backend/app/service/host.go b/backend/app/service/host.go index d928f16ba..7efcde510 100644 --- a/backend/app/service/host.go +++ b/backend/app/service/host.go @@ -7,6 +7,7 @@ import ( "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/model" "github.com/1Panel-dev/1Panel/backend/constant" + "github.com/1Panel-dev/1Panel/backend/utils/encrypt" "github.com/1Panel-dev/1Panel/backend/utils/ssh" "github.com/jinzhu/copier" "github.com/pkg/errors" @@ -89,7 +90,20 @@ func (u *HostService) TestLocalConn(id uint) bool { if err := copier.Copy(&connInfo, &host); err != nil { return false } - connInfo.PrivateKey = []byte(host.PrivateKey) + if len(host.Password) != 0 { + host.Password, err = encrypt.StringDecrypt(host.Password) + if err != nil { + return false + } + connInfo.Password = host.Password + } + if len(host.PrivateKey) != 0 { + host.PrivateKey, err = encrypt.StringDecrypt(host.PrivateKey) + if err != nil { + return false + } + connInfo.PrivateKey = []byte(host.PrivateKey) + } if len(host.PassPhrase) != 0 { connInfo.PassPhrase = []byte(host.PassPhrase) } @@ -107,6 +121,18 @@ func (u *HostService) GetHostInfo(id uint) (*model.Host, error) { if err != nil { return nil, constant.ErrRecordNotFound } + if len(host.Password) != 0 { + host.Password, err = encrypt.StringDecrypt(host.Password) + if err != nil { + return nil, err + } + } + if len(host.PrivateKey) != 0 { + host.PrivateKey, err = encrypt.StringDecrypt(host.PrivateKey) + if err != nil { + return nil, err + } + } return &host, err } diff --git a/backend/init/migration/migrate.go b/backend/init/migration/migrate.go index dc7e804b9..76abd9f34 100644 --- a/backend/init/migration/migrate.go +++ b/backend/init/migration/migrate.go @@ -34,6 +34,7 @@ func Init() { migrations.AddBackupAccountDir, migrations.AddMfaInterval, migrations.UpdateAppDetail, + migrations.EncryptHostPassword, }) if err := m.Migrate(); err != nil { global.LOG.Error(err) diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index 60b438a74..874b1fb84 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -426,3 +426,35 @@ var UpdateAppDetail = &gormigrate.Migration{ return nil }, } + +var EncryptHostPassword = &gormigrate.Migration{ + ID: "20230703-encrypt-host-password", + Migrate: func(tx *gorm.DB) error { + var hosts []model.Host + if err := tx.Find(&hosts).Error; err != nil { + return err + } + + for _, host := range hosts { + if len(host.Password) != 0 { + pass, err := encrypt.StringEncrypt(host.Password) + if err != nil { + return err + } + if err := tx.Model(&model.Host{}).Where("id = ?", host.ID).Update("password", pass).Error; err != nil { + return err + } + } + if len(host.PrivateKey) != 0 { + key, err := encrypt.StringEncrypt(host.PrivateKey) + if err != nil { + return err + } + if err := tx.Model(&model.Host{}).Update("private_key", key).Error; err != nil { + return err + } + } + } + return nil + }, +} diff --git a/backend/router/ro_host.go b/backend/router/ro_host.go index 8d98bc3fb..3c54864d9 100644 --- a/backend/router/ro_host.go +++ b/backend/router/ro_host.go @@ -24,7 +24,6 @@ func (s *HostRouter) InitHostRouter(Router *gin.RouterGroup) { hostRouter.POST("/tree", baseApi.HostTree) hostRouter.POST("/test/byinfo", baseApi.TestByInfo) hostRouter.POST("/test/byid/:id", baseApi.TestByID) - hostRouter.GET(":id", baseApi.GetHostInfo) hostRouter.GET("/firewall/base", baseApi.LoadFirewallBaseInfo) hostRouter.POST("/firewall/search", baseApi.SearchFirewallRule) diff --git a/backend/server/server.go b/backend/server/server.go index 032a06a3b..4359e2df4 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -34,6 +34,7 @@ func Start() { log.Init() app.Init() db.Init() + hook.Init() migration.Init() validator.Init() gob.Register(psession.SessionUser{}) @@ -42,7 +43,6 @@ func Start() { gin.SetMode("debug") cron.Run() business.Init() - hook.Init() rootRouter := router.Routers() address := fmt.Sprintf(":%s", global.CONF.System.Port) diff --git a/backend/utils/encrypt/encrypt.go b/backend/utils/encrypt/encrypt.go index cd77a1ec9..9106ce88d 100644 --- a/backend/utils/encrypt/encrypt.go +++ b/backend/utils/encrypt/encrypt.go @@ -8,6 +8,7 @@ import ( "crypto/rand" "encoding/base64" "encoding/hex" + "errors" "fmt" "io" @@ -15,6 +16,9 @@ import ( ) func StringEncrypt(text string) (string, error) { + if len(text) == 0 { + return "", errors.New("it is not possible to encrypt an empty string.") + } key := global.CONF.System.EncryptKey pass := []byte(text) xpass, err := aesEncryptWithSalt([]byte(key), pass) @@ -26,6 +30,9 @@ func StringEncrypt(text string) (string, error) { } func StringDecrypt(text string) (string, error) { + if len(text) == 0 { + return "", errors.New("it is not possible to decrypt an empty string.") + } key := global.CONF.System.EncryptKey bytesPass, err := base64.StdEncoding.DecodeString(text) if err != nil { diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index f23bee5fb..75f1af176 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -1,10 +1,17 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package docs -import "github.com/swaggo/swag" +import ( + "bytes" + "encoding/json" + "strings" + "text/template" -const docTemplate = `{ + "github.com/swaggo/swag" +) + +var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -69,7 +76,7 @@ const docTemplate = `{ "summary": "Get app list update", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -415,7 +422,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -491,7 +498,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -593,7 +600,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -635,7 +642,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -679,7 +686,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -698,7 +705,7 @@ const docTemplate = `{ "summary": "Sync app installed", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -738,7 +745,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -791,7 +798,7 @@ const docTemplate = `{ "summary": "Sync app list", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -829,7 +836,7 @@ const docTemplate = `{ "summary": "Check System isDemo", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -843,7 +850,7 @@ const docTemplate = `{ "summary": "Load safety status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -893,7 +900,7 @@ const docTemplate = `{ "summary": "User logout", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -957,7 +964,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1000,7 +1007,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1042,7 +1049,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1084,7 +1091,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1163,7 +1170,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1205,7 +1212,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1297,7 +1304,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1337,7 +1344,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1377,7 +1384,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1514,7 +1521,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1667,7 +1674,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1709,7 +1716,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1792,7 +1799,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1927,7 +1934,7 @@ const docTemplate = `{ "summary": "List containers", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -1960,7 +1967,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2002,7 +2009,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2083,7 +2090,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2198,7 +2205,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2243,7 +2250,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2336,7 +2343,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -2372,7 +2379,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2557,7 +2564,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2599,7 +2606,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2689,7 +2696,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2740,7 +2747,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2783,7 +2790,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2826,7 +2833,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2868,7 +2875,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2986,7 +2993,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3029,7 +3036,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3080,7 +3087,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3131,7 +3138,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3182,7 +3189,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3305,7 +3312,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3357,7 +3364,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3490,7 +3497,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3554,7 +3561,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3605,7 +3612,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3656,7 +3663,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3696,7 +3703,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3783,7 +3790,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3929,7 +3936,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3969,7 +3976,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4009,7 +4016,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4071,7 +4078,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4235,7 +4242,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4275,7 +4282,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4317,7 +4324,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4359,7 +4366,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4401,7 +4408,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4438,7 +4445,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -4471,7 +4478,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4558,7 +4565,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4600,7 +4607,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4642,7 +4649,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4684,7 +4691,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4762,7 +4769,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4805,7 +4812,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4848,7 +4855,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4892,7 +4899,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4935,7 +4942,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5013,7 +5020,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5086,7 +5093,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5164,7 +5171,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5208,7 +5215,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5251,7 +5258,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5349,7 +5356,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5392,7 +5399,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5432,7 +5439,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5568,7 +5575,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5601,7 +5608,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5644,7 +5651,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5659,40 +5666,6 @@ const docTemplate = `{ } } }, - "/hosts/:id": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "加载主机信息", - "consumes": [ - "application/json" - ], - "tags": [ - "Host" - ], - "summary": "Load host info", - "parameters": [ - { - "type": "integer", - "description": "request", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.HostInfo" - } - } - } - } - }, "/hosts/command": { "get": { "security": [ @@ -5741,7 +5714,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5784,7 +5757,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5871,7 +5844,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5913,7 +5886,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5986,7 +5959,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6019,7 +5992,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6107,7 +6080,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6186,7 +6159,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6219,7 +6192,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6322,7 +6295,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6391,7 +6364,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6434,7 +6407,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6625,7 +6598,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6723,7 +6696,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6771,7 +6744,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6813,7 +6786,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6853,7 +6826,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6886,7 +6859,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6928,7 +6901,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6961,7 +6934,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7003,7 +6976,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7045,7 +7018,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7089,7 +7062,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7140,7 +7113,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7191,7 +7164,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7234,7 +7207,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7267,7 +7240,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7312,7 +7285,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7449,7 +7422,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7513,7 +7486,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7584,7 +7557,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7610,7 +7583,7 @@ const docTemplate = `{ "summary": "Clean monitor datas", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7650,7 +7623,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7690,7 +7663,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7740,7 +7713,7 @@ const docTemplate = `{ "summary": "Load system available status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7773,7 +7746,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7816,7 +7789,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7867,7 +7840,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7919,7 +7892,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7962,7 +7935,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8013,7 +7986,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8122,7 +8095,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8150,7 +8123,7 @@ const docTemplate = `{ "summary": "Load time zone options", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8228,7 +8201,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8271,7 +8244,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } }, @@ -8302,7 +8275,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8344,7 +8317,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8585,7 +8558,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8672,7 +8645,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8705,7 +8678,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8810,7 +8783,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8861,7 +8834,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8913,7 +8886,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8964,7 +8937,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9015,7 +8988,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9066,7 +9039,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9108,7 +9081,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9195,7 +9168,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9316,7 +9289,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9367,7 +9340,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9400,7 +9373,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9510,7 +9483,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9561,7 +9534,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9635,7 +9608,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9720,7 +9693,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9771,7 +9744,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9804,7 +9777,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9855,7 +9828,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9906,7 +9879,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9939,7 +9912,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10069,7 +10042,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10102,7 +10075,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10153,7 +10126,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10240,7 +10213,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10273,7 +10246,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10322,7 +10295,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10355,7 +10328,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10433,7 +10406,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -11678,53 +11651,6 @@ const docTemplate = `{ } } }, - "dto.HostInfo": { - "type": "object", - "properties": { - "addr": { - "type": "string" - }, - "authMode": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "groupBelong": { - "type": "string" - }, - "groupID": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "passPhrase": { - "type": "string" - }, - "password": { - "type": "string" - }, - "port": { - "type": "integer" - }, - "privateKey": { - "type": "string" - }, - "rememberPassword": { - "type": "boolean" - }, - "user": { - "type": "string" - } - } - }, "dto.HostOperate": { "type": "object", "required": [ @@ -12273,25 +12199,6 @@ const docTemplate = `{ } } }, - "dto.NginxKey": { - "type": "string", - "enum": [ - "index", - "limit-conn", - "ssl", - "cache", - "http-per", - "proxy-cache" - ], - "x-enum-varnames": [ - "Index", - "LimitConn", - "SSL", - "CACHE", - "HttpPer", - "ProxyCache" - ] - }, "dto.Operate": { "type": "object", "required": [ @@ -14245,7 +14152,7 @@ const docTemplate = `{ }, "params": {}, "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -14312,7 +14219,7 @@ const docTemplate = `{ ], "properties": { "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -15594,18 +15501,56 @@ const docTemplate = `{ } }` +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "localhost", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "1Panel", - Description: "开源Linux面板", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, +var SwaggerInfo = swaggerInfo{ + Version: "1.0", + Host: "localhost", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "1Panel", + Description: "开源Linux面板", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() } func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) + swag.Register("swagger", &s{}) } diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 0e8ab5bda..39c9f54de 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -62,7 +62,7 @@ "summary": "Get app list update", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -408,7 +408,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -484,7 +484,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -586,7 +586,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -628,7 +628,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -672,7 +672,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -691,7 +691,7 @@ "summary": "Sync app installed", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -731,7 +731,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -784,7 +784,7 @@ "summary": "Sync app list", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -822,7 +822,7 @@ "summary": "Check System isDemo", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -836,7 +836,7 @@ "summary": "Load safety status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -886,7 +886,7 @@ "summary": "User logout", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -950,7 +950,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -993,7 +993,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1035,7 +1035,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1077,7 +1077,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1156,7 +1156,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1198,7 +1198,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1290,7 +1290,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1330,7 +1330,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1370,7 +1370,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1507,7 +1507,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1660,7 +1660,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1702,7 +1702,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1785,7 +1785,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1920,7 +1920,7 @@ "summary": "List containers", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -1953,7 +1953,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1995,7 +1995,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2076,7 +2076,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2191,7 +2191,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2236,7 +2236,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2329,7 +2329,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -2365,7 +2365,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2550,7 +2550,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2592,7 +2592,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2682,7 +2682,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2733,7 +2733,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2776,7 +2776,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2819,7 +2819,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2861,7 +2861,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2979,7 +2979,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3022,7 +3022,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3073,7 +3073,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3124,7 +3124,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3175,7 +3175,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3298,7 +3298,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3350,7 +3350,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3483,7 +3483,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3547,7 +3547,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3598,7 +3598,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3649,7 +3649,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3689,7 +3689,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3776,7 +3776,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3922,7 +3922,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3962,7 +3962,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4002,7 +4002,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4064,7 +4064,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4228,7 +4228,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4268,7 +4268,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4310,7 +4310,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4352,7 +4352,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4394,7 +4394,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4431,7 +4431,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -4464,7 +4464,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4551,7 +4551,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4593,7 +4593,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4635,7 +4635,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4677,7 +4677,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4755,7 +4755,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4798,7 +4798,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4841,7 +4841,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4885,7 +4885,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4928,7 +4928,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5006,7 +5006,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5079,7 +5079,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5157,7 +5157,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5201,7 +5201,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5244,7 +5244,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5342,7 +5342,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5385,7 +5385,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5425,7 +5425,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5561,7 +5561,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5594,7 +5594,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5637,7 +5637,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5652,40 +5652,6 @@ } } }, - "/hosts/:id": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "加载主机信息", - "consumes": [ - "application/json" - ], - "tags": [ - "Host" - ], - "summary": "Load host info", - "parameters": [ - { - "type": "integer", - "description": "request", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.HostInfo" - } - } - } - } - }, "/hosts/command": { "get": { "security": [ @@ -5734,7 +5700,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5777,7 +5743,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5864,7 +5830,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5906,7 +5872,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5979,7 +5945,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6012,7 +5978,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6100,7 +6066,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6179,7 +6145,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6212,7 +6178,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6315,7 +6281,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6384,7 +6350,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6427,7 +6393,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6618,7 +6584,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6716,7 +6682,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6764,7 +6730,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6806,7 +6772,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6846,7 +6812,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6879,7 +6845,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6921,7 +6887,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6954,7 +6920,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6996,7 +6962,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7038,7 +7004,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7082,7 +7048,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7133,7 +7099,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7184,7 +7150,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7227,7 +7193,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7260,7 +7226,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7305,7 +7271,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7442,7 +7408,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7506,7 +7472,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7577,7 +7543,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7603,7 +7569,7 @@ "summary": "Clean monitor datas", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7643,7 +7609,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7683,7 +7649,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7733,7 +7699,7 @@ "summary": "Load system available status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7766,7 +7732,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7809,7 +7775,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7860,7 +7826,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7912,7 +7878,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7955,7 +7921,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8006,7 +7972,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8115,7 +8081,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8143,7 +8109,7 @@ "summary": "Load time zone options", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8221,7 +8187,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8264,7 +8230,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } }, @@ -8295,7 +8261,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8337,7 +8303,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8578,7 +8544,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8665,7 +8631,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8698,7 +8664,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8803,7 +8769,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8854,7 +8820,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8906,7 +8872,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8957,7 +8923,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9008,7 +8974,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9059,7 +9025,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9101,7 +9067,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9188,7 +9154,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9309,7 +9275,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9360,7 +9326,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9393,7 +9359,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9503,7 +9469,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9554,7 +9520,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9628,7 +9594,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9713,7 +9679,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9764,7 +9730,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9797,7 +9763,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9848,7 +9814,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9899,7 +9865,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9932,7 +9898,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10062,7 +10028,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10095,7 +10061,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10146,7 +10112,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10233,7 +10199,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10266,7 +10232,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10315,7 +10281,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -10348,7 +10314,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10426,7 +10392,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -11671,53 +11637,6 @@ } } }, - "dto.HostInfo": { - "type": "object", - "properties": { - "addr": { - "type": "string" - }, - "authMode": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "groupBelong": { - "type": "string" - }, - "groupID": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "passPhrase": { - "type": "string" - }, - "password": { - "type": "string" - }, - "port": { - "type": "integer" - }, - "privateKey": { - "type": "string" - }, - "rememberPassword": { - "type": "boolean" - }, - "user": { - "type": "string" - } - } - }, "dto.HostOperate": { "type": "object", "required": [ @@ -12266,25 +12185,6 @@ } } }, - "dto.NginxKey": { - "type": "string", - "enum": [ - "index", - "limit-conn", - "ssl", - "cache", - "http-per", - "proxy-cache" - ], - "x-enum-varnames": [ - "Index", - "LimitConn", - "SSL", - "CACHE", - "HttpPer", - "ProxyCache" - ] - }, "dto.Operate": { "type": "object", "required": [ @@ -14238,7 +14138,7 @@ }, "params": {}, "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -14305,7 +14205,7 @@ ], "properties": { "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index ca56bd541..7ccbc3116 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -823,37 +823,6 @@ definitions: - port - user type: object - dto.HostInfo: - properties: - addr: - type: string - authMode: - type: string - createdAt: - type: string - description: - type: string - groupBelong: - type: string - groupID: - type: integer - id: - type: integer - name: - type: string - passPhrase: - type: string - password: - type: string - port: - type: integer - privateKey: - type: string - rememberPassword: - type: boolean - user: - type: string - type: object dto.HostOperate: properties: addr: @@ -1219,22 +1188,6 @@ definitions: subnet: type: string type: object - dto.NginxKey: - enum: - - index - - limit-conn - - ssl - - cache - - http-per - - proxy-cache - type: string - x-enum-varnames: - - Index - - LimitConn - - SSL - - CACHE - - HttpPer - - ProxyCache dto.Operate: properties: operation: @@ -2533,7 +2486,7 @@ definitions: type: string params: {} scope: - $ref: '#/definitions/dto.NginxKey' + type: string websiteId: type: integer required: @@ -2578,7 +2531,7 @@ definitions: request.NginxScopeReq: properties: scope: - $ref: '#/definitions/dto.NginxKey' + type: string websiteId: type: integer required: @@ -3471,7 +3424,7 @@ paths: description: 获取应用更新版本 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get app list update @@ -3688,7 +3641,7 @@ paths: $ref: '#/definitions/request.AppInstalledIgnoreUpgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: ignore App Update @@ -3736,7 +3689,7 @@ paths: $ref: '#/definitions/request.AppInstalledOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate installed app @@ -3803,7 +3756,7 @@ paths: $ref: '#/definitions/request.AppInstalledUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change app params @@ -3830,7 +3783,7 @@ paths: $ref: '#/definitions/request.PortUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change app port @@ -3859,7 +3812,7 @@ paths: $ref: '#/definitions/request.AppInstalledSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List app installed @@ -3870,7 +3823,7 @@ paths: description: 同步已安装应用列表 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Sync app installed @@ -3896,7 +3849,7 @@ paths: $ref: '#/definitions/request.AppSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List apps @@ -3928,7 +3881,7 @@ paths: description: 同步应用列表 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Sync app list @@ -3956,7 +3909,7 @@ paths: description: 判断是否为demo环境 responses: "200": - description: OK + description: "" summary: Check System isDemo tags: - Auth @@ -3965,7 +3918,7 @@ paths: description: 获取系统安全登录状态 responses: "200": - description: OK + description: "" summary: Load safety status tags: - Auth @@ -3994,7 +3947,7 @@ paths: description: 用户登出 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: User logout @@ -4034,7 +3987,7 @@ paths: $ref: '#/definitions/dto.ContainerOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create container @@ -4062,7 +4015,7 @@ paths: $ref: '#/definitions/dto.OperationWithName' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Clean container log @@ -4089,7 +4042,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create compose @@ -4116,7 +4069,7 @@ paths: $ref: '#/definitions/dto.ComposeOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate compose @@ -4166,7 +4119,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Test compose @@ -4193,7 +4146,7 @@ paths: $ref: '#/definitions/dto.ComposeUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update compose @@ -4250,7 +4203,7 @@ paths: $ref: '#/definitions/dto.LogOption' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update docker daemon.json log option @@ -4276,7 +4229,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update docker daemon.json by upload file @@ -4302,7 +4255,7 @@ paths: $ref: '#/definitions/dto.DockerOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate docker @@ -4388,7 +4341,7 @@ paths: $ref: '#/definitions/dto.ImageLoad' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load image @@ -4488,7 +4441,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete image @@ -4515,7 +4468,7 @@ paths: $ref: '#/definitions/dto.ImageSave' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Save image @@ -4568,7 +4521,7 @@ paths: $ref: '#/definitions/dto.ImageTag' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Tag image @@ -4652,7 +4605,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List containers @@ -4672,7 +4625,7 @@ paths: $ref: '#/definitions/dto.NetworkCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create network @@ -4699,7 +4652,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete network @@ -4750,7 +4703,7 @@ paths: $ref: '#/definitions/dto.ContainerOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate Container @@ -4824,7 +4777,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create image repo @@ -4853,7 +4806,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete image repo @@ -4912,7 +4865,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load repo status @@ -4934,7 +4887,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update image repo @@ -5050,7 +5003,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create compose template @@ -5077,7 +5030,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete compose template @@ -5134,7 +5087,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update compose template @@ -5167,7 +5120,7 @@ paths: $ref: '#/definitions/dto.ContainerOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update container @@ -5195,7 +5148,7 @@ paths: $ref: '#/definitions/dto.ContainerUpgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Upgrade container @@ -5223,7 +5176,7 @@ paths: $ref: '#/definitions/dto.VolumeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create volume @@ -5250,7 +5203,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete volume @@ -5324,7 +5277,7 @@ paths: $ref: '#/definitions/dto.CronjobCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create cronjob @@ -5352,7 +5305,7 @@ paths: $ref: '#/definitions/dto.CronjobBatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete cronjob @@ -5385,7 +5338,7 @@ paths: $ref: '#/definitions/dto.CronjobDownload' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download cronjob records @@ -5418,7 +5371,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Handle cronjob once @@ -5451,7 +5404,7 @@ paths: $ref: '#/definitions/dto.CronjobClean' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Clean job records @@ -5528,7 +5481,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdateStatus' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update cronjob status @@ -5562,7 +5515,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update cronjob @@ -5647,7 +5600,7 @@ paths: $ref: '#/definitions/dto.MysqlDBCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create mysql database @@ -5687,7 +5640,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change mysql access @@ -5720,7 +5673,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change mysql password @@ -5753,7 +5706,7 @@ paths: $ref: '#/definitions/dto.MysqlConfUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql conf by upload file @@ -5779,7 +5732,7 @@ paths: $ref: '#/definitions/dto.MysqlDBDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete mysql database @@ -5834,7 +5787,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql database description @@ -5925,7 +5878,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis conf @@ -5951,7 +5904,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis conf by file @@ -5977,7 +5930,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change redis password @@ -6016,7 +5969,7 @@ paths: $ref: '#/definitions/dto.RedisConfPersistenceUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis persistence conf @@ -6116,7 +6069,7 @@ paths: $ref: '#/definitions/dto.MysqlVariablesUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql variables @@ -6142,7 +6095,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create file @@ -6169,7 +6122,7 @@ paths: $ref: '#/definitions/request.FileBatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Batch delete file @@ -6196,7 +6149,7 @@ paths: $ref: '#/definitions/request.FilePathCheck' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Check file exist @@ -6223,7 +6176,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Chunk Download file @@ -6247,7 +6200,7 @@ paths: type: file responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: ChunkUpload file @@ -6267,7 +6220,7 @@ paths: $ref: '#/definitions/request.FileCompress' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Compress file @@ -6323,7 +6276,7 @@ paths: $ref: '#/definitions/request.FileDeCompress' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Decompress file @@ -6350,7 +6303,7 @@ paths: $ref: '#/definitions/request.FileDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete file @@ -6377,7 +6330,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download file @@ -6404,7 +6357,7 @@ paths: $ref: '#/definitions/dto.FilePath' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download file with path @@ -6453,7 +6406,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change file mode @@ -6481,7 +6434,7 @@ paths: $ref: '#/definitions/request.FileMove' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Move file @@ -6509,7 +6462,7 @@ paths: $ref: '#/definitions/request.FileRoleUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change file owner @@ -6538,7 +6491,7 @@ paths: $ref: '#/definitions/request.FileRename' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change file name @@ -6566,7 +6519,7 @@ paths: $ref: '#/definitions/request.FileEdit' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update file content @@ -6615,7 +6568,7 @@ paths: $ref: '#/definitions/request.DirSizeReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load file size @@ -6661,7 +6614,7 @@ paths: type: file responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Upload file @@ -6710,7 +6663,7 @@ paths: $ref: '#/definitions/request.FileWget' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Wget file @@ -6739,7 +6692,7 @@ paths: $ref: '#/definitions/dto.GroupCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6767,7 +6720,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete group @@ -6830,7 +6783,7 @@ paths: $ref: '#/definitions/dto.GroupUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update group @@ -6858,7 +6811,7 @@ paths: $ref: '#/definitions/dto.SSHConf' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host ssh setting by file @@ -6884,7 +6837,7 @@ paths: $ref: '#/definitions/dto.GenerateSSH' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Generate host ssh secret @@ -6970,7 +6923,7 @@ paths: $ref: '#/definitions/dto.GenerateLoad' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load host ssh secret @@ -6990,7 +6943,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host ssh setting @@ -7018,7 +6971,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create host @@ -7032,27 +6985,6 @@ paths: formatEN: create host [name][addr] formatZH: 创建主机 [name][addr] paramKeys: [] - /hosts/:id: - get: - consumes: - - application/json - description: 加载主机信息 - parameters: - - description: request - in: path - name: id - required: true - type: integer - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.HostInfo' - security: - - ApiKeyAuth: [] - summary: Load host info - tags: - - Host /hosts/command: get: description: 获取快速命令列表 @@ -7079,7 +7011,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create command @@ -7107,7 +7039,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete command @@ -7162,7 +7094,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update command @@ -7189,7 +7121,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete host @@ -7235,7 +7167,7 @@ paths: $ref: '#/definitions/dto.BatchRuleOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -7255,7 +7187,7 @@ paths: $ref: '#/definitions/dto.AddrRuleOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -7312,7 +7244,7 @@ paths: $ref: '#/definitions/dto.PortRuleOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -7362,7 +7294,7 @@ paths: $ref: '#/definitions/dto.AddrRuleUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -7382,7 +7314,7 @@ paths: $ref: '#/definitions/dto.PortRuleUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -7445,7 +7377,7 @@ paths: $ref: '#/definitions/dto.HostConnTest' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Test host conn by info @@ -7487,7 +7419,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host @@ -7515,7 +7447,7 @@ paths: $ref: '#/definitions/dto.ChangeHostGroup' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host group @@ -7635,7 +7567,7 @@ paths: $ref: '#/definitions/request.NginxConfigFileUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update OpenResty conf by upload file @@ -7696,7 +7628,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update OpenResty conf @@ -7727,7 +7659,7 @@ paths: $ref: '#/definitions/request.ProcessReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Stop Process @@ -7754,7 +7686,7 @@ paths: $ref: '#/definitions/request.RuntimeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create runtime @@ -7780,7 +7712,7 @@ paths: type: string responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get runtime @@ -7800,7 +7732,7 @@ paths: $ref: '#/definitions/request.RuntimeDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete runtime @@ -7827,7 +7759,7 @@ paths: $ref: '#/definitions/request.RuntimeSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List runtimes @@ -7847,7 +7779,7 @@ paths: $ref: '#/definitions/request.RuntimeUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update runtime @@ -7874,7 +7806,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create backup account @@ -7901,7 +7833,7 @@ paths: $ref: '#/definitions/dto.CommonBackup' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Backup system data @@ -7930,7 +7862,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete backup account @@ -7963,7 +7895,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete backup record @@ -7996,7 +7928,7 @@ paths: $ref: '#/definitions/dto.DownloadRecord' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download backup record @@ -8024,7 +7956,7 @@ paths: $ref: '#/definitions/dto.RecordSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Page backup records @@ -8044,7 +7976,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system data @@ -8074,7 +8006,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system data by upload @@ -8160,7 +8092,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update backup account @@ -8200,7 +8132,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Reset system password expired @@ -8245,7 +8177,7 @@ paths: $ref: '#/definitions/dto.MfaCredential' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Bind mfa @@ -8262,7 +8194,7 @@ paths: description: 清空监控数据 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Clean monitor datas @@ -8288,7 +8220,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system password @@ -8314,7 +8246,7 @@ paths: $ref: '#/definitions/dto.PortUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system port @@ -8345,7 +8277,7 @@ paths: description: 获取系统可用状态 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load system available status @@ -8365,7 +8297,7 @@ paths: $ref: '#/definitions/dto.SnapshotCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create system snapshot @@ -8393,7 +8325,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete system backup @@ -8426,7 +8358,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update snapshot description @@ -8460,7 +8392,7 @@ paths: $ref: '#/definitions/dto.SnapshotImport' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Import system snapshot @@ -8488,7 +8420,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system backup @@ -8521,7 +8453,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Rollback system backup @@ -8589,7 +8521,7 @@ paths: $ref: '#/definitions/dto.SSLUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system ssl @@ -8607,7 +8539,7 @@ paths: description: 加载系统可用时区 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load time zone options @@ -8656,7 +8588,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system setting @@ -8684,7 +8616,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load release notes by version @@ -8703,7 +8635,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Upgrade @@ -8730,7 +8662,7 @@ paths: $ref: '#/definitions/request.WebsiteCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create website @@ -8883,7 +8815,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website acme account @@ -8938,7 +8870,7 @@ paths: $ref: '#/definitions/request.NginxAuthReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get AuthBasic conf @@ -8958,7 +8890,7 @@ paths: $ref: '#/definitions/request.NginxAuthUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get AuthBasic conf @@ -9022,7 +8954,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update nginx conf @@ -9055,7 +8987,7 @@ paths: $ref: '#/definitions/request.WebsiteDefaultUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change default server @@ -9089,7 +9021,7 @@ paths: $ref: '#/definitions/request.WebsiteDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website @@ -9122,7 +9054,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdateDirPermission' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update Site Dir permission @@ -9155,7 +9087,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdateDir' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update Site Dir @@ -9188,7 +9120,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create website dns account @@ -9215,7 +9147,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website dns account @@ -9270,7 +9202,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website dns account @@ -9347,7 +9279,7 @@ paths: $ref: '#/definitions/request.WebsiteDomainDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website domain @@ -9380,7 +9312,7 @@ paths: $ref: '#/definitions/request.NginxCommonReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get AntiLeech conf @@ -9400,7 +9332,7 @@ paths: $ref: '#/definitions/request.NginxAntiLeechUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update AntiLeech @@ -9469,7 +9401,7 @@ paths: $ref: '#/definitions/request.WebsiteNginxUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website nginx conf @@ -9502,7 +9434,7 @@ paths: $ref: '#/definitions/request.WebsiteOp' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate website @@ -9549,7 +9481,7 @@ paths: $ref: '#/definitions/request.WebsitePHPConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website php conf @@ -9603,7 +9535,7 @@ paths: $ref: '#/definitions/request.WebsitePHPFileUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update php conf @@ -9636,7 +9568,7 @@ paths: $ref: '#/definitions/request.WebsiteProxyReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get proxy conf @@ -9656,7 +9588,7 @@ paths: $ref: '#/definitions/request.WebsiteProxyConfig' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update proxy conf @@ -9689,7 +9621,7 @@ paths: $ref: '#/definitions/request.NginxProxyUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update proxy file @@ -9722,7 +9654,7 @@ paths: $ref: '#/definitions/request.NginxRewriteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get rewrite conf @@ -9742,7 +9674,7 @@ paths: $ref: '#/definitions/request.NginxRewriteUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update rewrite conf @@ -9825,7 +9757,7 @@ paths: type: integer responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Search website ssl by id @@ -9845,7 +9777,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website ssl @@ -9878,7 +9810,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLRenew' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Reset website ssl @@ -9933,7 +9865,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Page website ssl @@ -9953,7 +9885,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update ssl @@ -9985,7 +9917,7 @@ paths: type: integer responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Search website ssl by website id @@ -10005,7 +9937,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website @@ -10054,7 +9986,7 @@ paths: $ref: '#/definitions/request.WebsiteWafUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website waf conf diff --git a/frontend/src/api/modules/host.ts b/frontend/src/api/modules/host.ts index 9c2c4f88c..6dfa0a0b2 100644 --- a/frontend/src/api/modules/host.ts +++ b/frontend/src/api/modules/host.ts @@ -11,9 +11,6 @@ export const searchHosts = (params: Host.SearchWithPage) => { export const getHostTree = (params: Host.ReqSearch) => { return http.post>(`/hosts/tree`, params); }; -export const getHostInfo = (id: number) => { - return http.get(`/hosts/` + id); -}; export const addHost = (params: Host.HostOperate) => { let reqest = deepCopy(params) as Host.HostOperate; if (reqest.password) {