diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index c0033fa3c..657018ba7 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -7851,631 +7851,6 @@ const docTemplate = `{ } } }, - "/host/conffile/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Update host SSH setting by file", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SSHConf" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "update SSH conf", - "formatZH": "修改 SSH 配置文件", - "paramKeys": [] - } - } - }, - "/host/ssh/conf": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH conf", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/ssh/generate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Generate host SSH secret", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GenerateSSH" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "generate SSH secret", - "formatZH": "生成 SSH 密钥 ", - "paramKeys": [] - } - } - }, - "/host/ssh/log": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH logs", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SearchSSHLog" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SSHLog" - } - } - } - } - }, - "/host/ssh/operate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Operate SSH", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.Operate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operation" - ], - "formatEN": "[operation] SSH", - "formatZH": "[operation] SSH ", - "paramKeys": [] - } - } - }, - "/host/ssh/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH setting info", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SSHInfo" - } - } - } - } - }, - "/host/ssh/secret": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH secret", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GenerateLoad" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/ssh/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Update host SSH setting", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SSHUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "key", - "value" - ], - "formatEN": "update SSH setting [key] =\u003e [value]", - "formatZH": "修改 SSH 配置 [key] =\u003e [value]", - "paramKeys": [] - } - } - }, - "/host/tool": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool status", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.HostToolRes" - } - } - } - } - }, - "/host/tool/config": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolConfig" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.HostToolConfig" - } - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] tool config", - "formatZH": "[operate] 主机工具配置文件 ", - "paramKeys": [] - } - } - }, - "/host/tool/create": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Create Host tool Config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolCreate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create [type] config", - "formatZH": "创建 [type] 配置", - "paramKeys": [] - } - } - }, - "/host/tool/log": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool logs", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolLogReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/tool/operate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Operate tool", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate", - "type" - ], - "formatEN": "[operate] [type]", - "formatZH": "[operate] [type] ", - "paramKeys": [] - } - } - }, - "/host/tool/supervisor/process": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get Supervisor process config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.SupervisorProcessConfig" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Create Supervisor process", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] process", - "formatZH": "[operate] 守护进程 ", - "paramKeys": [] - } - } - }, - "/host/tool/supervisor/process/file": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get Supervisor process config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessFileReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] Supervisor Process Config file", - "formatZH": "[operate] Supervisor 进程文件 ", - "paramKeys": [] - } - } - }, "/hosts": { "post": { "security": [ @@ -8917,6 +8292,48 @@ const docTemplate = `{ } } }, + "/hosts/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Update host SSH setting by file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SSHConf" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "update SSH conf", + "formatZH": "修改 SSH 配置文件", + "paramKeys": [] + } + } + }, "/hosts/del": { "post": { "security": [ @@ -9454,6 +8871,261 @@ const docTemplate = `{ } } }, + "/hosts/ssh/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/ssh/generate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Generate host SSH secret", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GenerateSSH" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "generate SSH secret", + "formatZH": "生成 SSH 密钥 ", + "paramKeys": [] + } + } + }, + "/hosts/ssh/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchSSHLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SSHLog" + } + } + } + } + }, + "/hosts/ssh/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Operate SSH", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.Operate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operation" + ], + "formatEN": "[operation] SSH", + "formatZH": "[operation] SSH ", + "paramKeys": [] + } + } + }, + "/hosts/ssh/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH setting info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SSHInfo" + } + } + } + } + }, + "/hosts/ssh/secret": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH secret", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GenerateLoad" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/ssh/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Update host SSH setting", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SSHUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "key", + "value" + ], + "formatEN": "update SSH setting [key] =\u003e [value]", + "formatZH": "修改 SSH 配置 [key] =\u003e [value]", + "paramKeys": [] + } + } + }, "/hosts/test/byid/{id}": { "post": { "security": [ @@ -9528,6 +9200,334 @@ const docTemplate = `{ } } }, + "/hosts/tool": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool status", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolRes" + } + } + } + } + }, + "/hosts/tool/config": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolConfig" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolConfig" + } + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] tool config", + "formatZH": "[operate] 主机工具配置文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/create": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Create Host tool Config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create [type] config", + "formatZH": "创建 [type] 配置", + "paramKeys": [] + } + } + }, + "/hosts/tool/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolLogReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/tool/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Operate tool", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate", + "type" + ], + "formatEN": "[operate] [type]", + "formatZH": "[operate] [type] ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get Supervisor process config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.SupervisorProcessConfig" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Create Supervisor process", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] process", + "formatZH": "[operate] 守护进程 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get Supervisor process config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessFileReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] Supervisor Process Config file", + "formatZH": "[operate] Supervisor 进程文件 ", + "paramKeys": [] + } + } + }, "/hosts/tree": { "post": { "security": [ @@ -21981,6 +21981,9 @@ const docTemplate = `{ "lastCleanTime": { "type": "string" }, + "licenseVerify": { + "type": "string" + }, "localTime": { "type": "string" }, @@ -26727,7 +26730,7 @@ const docTemplate = `{ }, "securityDefinitions": { "ApiKeyAuth": { - "description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.", + "description": "- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.", "type": "apiKey", "name": "1Panel-Token", "in": "header" diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 1fe13c773..07de4b923 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -7848,631 +7848,6 @@ } } }, - "/host/conffile/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Update host SSH setting by file", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SSHConf" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "update SSH conf", - "formatZH": "修改 SSH 配置文件", - "paramKeys": [] - } - } - }, - "/host/ssh/conf": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH conf", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/ssh/generate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Generate host SSH secret", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GenerateSSH" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [], - "formatEN": "generate SSH secret", - "formatZH": "生成 SSH 密钥 ", - "paramKeys": [] - } - } - }, - "/host/ssh/log": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH logs", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SearchSSHLog" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SSHLog" - } - } - } - } - }, - "/host/ssh/operate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Operate SSH", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.Operate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operation" - ], - "formatEN": "[operation] SSH", - "formatZH": "[operation] SSH ", - "paramKeys": [] - } - } - }, - "/host/ssh/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH setting info", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.SSHInfo" - } - } - } - } - }, - "/host/ssh/secret": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Load host SSH secret", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GenerateLoad" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/ssh/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "SSH" - ], - "summary": "Update host SSH setting", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SSHUpdate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "key", - "value" - ], - "formatEN": "update SSH setting [key] =\u003e [value]", - "formatZH": "修改 SSH 配置 [key] =\u003e [value]", - "paramKeys": [] - } - } - }, - "/host/tool": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool status", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.HostToolRes" - } - } - } - } - }, - "/host/tool/config": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolConfig" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.HostToolConfig" - } - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] tool config", - "formatZH": "[operate] 主机工具配置文件 ", - "paramKeys": [] - } - } - }, - "/host/tool/create": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Create Host tool Config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolCreate" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create [type] config", - "formatZH": "创建 [type] 配置", - "paramKeys": [] - } - } - }, - "/host/tool/log": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get tool logs", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolLogReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/host/tool/operate": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Operate tool", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.HostToolReq" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate", - "type" - ], - "formatEN": "[operate] [type]", - "formatZH": "[operate] [type] ", - "paramKeys": [] - } - } - }, - "/host/tool/supervisor/process": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get Supervisor process config", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.SupervisorProcessConfig" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Create Supervisor process", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessConfig" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] process", - "formatZH": "[operate] 守护进程 ", - "paramKeys": [] - } - } - }, - "/host/tool/supervisor/process/file": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - }, - { - "Timestamp": [] - } - ], - "consumes": [ - "application/json" - ], - "tags": [ - "Host tool" - ], - "summary": "Get Supervisor process config", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SupervisorProcessFileReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - }, - "x-panel-log": { - "BeforeFunctions": [], - "bodyKeys": [ - "operate" - ], - "formatEN": "[operate] Supervisor Process Config file", - "formatZH": "[operate] Supervisor 进程文件 ", - "paramKeys": [] - } - } - }, "/hosts": { "post": { "security": [ @@ -8914,6 +8289,48 @@ } } }, + "/hosts/conffile/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Update host SSH setting by file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SSHConf" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "update SSH conf", + "formatZH": "修改 SSH 配置文件", + "paramKeys": [] + } + } + }, "/hosts/del": { "post": { "security": [ @@ -9451,6 +8868,261 @@ } } }, + "/hosts/ssh/conf": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH conf", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/ssh/generate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Generate host SSH secret", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GenerateSSH" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [], + "formatEN": "generate SSH secret", + "formatZH": "生成 SSH 密钥 ", + "paramKeys": [] + } + } + }, + "/hosts/ssh/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchSSHLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SSHLog" + } + } + } + } + }, + "/hosts/ssh/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Operate SSH", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.Operate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operation" + ], + "formatEN": "[operation] SSH", + "formatZH": "[operation] SSH ", + "paramKeys": [] + } + } + }, + "/hosts/ssh/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH setting info", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.SSHInfo" + } + } + } + } + }, + "/hosts/ssh/secret": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Load host SSH secret", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GenerateLoad" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/ssh/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "SSH" + ], + "summary": "Update host SSH setting", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SSHUpdate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "key", + "value" + ], + "formatEN": "update SSH setting [key] =\u003e [value]", + "formatZH": "修改 SSH 配置 [key] =\u003e [value]", + "paramKeys": [] + } + } + }, "/hosts/test/byid/{id}": { "post": { "security": [ @@ -9525,6 +9197,334 @@ } } }, + "/hosts/tool": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool status", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolRes" + } + } + } + } + }, + "/hosts/tool/config": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolConfig" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.HostToolConfig" + } + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] tool config", + "formatZH": "[operate] 主机工具配置文件 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/create": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Create Host tool Config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolCreate" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create [type] config", + "formatZH": "创建 [type] 配置", + "paramKeys": [] + } + } + }, + "/hosts/tool/log": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get tool logs", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolLogReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/hosts/tool/operate": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Operate tool", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.HostToolReq" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate", + "type" + ], + "formatEN": "[operate] [type]", + "formatZH": "[operate] [type] ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get Supervisor process config", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.SupervisorProcessConfig" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Create Supervisor process", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessConfig" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] process", + "formatZH": "[operate] 守护进程 ", + "paramKeys": [] + } + } + }, + "/hosts/tool/supervisor/process/file": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + }, + { + "Timestamp": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Host tool" + ], + "summary": "Get Supervisor process config", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SupervisorProcessFileReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + }, + "x-panel-log": { + "BeforeFunctions": [], + "bodyKeys": [ + "operate" + ], + "formatEN": "[operate] Supervisor Process Config file", + "formatZH": "[operate] Supervisor 进程文件 ", + "paramKeys": [] + } + } + }, "/hosts/tree": { "post": { "security": [ @@ -21978,6 +21978,9 @@ "lastCleanTime": { "type": "string" }, + "licenseVerify": { + "type": "string" + }, "localTime": { "type": "string" }, @@ -26724,7 +26727,7 @@ }, "securityDefinitions": { "ApiKeyAuth": { - "description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n```\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n```\n- `1Panel-Token` is the key for the panel API Key.", + "description": "- `1Panel-Token` is the key for the panel API Key.", "type": "apiKey", "name": "1Panel-Token", "in": "header" diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index 30650d8b9..7f38d2f38 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -3342,6 +3342,8 @@ definitions: type: string lastCleanTime: type: string + licenseVerify: + type: string localTime: type: string menuTabs: @@ -11237,381 +11239,6 @@ paths: formatEN: update group [name][type] formatZH: 更新组 [name][type] paramKeys: [] - /host/conffile/update: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.SSHConf' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Update host SSH setting by file - tags: - - SSH - x-panel-log: - BeforeFunctions: [] - bodyKeys: [] - formatEN: update SSH conf - formatZH: 修改 SSH 配置文件 - paramKeys: [] - /host/ssh/conf: - get: - responses: - "200": - description: OK - schema: - type: string - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Load host SSH conf - tags: - - SSH - /host/ssh/generate: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.GenerateSSH' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Generate host SSH secret - tags: - - SSH - x-panel-log: - BeforeFunctions: [] - bodyKeys: [] - formatEN: generate SSH secret - formatZH: '生成 SSH 密钥 ' - paramKeys: [] - /host/ssh/log: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.SearchSSHLog' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.SSHLog' - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Load host SSH logs - tags: - - SSH - /host/ssh/operate: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.Operate' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Operate SSH - tags: - - SSH - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - operation - formatEN: '[operation] SSH' - formatZH: '[operation] SSH ' - paramKeys: [] - /host/ssh/search: - post: - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.SSHInfo' - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Load host SSH setting info - tags: - - SSH - /host/ssh/secret: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.GenerateLoad' - responses: - "200": - description: OK - schema: - type: string - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Load host SSH secret - tags: - - SSH - /host/ssh/update: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.SSHUpdate' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Update host SSH setting - tags: - - SSH - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - key - - value - formatEN: update SSH setting [key] => [value] - formatZH: 修改 SSH 配置 [key] => [value] - paramKeys: [] - /host/tool: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.HostToolReq' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/response.HostToolRes' - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Get tool status - tags: - - Host tool - /host/tool/config: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.HostToolConfig' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/response.HostToolConfig' - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Get tool config - tags: - - Host tool - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - operate - formatEN: '[operate] tool config' - formatZH: '[operate] 主机工具配置文件 ' - paramKeys: [] - /host/tool/create: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.HostToolCreate' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Create Host tool Config - tags: - - Host tool - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - type - formatEN: create [type] config - formatZH: 创建 [type] 配置 - paramKeys: [] - /host/tool/log: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.HostToolLogReq' - responses: - "200": - description: OK - schema: - type: string - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Get tool logs - tags: - - Host tool - /host/tool/operate: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.HostToolReq' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Operate tool - tags: - - Host tool - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - operate - - type - formatEN: '[operate] [type]' - formatZH: '[operate] [type] ' - paramKeys: [] - /host/tool/supervisor/process: - get: - consumes: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/response.SupervisorProcessConfig' - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Get Supervisor process config - tags: - - Host tool - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.SupervisorProcessConfig' - responses: - "200": - description: OK - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Create Supervisor process - tags: - - Host tool - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - operate - formatEN: '[operate] process' - formatZH: '[operate] 守护进程 ' - paramKeys: [] - /host/tool/supervisor/process/file: - post: - consumes: - - application/json - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/request.SupervisorProcessFileReq' - responses: - "200": - description: OK - schema: - type: string - security: - - ApiKeyAuth: [] - - Timestamp: [] - summary: Get Supervisor process config - tags: - - Host tool - x-panel-log: - BeforeFunctions: [] - bodyKeys: - - operate - formatEN: '[operate] Supervisor Process Config file' - formatZH: '[operate] Supervisor 进程文件 ' - paramKeys: [] /hosts: post: consumes: @@ -11878,6 +11505,32 @@ paths: formatEN: update quick command [name] formatZH: 更新快捷命令 [name] paramKeys: [] + /hosts/conffile/update: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SSHConf' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Update host SSH setting by file + tags: + - SSH + x-panel-log: + BeforeFunctions: [] + bodyKeys: [] + formatEN: update SSH conf + formatZH: 修改 SSH 配置文件 + paramKeys: [] /hosts/del: post: consumes: @@ -12197,6 +11850,157 @@ paths: summary: Page host tags: - Host + /hosts/ssh/conf: + get: + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Load host SSH conf + tags: + - SSH + /hosts/ssh/generate: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.GenerateSSH' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Generate host SSH secret + tags: + - SSH + x-panel-log: + BeforeFunctions: [] + bodyKeys: [] + formatEN: generate SSH secret + formatZH: '生成 SSH 密钥 ' + paramKeys: [] + /hosts/ssh/log: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SearchSSHLog' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.SSHLog' + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Load host SSH logs + tags: + - SSH + /hosts/ssh/operate: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.Operate' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Operate SSH + tags: + - SSH + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - operation + formatEN: '[operation] SSH' + formatZH: '[operation] SSH ' + paramKeys: [] + /hosts/ssh/search: + post: + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.SSHInfo' + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Load host SSH setting info + tags: + - SSH + /hosts/ssh/secret: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.GenerateLoad' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Load host SSH secret + tags: + - SSH + /hosts/ssh/update: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SSHUpdate' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Update host SSH setting + tags: + - SSH + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - key + - value + formatEN: update SSH setting [key] => [value] + formatZH: 修改 SSH 配置 [key] => [value] + paramKeys: [] /hosts/test/byid/{id}: post: consumes: @@ -12240,6 +12044,204 @@ paths: summary: Test host conn by info tags: - Host + /hosts/tool: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.HostToolReq' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.HostToolRes' + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Get tool status + tags: + - Host tool + /hosts/tool/config: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.HostToolConfig' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.HostToolConfig' + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Get tool config + tags: + - Host tool + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - operate + formatEN: '[operate] tool config' + formatZH: '[operate] 主机工具配置文件 ' + paramKeys: [] + /hosts/tool/create: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.HostToolCreate' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Create Host tool Config + tags: + - Host tool + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - type + formatEN: create [type] config + formatZH: 创建 [type] 配置 + paramKeys: [] + /hosts/tool/log: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.HostToolLogReq' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Get tool logs + tags: + - Host tool + /hosts/tool/operate: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.HostToolReq' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Operate tool + tags: + - Host tool + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - operate + - type + formatEN: '[operate] [type]' + formatZH: '[operate] [type] ' + paramKeys: [] + /hosts/tool/supervisor/process: + get: + consumes: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.SupervisorProcessConfig' + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Get Supervisor process config + tags: + - Host tool + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.SupervisorProcessConfig' + responses: + "200": + description: OK + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Create Supervisor process + tags: + - Host tool + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - operate + formatEN: '[operate] process' + formatZH: '[operate] 守护进程 ' + paramKeys: [] + /hosts/tool/supervisor/process/file: + post: + consumes: + - application/json + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.SupervisorProcessFileReq' + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + - Timestamp: [] + summary: Get Supervisor process config + tags: + - Host tool + x-panel-log: + BeforeFunctions: [] + bodyKeys: + - operate + formatEN: '[operate] Supervisor Process Config file' + formatZH: '[operate] Supervisor 进程文件 ' + paramKeys: [] /hosts/tree: post: consumes: @@ -16766,15 +16768,7 @@ schemes: - https securityDefinitions: ApiKeyAuth: - description: |- - Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp). - ``` - eg: - curl -X GET "http://localhost:4004/api/v1/dashboard/current" \ - -H "1Panel-Token: <1panel_token>" \ - -H "1Panel-Timestamp: " - ``` - - `1Panel-Token` is the key for the panel API Key. + description: '- `1Panel-Token` is the key for the panel API Key.' in: header name: 1Panel-Token type: apiKey diff --git a/go.mod b/go.mod index d344e7ca4..fc69cd971 100644 --- a/go.mod +++ b/go.mod @@ -60,6 +60,7 @@ require ( golang.org/x/sys v0.29.0 golang.org/x/term v0.28.0 golang.org/x/text v0.21.0 + google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 gopkg.in/ini.v1 v1.67.0 gopkg.in/yaml.v3 v3.0.1 gorm.io/gorm v1.25.7 @@ -151,7 +152,6 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128 // indirect github.com/imdario/mergo v0.3.16 // indirect @@ -262,7 +262,6 @@ require ( golang.org/x/sync v0.10.0 // indirect golang.org/x/time v0.8.0 // indirect golang.org/x/tools v0.28.0 // indirect - google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/grpc v1.67.1 // indirect @@ -274,13 +273,10 @@ require ( k8s.io/client-go v0.29.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect - modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect modernc.org/libc v1.49.3 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.8.0 // indirect modernc.org/sqlite v1.29.7 // indirect - modernc.org/strutil v1.2.0 // indirect - modernc.org/token v1.1.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/go.sum b/go.sum index 17ce90829..96ae8ce8a 100644 --- a/go.sum +++ b/go.sum @@ -474,9 +474,8 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -538,10 +537,7 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -621,8 +617,6 @@ github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6K github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= @@ -676,9 +670,8 @@ github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebG github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mholt/archiver/v4 v4.0.0-alpha.8 h1:tRGQuDVPh66WCOelqe6LIGh0gwmfwxUrSSDunscGsRM= github.com/mholt/archiver/v4 v4.0.0-alpha.8/go.mod h1:5f7FUYGXdJWUjESffJaYR4R60VhnHxb2X3T1teMyv5A= @@ -1518,20 +1511,24 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= -modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= -modernc.org/libc v1.41.0/go.mod h1:w0eszPsiXoOnoMJgrXjglgLuDy/bt5RR4y3QzUUeodY= +modernc.org/cc/v4 v4.20.0 h1:45Or8mQfbUqJOG9WaxvlFYOAQO0lQ5RvqBcFCXngjxk= +modernc.org/cc/v4 v4.20.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.16.0 h1:ofwORa6vx2FMm0916/CkZjpFPSR70VwTjUCe2Eg5BnA= +modernc.org/ccgo/v4 v4.16.0/go.mod h1:dkNyWIjFrVIZ68DTo36vHK+6/ShBn4ysU61So6PIqCI= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/libc v1.49.3 h1:j2MRCRdwJI2ls/sGbeSk0t2bypOG/uvPZUsGQFDulqg= modernc.org/libc v1.49.3/go.mod h1:yMZuGkn7pXbKfoT/M35gFJOAEdSKdxL0q64sF7KqCDo= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= -modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= -modernc.org/sqlite v1.29.1 h1:19GY2qvWB4VPw0HppFlZCPAbmxFU41r+qjKZQdQ1ryA= -modernc.org/sqlite v1.29.1/go.mod h1:hG41jCYxOAOoO6BRK66AdRlmOcDzXf7qnwlwjUIOqa0= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= modernc.org/sqlite v1.29.7 h1:Puwf5TIYuOipbcRnpFnLlGlR03DKenw8ggf3ijnuNQ0= modernc.org/sqlite v1.29.7/go.mod h1:lQPm27iqa4UNZpmr4Aor0MH0HkCLbt1huYDfWylLZFk= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=