Some checks failed
Build Multi-Platform Binaries / build-frontend (push) Successful in 30s
Build Multi-Platform Binaries / build-binaries (amd64, darwin, server, false) (push) Successful in 1m4s
Build Multi-Platform Binaries / build-binaries (amd64, linux, client, true) (push) Successful in 45s
Build Multi-Platform Binaries / build-binaries (amd64, linux, server, true) (push) Successful in 1m29s
Build Multi-Platform Binaries / build-binaries (amd64, windows, client, true) (push) Successful in 45s
Build Multi-Platform Binaries / build-binaries (amd64, windows, server, true) (push) Successful in 1m27s
Build Multi-Platform Binaries / build-binaries (arm, 7, linux, client, true) (push) Successful in 50s
Build Multi-Platform Binaries / build-binaries (arm, 7, linux, server, true) (push) Successful in 1m42s
Build Multi-Platform Binaries / build-binaries (arm64, darwin, server, false) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, linux, client, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, linux, server, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, windows, server, false) (push) Has been cancelled
2374 lines
81 KiB
JSON
2374 lines
81 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "GoTunnel 内网穿透服务器 API",
|
|
"title": "GoTunnel API",
|
|
"contact": {},
|
|
"version": "1.0"
|
|
},
|
|
"host": "localhost:7500",
|
|
"basePath": "/",
|
|
"paths": {
|
|
"/api/auth/check": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "验证 JWT token 是否有效",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"认证"
|
|
],
|
|
"summary": "检查 Token",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.TokenCheckResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/auth/login": {
|
|
"post": {
|
|
"description": "使用用户名密码登录,返回 JWT token",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"认证"
|
|
],
|
|
"summary": "用户登录",
|
|
"parameters": [
|
|
{
|
|
"description": "登录信息",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.LoginResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client-plugin/{clientID}/{pluginName}/config": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "获取客户端上指定插件的配置",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "获取客户端插件配置",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "clientID",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "pluginName",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.PluginConfigResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "更新客户端上指定插件的配置",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "更新客户端插件配置",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "clientID",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "pluginName",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "配置内容",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.PluginConfigRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "获取指定客户端的详细信息",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "获取客户端详情",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ClientResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "更新指定客户端的配置信息",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "更新客户端配置",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "更新内容",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.UpdateClientRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "删除指定的客户端配置",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "删除客户端",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}/disconnect": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "强制断开客户端连接",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "断开连接",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}/install-plugins": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "将指定插件安装到客户端",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "安装插件",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "插件列表",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.InstallPluginsRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}/plugin/{pluginName}/{action}": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "对客户端插件执行操作(stop/restart/config/delete)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "插件操作",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "pluginName",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"enum": [
|
|
"stop",
|
|
"restart",
|
|
"config",
|
|
"delete"
|
|
],
|
|
"type": "string",
|
|
"description": "操作类型",
|
|
"name": "action",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "操作参数",
|
|
"name": "request",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ClientPluginActionRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}/push": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "将配置推送到在线客户端",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "推送配置",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/client/{id}/restart": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "发送重启命令到客户端",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "重启客户端",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/clients": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回所有注册客户端的列表及其在线状态",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "获取所有客户端",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ClientListItem"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "创建一个新的客户端配置",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"客户端"
|
|
],
|
|
"summary": "创建新客户端",
|
|
"parameters": [
|
|
{
|
|
"description": "客户端信息",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.CreateClientRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/config": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回服务器配置(敏感信息脱敏)",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"配置"
|
|
],
|
|
"summary": "获取配置",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ServerConfigResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "更新服务器配置",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"配置"
|
|
],
|
|
"summary": "更新配置",
|
|
"parameters": [
|
|
{
|
|
"description": "配置内容",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.UpdateServerConfigRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/config/reload": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "重新加载服务器配置",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"配置"
|
|
],
|
|
"summary": "重新加载配置",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/js-plugin/{name}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "获取指定 JS 插件的详细信息",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "获取 JS 插件详情",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_db.JSPlugin"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "更新指定 JS 插件的信息",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "更新 JS 插件",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "更新内容",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.JSPluginUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "删除指定的 JS 插件",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "删除 JS 插件",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/js-plugin/{name}/push/{clientID}": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "将 JS 插件推送到指定客户端",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "推送插件到客户端",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "客户端ID",
|
|
"name": "clientID",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/js-plugins": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回所有注册的 JS 插件",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "获取所有 JS 插件",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_db.JSPlugin"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "创建新的 JS 插件",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"JS插件"
|
|
],
|
|
"summary": "创建 JS 插件",
|
|
"parameters": [
|
|
{
|
|
"description": "插件信息",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.JSPluginCreateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/plugin/{name}/disable": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "禁用指定插件",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "禁用插件",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/plugin/{name}/enable": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "启用指定插件",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "启用插件",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "插件名称",
|
|
"name": "name",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/plugins": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回服务端所有注册的插件",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "获取所有插件",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.PluginInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/rule-schemas": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回所有协议类型的配置模式",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件"
|
|
],
|
|
"summary": "获取规则模式",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.RuleSchema"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/status": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回服务器运行状态和客户端数量",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"状态"
|
|
],
|
|
"summary": "获取服务器状态",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.StatusResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/store/install": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "从插件商店下载并安装插件到指定客户端",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件商店"
|
|
],
|
|
"summary": "安装商店插件",
|
|
"parameters": [
|
|
{
|
|
"description": "安装请求",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.StoreInstallRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"502": {
|
|
"description": "Bad Gateway",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/store/plugins": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "从远程插件商店获取可用插件列表",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"插件商店"
|
|
],
|
|
"summary": "获取商店插件",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"plugins": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.StorePluginInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"502": {
|
|
"description": "Bad Gateway",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update/apply/client": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "向指定客户端推送更新命令",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"更新"
|
|
],
|
|
"summary": "推送客户端更新",
|
|
"parameters": [
|
|
{
|
|
"description": "更新请求",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ApplyClientUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update/apply/server": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "下载并应用服务端更新,服务器将自动重启",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"更新"
|
|
],
|
|
"summary": "应用服务端更新",
|
|
"parameters": [
|
|
{
|
|
"description": "更新请求",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ApplyServerUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update/check/client": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "检查是否有新的客户端版本可用",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"更新"
|
|
],
|
|
"summary": "检查客户端更新",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"linux",
|
|
"darwin",
|
|
"windows"
|
|
],
|
|
"type": "string",
|
|
"description": "操作系统",
|
|
"name": "os",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"enum": [
|
|
"amd64",
|
|
"arm64",
|
|
"386",
|
|
"arm"
|
|
],
|
|
"type": "string",
|
|
"description": "架构",
|
|
"name": "arch",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.CheckUpdateResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update/check/server": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "检查是否有新的服务端版本可用",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"更新"
|
|
],
|
|
"summary": "检查服务端更新",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.CheckUpdateResponse"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/update/version": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"description": "返回服务器版本信息",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"状态"
|
|
],
|
|
"summary": "获取版本信息",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/internal_server_router_handler.Response"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.VersionInfo"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"github_com_gotunnel_internal_server_db.ClientPlugin": {
|
|
"type": "object",
|
|
"properties": {
|
|
"config": {
|
|
"description": "插件配置",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_db.JSPlugin": {
|
|
"type": "object",
|
|
"properties": {
|
|
"author": {
|
|
"type": "string"
|
|
},
|
|
"auto_push": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"auto_start": {
|
|
"type": "boolean"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"signature": {
|
|
"description": "官方签名 (Base64)",
|
|
"type": "string"
|
|
},
|
|
"source": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ApplyClientUpdateRequest": {
|
|
"description": "推送更新到客户端",
|
|
"type": "object",
|
|
"required": [
|
|
"client_id",
|
|
"download_url"
|
|
],
|
|
"properties": {
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"download_url": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ApplyServerUpdateRequest": {
|
|
"description": "应用服务端更新",
|
|
"type": "object",
|
|
"required": [
|
|
"download_url"
|
|
],
|
|
"properties": {
|
|
"download_url": {
|
|
"type": "string"
|
|
},
|
|
"restart": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.CheckUpdateResponse": {
|
|
"description": "更新检查结果",
|
|
"type": "object",
|
|
"properties": {
|
|
"current_version": {
|
|
"type": "string"
|
|
},
|
|
"download_url": {
|
|
"type": "string"
|
|
},
|
|
"has_update": {
|
|
"type": "boolean"
|
|
},
|
|
"latest_version": {
|
|
"type": "string"
|
|
},
|
|
"published_at": {
|
|
"type": "string"
|
|
},
|
|
"release_notes": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ClientListItem": {
|
|
"description": "客户端列表中的单个项目",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"example": "client-001"
|
|
},
|
|
"last_ping": {
|
|
"type": "string"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"example": "My Client"
|
|
},
|
|
"online": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"remote_addr": {
|
|
"type": "string"
|
|
},
|
|
"rule_count": {
|
|
"type": "integer",
|
|
"example": 3
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ClientPluginActionRequest": {
|
|
"description": "对客户端插件执行操作",
|
|
"type": "object",
|
|
"properties": {
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"restart": {
|
|
"type": "boolean"
|
|
},
|
|
"rule_name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ClientResponse": {
|
|
"description": "客户端详细信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"example": "client-001"
|
|
},
|
|
"last_ping": {
|
|
"type": "string",
|
|
"example": "2025-01-02T10:30:00Z"
|
|
},
|
|
"nickname": {
|
|
"type": "string",
|
|
"example": "My Client"
|
|
},
|
|
"online": {
|
|
"type": "boolean",
|
|
"example": true
|
|
},
|
|
"plugins": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_db.ClientPlugin"
|
|
}
|
|
},
|
|
"remote_addr": {
|
|
"type": "string",
|
|
"example": "192.168.1.100:54321"
|
|
},
|
|
"rules": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_pkg_protocol.ProxyRule"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ConfigField": {
|
|
"description": "配置表单字段",
|
|
"type": "object",
|
|
"properties": {
|
|
"default": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"key": {
|
|
"type": "string"
|
|
},
|
|
"label": {
|
|
"type": "string"
|
|
},
|
|
"options": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": {
|
|
"type": "boolean"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.CreateClientRequest": {
|
|
"description": "创建新客户端的请求体",
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"maxLength": 64,
|
|
"minLength": 1,
|
|
"example": "client-001"
|
|
},
|
|
"rules": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_pkg_protocol.ProxyRule"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.InstallPluginsRequest": {
|
|
"description": "安装插件到指定客户端",
|
|
"type": "object",
|
|
"required": [
|
|
"plugins"
|
|
],
|
|
"properties": {
|
|
"plugins": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"socks5",
|
|
"http-proxy"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.JSPluginCreateRequest": {
|
|
"description": "创建新的 JS 插件",
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"source"
|
|
],
|
|
"properties": {
|
|
"author": {
|
|
"type": "string",
|
|
"maxLength": 64
|
|
},
|
|
"auto_start": {
|
|
"type": "boolean"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 64,
|
|
"minLength": 1
|
|
},
|
|
"signature": {
|
|
"type": "string"
|
|
},
|
|
"source": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.JSPluginUpdateRequest": {
|
|
"description": "更新 JS 插件",
|
|
"type": "object",
|
|
"properties": {
|
|
"author": {
|
|
"type": "string",
|
|
"maxLength": 64
|
|
},
|
|
"auto_start": {
|
|
"type": "boolean"
|
|
},
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 500
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"signature": {
|
|
"type": "string"
|
|
},
|
|
"source": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.LoginRequest": {
|
|
"description": "用户登录",
|
|
"type": "object",
|
|
"required": [
|
|
"password",
|
|
"username"
|
|
],
|
|
"properties": {
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.LoginResponse": {
|
|
"description": "登录成功返回",
|
|
"type": "object",
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.PluginConfigRequest": {
|
|
"description": "更新客户端插件配置",
|
|
"type": "object",
|
|
"required": [
|
|
"config"
|
|
],
|
|
"properties": {
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.PluginConfigResponse": {
|
|
"description": "插件配置详情",
|
|
"type": "object",
|
|
"properties": {
|
|
"config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"plugin_name": {
|
|
"type": "string"
|
|
},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ConfigField"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.PluginInfo": {
|
|
"description": "服务端插件信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"icon": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"rule_schema": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.RuleSchema"
|
|
},
|
|
"source": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.RuleSchema": {
|
|
"description": "代理规则的配置模式",
|
|
"type": "object",
|
|
"properties": {
|
|
"extra_fields": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ConfigField"
|
|
}
|
|
},
|
|
"needs_local_addr": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ServerConfigInfo": {
|
|
"type": "object",
|
|
"properties": {
|
|
"bind_addr": {
|
|
"type": "string"
|
|
},
|
|
"bind_port": {
|
|
"type": "integer"
|
|
},
|
|
"heartbeat_sec": {
|
|
"type": "integer"
|
|
},
|
|
"heartbeat_timeout": {
|
|
"type": "integer"
|
|
},
|
|
"token": {
|
|
"description": "脱敏后的 token",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ServerConfigPart": {
|
|
"description": "隧道服务器配置",
|
|
"type": "object",
|
|
"properties": {
|
|
"bind_addr": {
|
|
"type": "string"
|
|
},
|
|
"bind_port": {
|
|
"type": "integer",
|
|
"maximum": 65535,
|
|
"minimum": 1
|
|
},
|
|
"heartbeat_sec": {
|
|
"type": "integer",
|
|
"maximum": 300,
|
|
"minimum": 1
|
|
},
|
|
"heartbeat_timeout": {
|
|
"type": "integer",
|
|
"maximum": 600,
|
|
"minimum": 1
|
|
},
|
|
"token": {
|
|
"type": "string",
|
|
"minLength": 8
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ServerConfigResponse": {
|
|
"description": "服务器配置信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ServerConfigInfo"
|
|
},
|
|
"web": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.WebConfigInfo"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.ServerStatus": {
|
|
"type": "object",
|
|
"properties": {
|
|
"bind_addr": {
|
|
"type": "string"
|
|
},
|
|
"bind_port": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.StatusResponse": {
|
|
"description": "服务器状态信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"client_count": {
|
|
"type": "integer"
|
|
},
|
|
"server": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ServerStatus"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.StoreInstallRequest": {
|
|
"description": "从插件商店安装插件到客户端",
|
|
"type": "object",
|
|
"required": [
|
|
"client_id",
|
|
"download_url",
|
|
"plugin_name",
|
|
"signature_url"
|
|
],
|
|
"properties": {
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"download_url": {
|
|
"type": "string"
|
|
},
|
|
"plugin_name": {
|
|
"type": "string"
|
|
},
|
|
"signature_url": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.StorePluginInfo": {
|
|
"description": "插件商店中的插件信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"author": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"download_url": {
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"signature_url": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.TokenCheckResponse": {
|
|
"description": "Token 验证结果",
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"valid": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.UpdateClientRequest": {
|
|
"description": "更新客户端配置的请求体",
|
|
"type": "object",
|
|
"properties": {
|
|
"nickname": {
|
|
"type": "string",
|
|
"maxLength": 128,
|
|
"example": "My Client"
|
|
},
|
|
"plugins": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_db.ClientPlugin"
|
|
}
|
|
},
|
|
"rules": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/github_com_gotunnel_pkg_protocol.ProxyRule"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.UpdateServerConfigRequest": {
|
|
"description": "更新服务器配置",
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.ServerConfigPart"
|
|
},
|
|
"web": {
|
|
"$ref": "#/definitions/github_com_gotunnel_internal_server_router_dto.WebConfigPart"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.VersionInfo": {
|
|
"description": "当前版本信息",
|
|
"type": "object",
|
|
"properties": {
|
|
"build_time": {
|
|
"type": "string"
|
|
},
|
|
"git_commit": {
|
|
"type": "string"
|
|
},
|
|
"go_version": {
|
|
"type": "string"
|
|
},
|
|
"platform": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.WebConfigInfo": {
|
|
"type": "object",
|
|
"properties": {
|
|
"bind_addr": {
|
|
"type": "string"
|
|
},
|
|
"bind_port": {
|
|
"type": "integer"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"password": {
|
|
"description": "显示为 ****",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_internal_server_router_dto.WebConfigPart": {
|
|
"description": "Web 控制台配置",
|
|
"type": "object",
|
|
"properties": {
|
|
"bind_addr": {
|
|
"type": "string"
|
|
},
|
|
"bind_port": {
|
|
"type": "integer",
|
|
"maximum": 65535,
|
|
"minimum": 1
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"maxLength": 64,
|
|
"minLength": 6
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"maxLength": 32,
|
|
"minLength": 3
|
|
}
|
|
}
|
|
},
|
|
"github_com_gotunnel_pkg_protocol.ProxyRule": {
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"description": "是否启用,默认为 true",
|
|
"type": "boolean"
|
|
},
|
|
"local_ip": {
|
|
"description": "tcp/udp 模式使用",
|
|
"type": "string"
|
|
},
|
|
"local_port": {
|
|
"description": "tcp/udp 模式使用",
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"plugin_config": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"plugin_name": {
|
|
"description": "Plugin 支持字段",
|
|
"type": "string"
|
|
},
|
|
"plugin_version": {
|
|
"type": "string"
|
|
},
|
|
"remote_port": {
|
|
"description": "服务端监听端口",
|
|
"type": "integer"
|
|
},
|
|
"type": {
|
|
"description": "内置: tcp, udp, http, https; 插件: socks5 等",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_server_router_handler.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer"
|
|
},
|
|
"data": {},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"Bearer": {
|
|
"description": "JWT Bearer token",
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
} |