From 71ebfa555f573af5472e7e269054d3cf68f7704f Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 19 Jun 2026 11:08:06 +0800 Subject: [PATCH] refactor(api): unify routes under /api/v1/d, agent, relay, tunnel Remove the /openflare prefix from management APIs (/api/v1/d/*) and move Agent, Relay, and Tunnel protocol endpoints under /api/v1. Update Wavelet frontend services and node client binaries to match. --- Wavelet/docs/docs.go | 15358 +++++++--------- Wavelet/docs/swagger.json | 15358 +++++++--------- Wavelet/docs/swagger.yaml | 9339 +++++----- .../services/openflare/access-log.service.ts | 2 +- .../services/openflare/apply-log.service.ts | 2 +- .../lib/services/openflare/base.service.ts | 2 +- .../openflare/config-version.service.ts | 2 +- .../services/openflare/dashboard.service.ts | 2 +- .../services/openflare/dns-account.service.ts | 2 +- .../lib/services/openflare/node.service.ts | 2 +- .../lib/services/openflare/option.service.ts | 2 +- .../lib/services/openflare/origin.service.ts | 2 +- .../lib/services/openflare/pages.service.ts | 2 +- .../services/openflare/proxy-route.service.ts | 2 +- .../openflare/tls-certificate.service.ts | 4 +- .../lib/services/openflare/update.service.ts | 4 +- .../services/openflare/uptimekuma.service.ts | 2 +- .../lib/services/openflare/waf.service.ts | 2 +- .../lib/services/openflare/website.service.ts | 2 +- .../apps/openflare/apply_log/routers.go | 4 +- .../apps/openflare/config_version/routers.go | 16 +- .../apps/openflare/dashboard/routers.go | 2 +- .../integration/agent_protocol_test.go | 10 +- .../openflare/integration/core_chain_test.go | 2 +- .../openflare/integration/helpers_test.go | 2 - .../internal/apps/openflare/node/routers.go | 24 +- .../apps/openflare/observability/routers.go | 12 +- .../internal/apps/openflare/option/routers.go | 20 +- .../internal/apps/openflare/origin/routers.go | 10 +- .../internal/apps/openflare/pages/routers.go | 20 +- .../apps/openflare/proxy_route/routers.go | 10 +- .../internal/apps/openflare/tls/routers.go | 42 +- .../internal/apps/openflare/update/routers.go | 10 +- .../internal/apps/openflare/waf/routers.go | 30 +- Wavelet/internal/router/router.go | 5 - .../internal/router/v1/openflare/openflare.go | 14 +- .../router/v1/openflare/register_agent.go | 4 +- .../v1/openflare/register_relay_flared.go | 18 +- Wavelet/internal/router/v1/openflare/v1.go | 6 +- Wavelet/internal/router/v1/v1.go | 3 +- docs/changelog/index.md | 4 + openflare-agent/internal/agent/runner_test.go | 2 +- openflare-agent/internal/httpclient/client.go | 12 +- openflare-agent/internal/wsclient/client.go | 2 +- openflare-relay/internal/httpclient/client.go | 2 +- openflare-relay/internal/wsclient/client.go | 2 +- openflared/internal/httpclient/client.go | 6 +- openflared/internal/wsclient/client.go | 2 +- 48 files changed, 18463 insertions(+), 21924 deletions(-) diff --git a/Wavelet/docs/docs.go b/Wavelet/docs/docs.go index 67fb5d2d..c31b463d 100644 --- a/Wavelet/docs/docs.go +++ b/Wavelet/docs/docs.go @@ -928,231 +928,6 @@ const docTemplate = `{ } } }, - "/api/v1/admin/logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取系统历史日志,cursor=0 获取最新日志,cursor\u003e0 获取更早日志", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取系统日志", - "parameters": [ - { - "type": "integer", - "default": 0, - "description": "日志游标,0=获取最新", - "name": "cursor", - "in": "query" - }, - { - "type": "integer", - "default": 200, - "description": "每页条数", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.logsResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/access": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页并按照用户、接口路径、时间范围等维度检索 ClickHouse 用户访问日志列表(需要管理员权限,ClickHouse 未启用时报错)", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取用户访问日志", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "用户名模糊搜索", - "name": "username", - "in": "query" - }, - { - "type": "string", - "description": "接口路径模糊搜索", - "name": "path", - "in": "query" - }, - { - "type": "string", - "description": "起始时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", - "name": "start_time", - "in": "query" - }, - { - "type": "string", - "description": "结束时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", - "name": "end_time", - "in": "query" - } - ], - "responses": { - "200": { - "description": "访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.accessLogsResponse" - } - } - } - ] - } - }, - "400": { - "description": "ClickHouse 未启用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/analytics": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,ClickHouse 未启用时报错)", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取访问日志分析数据", - "responses": { - "200": { - "description": "分析统计数据", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.logsAnalyticsResponse" - } - } - } - ] - } - }, - "400": { - "description": "ClickHouse 未启用", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/ws": { - "get": { - "description": "通过 WebSocket 实时推送系统日志,需要管理员权限", - "tags": [ - "admin" - ], - "summary": "系统日志实时推送", - "responses": {} - } - }, "/api/v1/admin/push/channels": { "get": { "security": [ @@ -3301,362 +3076,6 @@ const docTemplate = `{ } } }, - "/api/v1/admin/uploads": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件列表", - "parameters": [ - { - "type": "integer", - "description": "页码(默认 1)", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(默认 20,最大 100)", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "文件名关键词(模糊匹配)", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "业务分类过滤", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "扩展名过滤", - "name": "extension", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "上传用户 ID", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "查询成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.listFilesResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/download/batch": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "传入多个文件 ID,后台实时将其打包压缩为 ZIP 流并输出,自动处理文件名重复冲突", - "consumes": [ - "application/json" - ], - "produces": [ - "application/octet-stream" - ], - "tags": [ - "admin" - ], - "summary": "批量打包下载", - "parameters": [ - { - "description": "包含文件 ID 数组 of string 的请求体", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handler.batchDownloadRequest" - } - } - ], - "responses": { - "200": { - "description": "成功下载打包后的 ZIP", - "schema": { - "type": "file" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "打包失败", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/download/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "根据文件 ID 获取文件,以附件形式 (Attachment) 强制开启客户端浏览器下载", - "produces": [ - "application/octet-stream" - ], - "tags": [ - "admin" - ], - "summary": "下载单文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "图片质量 (low, medium, high, origin),默认为 origin", - "name": "quality", - "in": "query" - } - ], - "responses": { - "200": { - "description": "成功下载文件", - "schema": { - "type": "file" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "服务内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/stats": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件统计数据", - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.fileStatsResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/types": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件业务类型列表", - "responses": { - "200": { - "description": "业务类型列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/{id}": { - "delete": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "删除文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/api/v1/admin/users": { "get": { "security": [ @@ -4109,6 +3528,7028 @@ const docTemplate = `{ } } }, + "/api/v1/d/about": { + "get": { + "description": "返回 OpenFlare 关于页面文本,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取关于信息", + "responses": { + "200": { + "description": "关于信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出访问日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "访问日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按保留天数清理过期访问日志记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "清理访问日志", + "parameters": [ + { + "description": "清理参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/observability.AccessLogCleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/folds": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按时间桶聚合访问日志并分页返回,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出折叠访问日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "integer", + "description": "折叠时间窗口(分钟)", + "name": "fold_minutes", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "折叠访问日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.FoldedAccessLogList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/folds/ip-summary": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "在指定时间桶内按 IP 聚合访问统计,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出折叠访问日志 IP 汇总", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "时间桶起始时间", + "name": "bucket_started_at", + "in": "query" + }, + { + "type": "integer", + "description": "折叠时间窗口(分钟)", + "name": "fold_minutes", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "折叠 IP 汇总列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.FoldedAccessLogIPList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/ip-summary": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 IP 聚合访问日志统计并分页返回,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出访问日志 IP 汇总", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "IP 汇总列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogIPSummaryList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/ip-summary/trend": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "获取访问日志 IP 趋势", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "integer", + "description": "统计时间范围(小时)", + "name": "hours", + "in": "query" + }, + { + "type": "integer", + "description": "时间桶粒度(分钟)", + "name": "bucket_minutes", + "in": "query" + } + ], + "responses": { + "200": { + "description": "IP 访问趋势", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogIPTrendView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/acme-accounts/default": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回系统默认 ACME 账号配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取默认 ACME 账号", + "responses": { + "200": { + "description": "默认 ACME 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AcmeAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/apply-logs": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-apply-log" + ], + "summary": "获取配置下发日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID 筛选", + "name": "node_id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "pageNo", + "in": "query" + }, + { + "type": "integer", + "description": "页码(别名)", + "name": "page_no", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量(别名)", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "下发日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apply_log.ListResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/apply-logs/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按保留天数清理历史下发记录,或删除全部记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-apply-log" + ], + "summary": "清理配置下发日志", + "parameters": [ + { + "description": "清理参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apply_log.CleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apply_log.CleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取配置版本列表", + "responses": { + "200": { + "description": "配置版本列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ConfigVersionSummary" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/active": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回当前正在使用的配置版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取当前活跃配置版本", + "responses": { + "200": { + "description": "活跃配置版本", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限、不存在或无活跃版本", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除超出保留数量的非活跃配置版本,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "清理历史配置版本", + "parameters": [ + { + "description": "清理参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/config_version.CleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.CleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/diff": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "对比当前草稿配置与活跃版本之间的差异,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "对比草稿与活跃配置", + "responses": { + "200": { + "description": "配置差异", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.ConfigDiffResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/preview": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "渲染并返回当前草稿配置的预览结果,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "预览当前草稿配置", + "responses": { + "200": { + "description": "配置预览", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.ConfigPreviewResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/publish": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将当前草稿配置发布为新版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "发布配置版本", + "parameters": [ + { + "type": "boolean", + "description": "是否强制发布", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "发布成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定配置版本的完整快照与渲染内容,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取配置版本详情", + "parameters": [ + { + "type": "integer", + "description": "配置版本 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "配置版本详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或版本不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/{id}/activate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定历史版本设为当前活跃配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "激活配置版本", + "parameters": [ + { + "type": "integer", + "description": "配置版本 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "激活成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或版本不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dashboard/overview": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-dashboard" + ], + "summary": "获取仪表盘概览", + "responses": { + "200": { + "description": "仪表盘概览", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/dashboard.OverviewPayload" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 DNS 提供商账号,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出 DNS 账号", + "responses": { + "200": { + "description": "DNS 账号列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 DNS 提供商账号,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建 DNS 账号", + "parameters": [ + { + "description": "DNS 账号参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.DNSAccountInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的 DNS 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 DNS 提供商账号,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除 DNS 账号", + "parameters": [ + { + "type": "integer", + "description": "DNS 账号 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 DNS 提供商账号,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 DNS 账号", + "parameters": [ + { + "type": "integer", + "description": "DNS 账号 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "DNS 账号参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.DNSAccountInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的 DNS 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部托管域名及关联证书,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出托管域名", + "responses": { + "200": { + "description": "托管域名列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的托管域名记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建托管域名", + "parameters": [ + { + "description": "托管域名参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ManagedDomainInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的托管域名", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/match": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按域名查询可用的证书匹配候选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "匹配托管域名证书", + "parameters": [ + { + "type": "string", + "description": "域名", + "name": "domain", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "证书匹配结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/tls.ManagedDomainMatchResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除托管域名,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除托管域名", + "parameters": [ + { + "type": "integer", + "description": "托管域名 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新托管域名,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新托管域名", + "parameters": [ + { + "type": "integer", + "description": "托管域名 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "托管域名参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ManagedDomainInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的托管域名", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有节点及最新配置下发记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取节点列表", + "responses": { + "200": { + "description": "节点列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/node.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的边缘节点记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "创建节点", + "parameters": [ + { + "description": "节点参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/node.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/bootstrap-token": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全局节点发现引导令牌,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取引导令牌", + "responses": { + "200": { + "description": "引导令牌", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.BootstrapView" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/bootstrap-token/rotate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "重新生成全局节点发现引导令牌,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "轮换引导令牌", + "responses": { + "200": { + "description": "新引导令牌", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.BootstrapView" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/agent-release": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定节点可用的最新 Agent 版本信息,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取 Agent 发布信息", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "发布渠道", + "name": "channel", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Agent 发布信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.AgentReleaseInfo" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/agent-update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发 Agent 自更新指令,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求 Agent 更新", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "更新参数(可选)", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/node.AgentUpdateInput" + } + } + ], + "responses": { + "200": { + "description": "更新请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定节点记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "删除节点", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/force-sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发强制同步当前活跃配置的指令,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求强制同步配置", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "同步请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/observability": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定节点的指标、健康事件与流量分析数据,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取节点可观测性数据", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "统计时间范围(小时)", + "name": "hours", + "in": "query" + }, + { + "type": "integer", + "description": "返回记录数量上限", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "可观测性数据", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.ObservabilityView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/observability/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "清理指定节点的历史健康事件记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "清理节点健康事件", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.HealthEventCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/openresty-restart": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发 OpenResty 重启指令,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求重启 OpenResty", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "重启请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定节点的配置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "更新节点", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "节点参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/node.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/notice": { + "get": { + "description": "返回 OpenFlare 控制台公告文本,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取系统公告", + "responses": { + "200": { + "description": "系统公告", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部非敏感 OpenFlare 配置项,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "列出 OpenFlare 配置项", + "responses": { + "200": { + "description": "配置项列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OpenFlareOption" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/database/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按目标与保留天数清理可观测性相关数据表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "清理可观测性数据库", + "parameters": [ + { + "description": "清理参数", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/option.databaseCleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.databaseCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/geoip/lookup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按提供商与 IP 查询地理位置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "GeoIP 地址查询", + "parameters": [ + { + "description": "查询参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/option.geoIPLookupRequest" + } + } + ], + "responses": { + "200": { + "description": "GeoIP 查询结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.geoIPLookupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新单个 OpenFlare 配置项,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "更新 OpenFlare 配置项", + "parameters": [ + { + "description": "配置项", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.OpenFlareOption" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/update-batch": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "批量更新多个 OpenFlare 配置项,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "批量更新 OpenFlare 配置项", + "parameters": [ + { + "description": "批量配置项", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/option.optionBatchPayload" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有源站及关联代理规则数量,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "获取源站列表", + "responses": { + "200": { + "description": "源站列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/origin.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的上游源站记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "创建源站", + "parameters": [ + { + "description": "源站参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/origin.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定源站信息及关联代理规则摘要,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "获取源站详情", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "源站详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.DetailView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定源站记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "删除源站", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定源站的配置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "更新源站", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "源站参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/origin.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 OpenFlare Pages 项目,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 项目", + "responses": { + "200": { + "description": "Pages 项目列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 OpenFlare Pages 项目,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "创建 Pages 项目", + "parameters": [ + { + "description": "项目参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pages.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/deployments/{deployment_id}/files": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定部署包含的文件清单,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 部署文件", + "parameters": [ + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "部署文件列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.DeploymentFileView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 Pages 项目详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "获取 Pages 项目详情", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Pages 项目详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 OpenFlare Pages 项目,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "删除 Pages 项目", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定项目的全部部署记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "部署列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.DeploymentView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/upload": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "为指定项目上传 ZIP 部署包,需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "上传 Pages 部署包", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "部署包 ZIP 文件", + "name": "package", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "部署记录", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.DeploymentView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/{deployment_id}/activate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定部署设为项目当前生效版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "激活 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "激活后的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目或部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/{deployment_id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定项目的部署记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "删除 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目或部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 OpenFlare Pages 项目,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "更新 Pages 项目", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "项目参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pages.Input" + } + } + ], + "responses": { + "200": { + "description": "更新后的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有代理规则配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "获取代理规则列表", + "responses": { + "200": { + "description": "代理规则列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的反向代理规则,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "创建代理规则", + "parameters": [ + { + "description": "代理规则参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/proxy_route.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定代理规则的完整配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "获取代理规则详情", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "代理规则详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定代理规则,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "删除代理规则", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定代理规则的配置,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "更新代理规则", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "代理规则参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/proxy_route.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/status": { + "get": { + "description": "返回版本、认证源与系统公开配置,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取 OpenFlare 公开状态", + "responses": { + "200": { + "description": "公开状态", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.statusView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 TLS 证书(不含 PEM),需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出 TLS 证书", + "responses": { + "200": { + "description": "证书列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "从 PEM 文本创建 TLS 证书,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建 TLS 证书", + "parameters": [ + { + "description": "证书参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.CertificateInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/apply": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "通过 ACME 申请新的 TLS 证书,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "申请 ACME 证书", + "parameters": [ + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "申请中的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/import-file": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "上传证书与私钥文件创建 TLS 证书,需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "从文件导入 TLS 证书", + "parameters": [ + { + "type": "string", + "description": "证书名称", + "name": "name", + "in": "formData" + }, + { + "type": "string", + "description": "备注", + "name": "remark", + "in": "formData" + }, + { + "type": "file", + "description": "证书文件", + "name": "cert_file", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "私钥文件", + "name": "key_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "导入成功的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取 TLS 证书详情", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "证书详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/content": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回证书与私钥 PEM 内容,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取 TLS 证书 PEM 内容", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "证书 PEM 内容", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/tls.CertificateContent" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/convert-acme": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将已上传证书转换为 ACME 自动续期模式,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "将证书转为 ACME 管理", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "转换后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 TLS 证书,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除 TLS 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/renew": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "手动触发 ACME 证书续期,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "续期 ACME 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "续期后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 TLS 证书 PEM 信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 TLS 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "证书参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.CertificateInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/update-acme": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 ACME 证书申请配置,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 ACME 证书配置", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/latest-release": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "获取最新服务端发布版本", + "parameters": [ + { + "type": "string", + "description": "发布渠道(stable/preview)", + "name": "channel", + "in": "query" + } + ], + "responses": { + "200": { + "description": "最新发布信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/update.LatestReleaseView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/logs/ws": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "通过 WebSocket 推送升级进度快照,需要管理员权限", + "tags": [ + "openflare-update" + ], + "summary": "流式获取服务端升级日志", + "responses": { + "101": { + "description": "WebSocket 升级日志流", + "schema": { + "$ref": "#/definitions/update.StreamSnapshot" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/manual-upgrade": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "确认手动服务端升级", + "responses": { + "400": { + "description": "功能已禁用或参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/manual-upload": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "上传手动升级二进制", + "parameters": [ + { + "type": "file", + "description": "服务端二进制文件", + "name": "binary", + "in": "formData", + "required": true + } + ], + "responses": { + "400": { + "description": "功能已禁用或参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/upgrade": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "触发服务端自动升级", + "parameters": [ + { + "description": "升级参数", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/update.upgradeRequest" + } + } + ], + "responses": { + "200": { + "description": "升级任务已调度", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/update.LatestReleaseView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/uptimekuma/sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "同步 Uptime Kuma", + "responses": { + "200": { + "description": "同步成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 WAF IP 组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "列出 WAF IP 组", + "responses": { + "200": { + "description": "IP 组列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 WAF IP 组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "创建 WAF IP 组", + "parameters": [ + { + "description": "IP 组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的 IP 组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/test": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "测试 WAF IP 组自动配置", + "parameters": [ + { + "description": "自动配置参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupAutoTestInput" + } + } + ], + "responses": { + "200": { + "description": "测试结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupAutoTestResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 WAF IP 组详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取 WAF IP 组详情", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "IP 组详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 WAF IP 组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "删除 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "手动触发 WAF IP 组外部 IP 同步,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "同步 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "同步结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupSyncResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 WAF IP 组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "更新 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "IP 组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的 IP 组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 WAF 规则组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "列出 WAF 规则组", + "responses": { + "200": { + "description": "规则组列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 WAF 规则组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "创建 WAF 规则组", + "parameters": [ + { + "description": "规则组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.RuleGroupInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 WAF 规则组详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取 WAF 规则组详情", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "规则组详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 WAF 规则组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "删除 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/sites": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "替换 WAF 规则组关联的代理站点列表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "替换规则组站点绑定", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "站点 ID 列表", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IDsRequest" + } + } + ], + "responses": { + "200": { + "description": "更新后的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 WAF 规则组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "更新 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "规则组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.RuleGroupInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/sites/{route_id}/rule-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回代理站点关联的 WAF 规则组绑定,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取站点 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "代理路由 ID", + "name": "route_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "站点规则组绑定", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.SiteRuleGroupsView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "替换代理站点关联的 WAF 规则组列表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "替换站点 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "代理路由 ID", + "name": "route_id", + "in": "path", + "required": true + }, + { + "description": "规则组 ID 列表", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IDsRequest" + } + } + ], + "responses": { + "200": { + "description": "更新后的站点规则组绑定", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.SiteRuleGroupsView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -4516,7296 +10957,6 @@ const docTemplate = `{ } } }, - "/api/v1/openflare/about": { - "get": { - "description": "返回 OpenFlare 关于页面文本,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取关于信息", - "responses": { - "200": { - "description": "关于信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出访问日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按保留天数清理过期访问日志记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "清理访问日志", - "parameters": [ - { - "description": "清理参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/observability.AccessLogCleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/folds": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按时间桶聚合访问日志并分页返回,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出折叠访问日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "integer", - "description": "折叠时间窗口(分钟)", - "name": "fold_minutes", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "折叠访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.FoldedAccessLogList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/folds/ip-summary": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "在指定时间桶内按 IP 聚合访问统计,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出折叠访问日志 IP 汇总", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "string", - "description": "时间桶起始时间", - "name": "bucket_started_at", - "in": "query" - }, - { - "type": "integer", - "description": "折叠时间窗口(分钟)", - "name": "fold_minutes", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "折叠 IP 汇总列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.FoldedAccessLogIPList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/ip-summary": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 IP 聚合访问日志统计并分页返回,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出访问日志 IP 汇总", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "IP 汇总列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogIPSummaryList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/ip-summary/trend": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "获取访问日志 IP 趋势", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "integer", - "description": "统计时间范围(小时)", - "name": "hours", - "in": "query" - }, - { - "type": "integer", - "description": "时间桶粒度(分钟)", - "name": "bucket_minutes", - "in": "query" - } - ], - "responses": { - "200": { - "description": "IP 访问趋势", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogIPTrendView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/acme-accounts/default": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回系统默认 ACME 账号配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取默认 ACME 账号", - "responses": { - "200": { - "description": "默认 ACME 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AcmeAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/apply-logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-apply-log" - ], - "summary": "获取配置下发日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID 筛选", - "name": "node_id", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNo", - "in": "query" - }, - { - "type": "integer", - "description": "页码(别名)", - "name": "page_no", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(别名)", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "下发日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/apply_log.ListResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/apply-logs/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按保留天数清理历史下发记录,或删除全部记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-apply-log" - ], - "summary": "清理配置下发日志", - "parameters": [ - { - "description": "清理参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/apply_log.CleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/apply_log.CleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取配置版本列表", - "responses": { - "200": { - "description": "配置版本列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ConfigVersionSummary" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/active": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回当前正在使用的配置版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取当前活跃配置版本", - "responses": { - "200": { - "description": "活跃配置版本", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限、不存在或无活跃版本", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除超出保留数量的非活跃配置版本,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "清理历史配置版本", - "parameters": [ - { - "description": "清理参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/config_version.CleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.CleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/diff": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "对比当前草稿配置与活跃版本之间的差异,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "对比草稿与活跃配置", - "responses": { - "200": { - "description": "配置差异", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.ConfigDiffResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/preview": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "渲染并返回当前草稿配置的预览结果,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "预览当前草稿配置", - "responses": { - "200": { - "description": "配置预览", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.ConfigPreviewResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/publish": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将当前草稿配置发布为新版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "发布配置版本", - "parameters": [ - { - "type": "boolean", - "description": "是否强制发布", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "发布成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定配置版本的完整快照与渲染内容,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取配置版本详情", - "parameters": [ - { - "type": "integer", - "description": "配置版本 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "配置版本详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或版本不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/{id}/activate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将指定历史版本设为当前活跃配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "激活配置版本", - "parameters": [ - { - "type": "integer", - "description": "配置版本 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "激活成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或版本不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dashboard/overview": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-dashboard" - ], - "summary": "获取仪表盘概览", - "responses": { - "200": { - "description": "仪表盘概览", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/dashboard.OverviewPayload" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 DNS 提供商账号,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出 DNS 账号", - "responses": { - "200": { - "description": "DNS 账号列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 DNS 提供商账号,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建 DNS 账号", - "parameters": [ - { - "description": "DNS 账号参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.DNSAccountInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的 DNS 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 DNS 提供商账号,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除 DNS 账号", - "parameters": [ - { - "type": "integer", - "description": "DNS 账号 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 DNS 提供商账号,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 DNS 账号", - "parameters": [ - { - "type": "integer", - "description": "DNS 账号 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "DNS 账号参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.DNSAccountInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的 DNS 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部托管域名及关联证书,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出托管域名", - "responses": { - "200": { - "description": "托管域名列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的托管域名记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建托管域名", - "parameters": [ - { - "description": "托管域名参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ManagedDomainInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的托管域名", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/match": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按域名查询可用的证书匹配候选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "匹配托管域名证书", - "parameters": [ - { - "type": "string", - "description": "域名", - "name": "domain", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "证书匹配结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/tls.ManagedDomainMatchResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除托管域名,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除托管域名", - "parameters": [ - { - "type": "integer", - "description": "托管域名 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新托管域名,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新托管域名", - "parameters": [ - { - "type": "integer", - "description": "托管域名 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "托管域名参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ManagedDomainInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的托管域名", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有节点及最新配置下发记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取节点列表", - "responses": { - "200": { - "description": "节点列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/node.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的边缘节点记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "创建节点", - "parameters": [ - { - "description": "节点参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/node.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/bootstrap-token": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全局节点发现引导令牌,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取引导令牌", - "responses": { - "200": { - "description": "引导令牌", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.BootstrapView" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/bootstrap-token/rotate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "重新生成全局节点发现引导令牌,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "轮换引导令牌", - "responses": { - "200": { - "description": "新引导令牌", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.BootstrapView" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/agent-release": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定节点可用的最新 Agent 版本信息,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取 Agent 发布信息", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "发布渠道", - "name": "channel", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Agent 发布信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.AgentReleaseInfo" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/agent-update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发 Agent 自更新指令,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求 Agent 更新", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "更新参数(可选)", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/node.AgentUpdateInput" - } - } - ], - "responses": { - "200": { - "description": "更新请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定节点记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "删除节点", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/force-sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发强制同步当前活跃配置的指令,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求强制同步配置", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "同步请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/observability": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定节点的指标、健康事件与流量分析数据,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取节点可观测性数据", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "统计时间范围(小时)", - "name": "hours", - "in": "query" - }, - { - "type": "integer", - "description": "返回记录数量上限", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "可观测性数据", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.ObservabilityView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/observability/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "清理指定节点的历史健康事件记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "清理节点健康事件", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.HealthEventCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/openresty-restart": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发 OpenResty 重启指令,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求重启 OpenResty", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "重启请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定节点的配置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "更新节点", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "节点参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/node.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/notice": { - "get": { - "description": "返回 OpenFlare 控制台公告文本,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取系统公告", - "responses": { - "200": { - "description": "系统公告", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部非敏感 OpenFlare 配置项,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "列出 OpenFlare 配置项", - "responses": { - "200": { - "description": "配置项列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.OpenFlareOption" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/database/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按目标与保留天数清理可观测性相关数据表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "清理可观测性数据库", - "parameters": [ - { - "description": "清理参数", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/option.databaseCleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.databaseCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/geoip/lookup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按提供商与 IP 查询地理位置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "GeoIP 地址查询", - "parameters": [ - { - "description": "查询参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/option.geoIPLookupRequest" - } - } - ], - "responses": { - "200": { - "description": "GeoIP 查询结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.geoIPLookupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新单个 OpenFlare 配置项,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "更新 OpenFlare 配置项", - "parameters": [ - { - "description": "配置项", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.OpenFlareOption" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/update-batch": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "批量更新多个 OpenFlare 配置项,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "批量更新 OpenFlare 配置项", - "parameters": [ - { - "description": "批量配置项", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/option.optionBatchPayload" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有源站及关联代理规则数量,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "获取源站列表", - "responses": { - "200": { - "description": "源站列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/origin.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的上游源站记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "创建源站", - "parameters": [ - { - "description": "源站参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/origin.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定源站信息及关联代理规则摘要,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "获取源站详情", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "源站详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.DetailView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定源站记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "删除源站", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定源站的配置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "更新源站", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "源站参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/origin.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 OpenFlare Pages 项目,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 项目", - "responses": { - "200": { - "description": "Pages 项目列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 OpenFlare Pages 项目,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "创建 Pages 项目", - "parameters": [ - { - "description": "项目参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pages.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/deployments/{deployment_id}/files": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定部署包含的文件清单,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 部署文件", - "parameters": [ - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "部署文件列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.DeploymentFileView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 Pages 项目详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "获取 Pages 项目详情", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Pages 项目详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 OpenFlare Pages 项目,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "删除 Pages 项目", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定项目的全部部署记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "部署列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.DeploymentView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "为指定项目上传 ZIP 部署包,需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "上传 Pages 部署包", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "部署包 ZIP 文件", - "name": "package", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "部署记录", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.DeploymentView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/{deployment_id}/activate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将指定部署设为项目当前生效版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "激活 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "激活后的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目或部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/{deployment_id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定项目的部署记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "删除 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目或部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 OpenFlare Pages 项目,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "更新 Pages 项目", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "项目参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pages.Input" - } - } - ], - "responses": { - "200": { - "description": "更新后的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有代理规则配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "获取代理规则列表", - "responses": { - "200": { - "description": "代理规则列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的反向代理规则,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "创建代理规则", - "parameters": [ - { - "description": "代理规则参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/proxy_route.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定代理规则的完整配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "获取代理规则详情", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "代理规则详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定代理规则,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "删除代理规则", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定代理规则的配置,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "更新代理规则", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "代理规则参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/proxy_route.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/status": { - "get": { - "description": "返回版本、认证源与系统公开配置,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取 OpenFlare 公开状态", - "responses": { - "200": { - "description": "公开状态", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.statusView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 TLS 证书(不含 PEM),需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出 TLS 证书", - "responses": { - "200": { - "description": "证书列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "从 PEM 文本创建 TLS 证书,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建 TLS 证书", - "parameters": [ - { - "description": "证书参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.CertificateInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/apply": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "通过 ACME 申请新的 TLS 证书,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "申请 ACME 证书", - "parameters": [ - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "申请中的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/import-file": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "上传证书与私钥文件创建 TLS 证书,需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "从文件导入 TLS 证书", - "parameters": [ - { - "type": "string", - "description": "证书名称", - "name": "name", - "in": "formData" - }, - { - "type": "string", - "description": "备注", - "name": "remark", - "in": "formData" - }, - { - "type": "file", - "description": "证书文件", - "name": "cert_file", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "私钥文件", - "name": "key_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "导入成功的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取 TLS 证书详情", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "证书详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/content": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回证书与私钥 PEM 内容,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取 TLS 证书 PEM 内容", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "证书 PEM 内容", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/tls.CertificateContent" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/convert-acme": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将已上传证书转换为 ACME 自动续期模式,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "将证书转为 ACME 管理", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "转换后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 TLS 证书,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除 TLS 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/renew": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "手动触发 ACME 证书续期,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "续期 ACME 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "续期后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 TLS 证书 PEM 信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 TLS 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "证书参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.CertificateInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/update-acme": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 ACME 证书申请配置,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 ACME 证书配置", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/latest-release": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "获取最新服务端发布版本", - "parameters": [ - { - "type": "string", - "description": "发布渠道(stable/preview)", - "name": "channel", - "in": "query" - } - ], - "responses": { - "200": { - "description": "最新发布信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/update.LatestReleaseView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/logs/ws": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "通过 WebSocket 推送升级进度快照,需要管理员权限", - "tags": [ - "openflare-update" - ], - "summary": "流式获取服务端升级日志", - "responses": { - "101": { - "description": "WebSocket 升级日志流", - "schema": { - "$ref": "#/definitions/update.StreamSnapshot" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/manual-upgrade": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "确认手动服务端升级", - "responses": { - "400": { - "description": "功能已禁用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/manual-upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "上传手动升级二进制", - "parameters": [ - { - "type": "file", - "description": "服务端二进制文件", - "name": "binary", - "in": "formData", - "required": true - } - ], - "responses": { - "400": { - "description": "功能已禁用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/upgrade": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "触发服务端自动升级", - "parameters": [ - { - "description": "升级参数", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/update.upgradeRequest" - } - } - ], - "responses": { - "200": { - "description": "升级任务已调度", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/update.LatestReleaseView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/uptimekuma/sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "同步 Uptime Kuma", - "responses": { - "200": { - "description": "同步成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 WAF IP 组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "列出 WAF IP 组", - "responses": { - "200": { - "description": "IP 组列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 WAF IP 组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "创建 WAF IP 组", - "parameters": [ - { - "description": "IP 组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的 IP 组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/test": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "测试 WAF IP 组自动配置", - "parameters": [ - { - "description": "自动配置参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupAutoTestInput" - } - } - ], - "responses": { - "200": { - "description": "测试结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupAutoTestResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 WAF IP 组详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取 WAF IP 组详情", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "IP 组详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 WAF IP 组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "删除 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "手动触发 WAF IP 组外部 IP 同步,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "同步 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "同步结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupSyncResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 WAF IP 组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "更新 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "IP 组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的 IP 组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 WAF 规则组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "列出 WAF 规则组", - "responses": { - "200": { - "description": "规则组列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 WAF 规则组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "创建 WAF 规则组", - "parameters": [ - { - "description": "规则组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.RuleGroupInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 WAF 规则组详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取 WAF 规则组详情", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "规则组详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 WAF 规则组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "删除 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/sites": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "替换 WAF 规则组关联的代理站点列表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "替换规则组站点绑定", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "站点 ID 列表", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IDsRequest" - } - } - ], - "responses": { - "200": { - "description": "更新后的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 WAF 规则组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "更新 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "规则组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.RuleGroupInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/sites/{route_id}/rule-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回代理站点关联的 WAF 规则组绑定,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取站点 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "代理路由 ID", - "name": "route_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "站点规则组绑定", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.SiteRuleGroupsView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "替换代理站点关联的 WAF 规则组列表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "替换站点 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "代理路由 ID", - "name": "route_id", - "in": "path", - "required": true - }, - { - "description": "规则组 ID 列表", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IDsRequest" - } - } - ], - "responses": { - "200": { - "description": "更新后的站点规则组绑定", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.SiteRuleGroupsView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "支持各种类型的通用文件上传,支持自动文件类型检测、哈希计算与“秒传”去重", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "上传文件", - "parameters": [ - { - "type": "file", - "description": "要上传的文件", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "业务分类 (例如: avatar, attachment, doc,默认为 generic)", - "name": "type", - "in": "formData" - }, - { - "type": "string", - "description": "额外的 JSON 格式元数据", - "name": "metadata", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "上传成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Upload" - } - } - } - ] - } - }, - "400": { - "description": "请求参数错误或文件受限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload/my": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取当前登录用户上传的文件,支持文件名关键词、业务类型、扩展名过滤", - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "获取我的文件列表", - "parameters": [ - { - "type": "integer", - "description": "页码(默认 1)", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(默认 20,最大 100)", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "文件名关键词(模糊匹配)", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "业务分类过滤", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "扩展名过滤", - "name": "extension", - "in": "query" - } - ], - "responses": { - "200": { - "description": "查询成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.listMyFilesResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload/{id}": { - "put": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新当前用户本人的文件名或访问权限模式 (AccessMode)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "更新我的文件信息", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "更新字段", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handler.updateMyFileRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Upload" - } - } - } - ] - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "delete": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将当前用户本人的文件状态置为 deleted(软删除)", - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "删除我的文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/api/v1/user-info": { "get": { "security": [ @@ -12412,65 +11563,6 @@ const docTemplate = `{ } } }, - "/f/{id}": { - "get": { - "description": "根据文件 ID 获取并提供已上传的临时或正式文件,若配置了缓存则优先走本地缓存,否则从 S3 等后端存储读取并流式返回", - "produces": [ - "application/octet-stream" - ], - "tags": [ - "upload" - ], - "summary": "获取已上传文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "图片质量 (low, medium, high, origin),默认为 origin", - "name": "quality", - "in": "query" - } - ], - "responses": { - "200": { - "description": "成功获取文件内容", - "schema": { - "type": "file" - } - }, - "400": { - "description": "文件 ID 格式错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件未找到", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "服务内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/robots.txt": { "get": { "description": "根据系统配置决定是否允许搜索引擎检索,并返回相应的 robots.txt 文件内容", @@ -13049,285 +12141,6 @@ const docTemplate = `{ } } }, - "handler.batchDownloadRequest": { - "type": "object", - "required": [ - "ids" - ], - "properties": { - "ids": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - }, - "handler.distributionItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "size": { - "type": "integer" - } - } - }, - "handler.fileStatsResponse": { - "type": "object", - "properties": { - "categories": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.distributionItem" - } - }, - "total_count": { - "type": "integer" - }, - "total_size": { - "type": "integer" - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.trendItem" - } - }, - "types": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.distributionItem" - } - } - } - }, - "handler.listFilesResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Upload" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "handler.listMyFilesResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Upload" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "handler.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - }, - "size": { - "type": "integer" - } - } - }, - "handler.updateMyFileRequest": { - "type": "object", - "properties": { - "access_mode": { - "type": "integer", - "enum": [ - 0, - 1 - ] - }, - "file_name": { - "type": "string", - "maxLength": 255 - } - } - }, - "logger.LogEntry": { - "type": "object", - "properties": { - "data": { - "description": "一行日志原文(含换行符)", - "type": "string" - }, - "index": { - "description": "全局递增序号", - "type": "integer" - } - } - }, - "logs.accessLogItem": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "headers": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "ip": { - "type": "string" - }, - "latency": { - "type": "integer" - }, - "method": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "path": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "user_agent": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.accessLogsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.accessLogItem" - } - }, - "total": { - "type": "integer" - } - } - }, - "logs.browserItem": { - "type": "object", - "properties": { - "browser": { - "type": "string" - }, - "count": { - "type": "integer" - } - } - }, - "logs.logsAnalyticsResponse": { - "type": "object", - "properties": { - "browsers": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.browserItem" - } - }, - "top_users": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.topUserItem" - } - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.trendItem" - } - } - } - }, - "logs.logsResponse": { - "type": "object", - "properties": { - "has_more": { - "type": "boolean" - }, - "lines": { - "type": "array", - "items": { - "$ref": "#/definitions/logger.LogEntry" - } - }, - "next_cursor": { - "description": "用于加载更早日志的 cursor", - "type": "integer" - } - } - }, - "logs.topUserItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - } - } - }, "model.AccessToken": { "type": "object", "properties": { @@ -14127,133 +12940,6 @@ const docTemplate = `{ } } }, - "model.Upload": { - "type": "object", - "properties": { - "access_mode": { - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "extension": { - "description": "文件后缀名 (不含点,如 png, pdf)", - "type": "string" - }, - "file_name": { - "description": "原始文件名 (例如: image.png)", - "type": "string" - }, - "file_path": { - "description": "文件相对路径 / S3 Key", - "type": "string" - }, - "file_size": { - "description": "文件大小(字节)", - "type": "integer" - }, - "hash": { - "description": "文件哈希 (SHA-256/MD5,可用于排重)", - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "metadata": { - "description": "业务扩展元数据", - "allOf": [ - { - "$ref": "#/definitions/model.UploadMetadata" - } - ] - }, - "mime_type": { - "description": "媒体类型 (MIME, 如 image/png)", - "type": "string" - }, - "status": { - "description": "状态", - "allOf": [ - { - "$ref": "#/definitions/model.UploadStatus" - } - ] - }, - "type": { - "description": "业务标识类型 (如 avatar, doc, attachment)", - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - } - } - }, - "model.UploadMetadata": { - "type": "object", - "properties": { - "bucket": { - "description": "存储桶名称 (适用于 S3 等)", - "type": "string" - }, - "client_ip": { - "description": "上传者 IP", - "type": "string" - }, - "duration": { - "description": "音视频时长 (s)", - "type": "number" - }, - "extra": { - "description": "其它任意业务自定义元数据", - "type": "object", - "additionalProperties": {} - }, - "height": { - "description": "图像/视频高度 (px)", - "type": "integer" - }, - "original_mime": { - "description": "原始 MIME 类型", - "type": "string" - }, - "user_agent": { - "description": "上传者的 UA", - "type": "string" - }, - "width": { - "description": "图像/视频宽度 (px)", - "type": "integer" - } - } - }, - "model.UploadStatus": { - "type": "string", - "enum": [ - "pending", - "used", - "deleted" - ], - "x-enum-comments": { - "UploadStatusDeleted": "已删除", - "UploadStatusPending": "待使用", - "UploadStatusUsed": "已使用" - }, - "x-enum-descriptions": [ - "待使用", - "已使用", - "已删除" - ], - "x-enum-varnames": [ - "UploadStatusPending", - "UploadStatusUsed", - "UploadStatusDeleted" - ] - }, "node.AgentReleaseInfo": { "type": "object", "properties": { diff --git a/Wavelet/docs/swagger.json b/Wavelet/docs/swagger.json index 6798434c..10c0ada4 100644 --- a/Wavelet/docs/swagger.json +++ b/Wavelet/docs/swagger.json @@ -921,231 +921,6 @@ } } }, - "/api/v1/admin/logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取系统历史日志,cursor=0 获取最新日志,cursor\u003e0 获取更早日志", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取系统日志", - "parameters": [ - { - "type": "integer", - "default": 0, - "description": "日志游标,0=获取最新", - "name": "cursor", - "in": "query" - }, - { - "type": "integer", - "default": 200, - "description": "每页条数", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.logsResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/access": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页并按照用户、接口路径、时间范围等维度检索 ClickHouse 用户访问日志列表(需要管理员权限,ClickHouse 未启用时报错)", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取用户访问日志", - "parameters": [ - { - "type": "integer", - "default": 1, - "description": "页码", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "用户名模糊搜索", - "name": "username", - "in": "query" - }, - { - "type": "string", - "description": "接口路径模糊搜索", - "name": "path", - "in": "query" - }, - { - "type": "string", - "description": "起始时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", - "name": "start_time", - "in": "query" - }, - { - "type": "string", - "description": "结束时间(RFC3339 或 YYYY-MM-DD HH:MM:SS)", - "name": "end_time", - "in": "query" - } - ], - "responses": { - "200": { - "description": "访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.accessLogsResponse" - } - } - } - ] - } - }, - "400": { - "description": "ClickHouse 未启用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/analytics": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,ClickHouse 未启用时报错)", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取访问日志分析数据", - "responses": { - "200": { - "description": "分析统计数据", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/logs.logsAnalyticsResponse" - } - } - } - ] - } - }, - "400": { - "description": "ClickHouse 未启用", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/logs/ws": { - "get": { - "description": "通过 WebSocket 实时推送系统日志,需要管理员权限", - "tags": [ - "admin" - ], - "summary": "系统日志实时推送", - "responses": {} - } - }, "/api/v1/admin/push/channels": { "get": { "security": [ @@ -3294,362 +3069,6 @@ } } }, - "/api/v1/admin/uploads": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件列表", - "parameters": [ - { - "type": "integer", - "description": "页码(默认 1)", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(默认 20,最大 100)", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "文件名关键词(模糊匹配)", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "业务分类过滤", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "扩展名过滤", - "name": "extension", - "in": "query" - }, - { - "type": "integer", - "format": "int64", - "description": "上传用户 ID", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "查询成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.listFilesResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/download/batch": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "传入多个文件 ID,后台实时将其打包压缩为 ZIP 流并输出,自动处理文件名重复冲突", - "consumes": [ - "application/json" - ], - "produces": [ - "application/octet-stream" - ], - "tags": [ - "admin" - ], - "summary": "批量打包下载", - "parameters": [ - { - "description": "包含文件 ID 数组 of string 的请求体", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handler.batchDownloadRequest" - } - } - ], - "responses": { - "200": { - "description": "成功下载打包后的 ZIP", - "schema": { - "type": "file" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "打包失败", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/download/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "根据文件 ID 获取文件,以附件形式 (Attachment) 强制开启客户端浏览器下载", - "produces": [ - "application/octet-stream" - ], - "tags": [ - "admin" - ], - "summary": "下载单文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "图片质量 (low, medium, high, origin),默认为 origin", - "name": "quality", - "in": "query" - } - ], - "responses": { - "200": { - "description": "成功下载文件", - "schema": { - "type": "file" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "服务内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/stats": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件统计数据", - "responses": { - "200": { - "description": "获取成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.fileStatsResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/types": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回数据库中所有已上传文件实际拥有的业务类型列表", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "获取文件业务类型列表", - "responses": { - "200": { - "description": "业务类型列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/admin/uploads/{id}": { - "delete": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象", - "produces": [ - "application/json" - ], - "tags": [ - "admin" - ], - "summary": "删除文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/api/v1/admin/users": { "get": { "security": [ @@ -4102,6 +3521,7028 @@ } } }, + "/api/v1/d/about": { + "get": { + "description": "返回 OpenFlare 关于页面文本,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取关于信息", + "responses": { + "200": { + "description": "关于信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出访问日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "访问日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按保留天数清理过期访问日志记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "清理访问日志", + "parameters": [ + { + "description": "清理参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/observability.AccessLogCleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/folds": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按时间桶聚合访问日志并分页返回,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出折叠访问日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "integer", + "description": "折叠时间窗口(分钟)", + "name": "fold_minutes", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "折叠访问日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.FoldedAccessLogList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/folds/ip-summary": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "在指定时间桶内按 IP 聚合访问统计,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出折叠访问日志 IP 汇总", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "时间桶起始时间", + "name": "bucket_started_at", + "in": "query" + }, + { + "type": "integer", + "description": "折叠时间窗口(分钟)", + "name": "fold_minutes", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "折叠 IP 汇总列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.FoldedAccessLogIPList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/ip-summary": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 IP 聚合访问日志统计并分页返回,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "列出访问日志 IP 汇总", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "p", + "in": "query" + }, + { + "type": "integer", + "description": "每页条数", + "name": "page_size", + "in": "query" + }, + { + "type": "string", + "description": "排序字段", + "name": "sort_by", + "in": "query" + }, + { + "type": "string", + "description": "排序方向", + "name": "sort_order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "IP 汇总列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogIPSummaryList" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/access-logs/ip-summary/trend": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-observability" + ], + "summary": "获取访问日志 IP 趋势", + "parameters": [ + { + "type": "string", + "description": "节点 ID", + "name": "node_id", + "in": "query" + }, + { + "type": "string", + "description": "客户端 IP", + "name": "remote_addr", + "in": "query" + }, + { + "type": "string", + "description": "请求 Host", + "name": "host", + "in": "query" + }, + { + "type": "integer", + "description": "统计时间范围(小时)", + "name": "hours", + "in": "query" + }, + { + "type": "integer", + "description": "时间桶粒度(分钟)", + "name": "bucket_minutes", + "in": "query" + } + ], + "responses": { + "200": { + "description": "IP 访问趋势", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/observability.AccessLogIPTrendView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/acme-accounts/default": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回系统默认 ACME 账号配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取默认 ACME 账号", + "responses": { + "200": { + "description": "默认 ACME 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.AcmeAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/apply-logs": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-apply-log" + ], + "summary": "获取配置下发日志", + "parameters": [ + { + "type": "string", + "description": "节点 ID 筛选", + "name": "node_id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "pageNo", + "in": "query" + }, + { + "type": "integer", + "description": "页码(别名)", + "name": "page_no", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "每页数量(别名)", + "name": "page_size", + "in": "query" + } + ], + "responses": { + "200": { + "description": "下发日志列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apply_log.ListResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/apply-logs/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按保留天数清理历史下发记录,或删除全部记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-apply-log" + ], + "summary": "清理配置下发日志", + "parameters": [ + { + "description": "清理参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apply_log.CleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apply_log.CleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取配置版本列表", + "responses": { + "200": { + "description": "配置版本列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ConfigVersionSummary" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/active": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回当前正在使用的配置版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取当前活跃配置版本", + "responses": { + "200": { + "description": "活跃配置版本", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限、不存在或无活跃版本", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除超出保留数量的非活跃配置版本,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "清理历史配置版本", + "parameters": [ + { + "description": "清理参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/config_version.CleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.CleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/diff": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "对比当前草稿配置与活跃版本之间的差异,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "对比草稿与活跃配置", + "responses": { + "200": { + "description": "配置差异", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.ConfigDiffResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/preview": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "渲染并返回当前草稿配置的预览结果,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "预览当前草稿配置", + "responses": { + "200": { + "description": "配置预览", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/config_version.ConfigPreviewResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/publish": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将当前草稿配置发布为新版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "发布配置版本", + "parameters": [ + { + "type": "boolean", + "description": "是否强制发布", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "发布成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定配置版本的完整快照与渲染内容,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "获取配置版本详情", + "parameters": [ + { + "type": "integer", + "description": "配置版本 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "配置版本详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或版本不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/config-versions/{id}/activate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定历史版本设为当前活跃配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-config-version" + ], + "summary": "激活配置版本", + "parameters": [ + { + "type": "integer", + "description": "配置版本 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "激活成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ConfigVersion" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或版本不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dashboard/overview": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-dashboard" + ], + "summary": "获取仪表盘概览", + "responses": { + "200": { + "description": "仪表盘概览", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/dashboard.OverviewPayload" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 DNS 提供商账号,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出 DNS 账号", + "responses": { + "200": { + "description": "DNS 账号列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 DNS 提供商账号,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建 DNS 账号", + "parameters": [ + { + "description": "DNS 账号参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.DNSAccountInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的 DNS 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 DNS 提供商账号,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除 DNS 账号", + "parameters": [ + { + "type": "integer", + "description": "DNS 账号 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/dns-accounts/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 DNS 提供商账号,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 DNS 账号", + "parameters": [ + { + "type": "integer", + "description": "DNS 账号 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "DNS 账号参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.DNSAccountInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的 DNS 账号", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.DNSAccount" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部托管域名及关联证书,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出托管域名", + "responses": { + "200": { + "description": "托管域名列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的托管域名记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建托管域名", + "parameters": [ + { + "description": "托管域名参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ManagedDomainInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的托管域名", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/match": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按域名查询可用的证书匹配候选,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "匹配托管域名证书", + "parameters": [ + { + "type": "string", + "description": "域名", + "name": "domain", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "证书匹配结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/tls.ManagedDomainMatchResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除托管域名,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除托管域名", + "parameters": [ + { + "type": "integer", + "description": "托管域名 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/managed-domains/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新托管域名,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新托管域名", + "parameters": [ + { + "type": "integer", + "description": "托管域名 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "托管域名参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ManagedDomainInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的托管域名", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.ManagedDomain" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有节点及最新配置下发记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取节点列表", + "responses": { + "200": { + "description": "节点列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/node.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的边缘节点记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "创建节点", + "parameters": [ + { + "description": "节点参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/node.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/bootstrap-token": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全局节点发现引导令牌,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取引导令牌", + "responses": { + "200": { + "description": "引导令牌", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.BootstrapView" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/bootstrap-token/rotate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "重新生成全局节点发现引导令牌,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "轮换引导令牌", + "responses": { + "200": { + "description": "新引导令牌", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.BootstrapView" + } + } + } + ] + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/agent-release": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定节点可用的最新 Agent 版本信息,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取 Agent 发布信息", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "发布渠道", + "name": "channel", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Agent 发布信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.AgentReleaseInfo" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/agent-update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发 Agent 自更新指令,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求 Agent 更新", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "更新参数(可选)", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/node.AgentUpdateInput" + } + } + ], + "responses": { + "200": { + "description": "更新请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定节点记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "删除节点", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/force-sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发强制同步当前活跃配置的指令,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求强制同步配置", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "同步请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/observability": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定节点的指标、健康事件与流量分析数据,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "获取节点可观测性数据", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "统计时间范围(小时)", + "name": "hours", + "in": "query" + }, + { + "type": "integer", + "description": "返回记录数量上限", + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "可观测性数据", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.ObservabilityView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/observability/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "清理指定节点的历史健康事件记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "清理节点健康事件", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.HealthEventCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/openresty-restart": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "向指定节点下发 OpenResty 重启指令,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "请求重启 OpenResty", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "重启请求已下发", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/nodes/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定节点的配置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-node" + ], + "summary": "更新节点", + "parameters": [ + { + "type": "integer", + "description": "节点 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "节点参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/node.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/node.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或节点不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/notice": { + "get": { + "description": "返回 OpenFlare 控制台公告文本,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取系统公告", + "responses": { + "200": { + "description": "系统公告", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部非敏感 OpenFlare 配置项,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "列出 OpenFlare 配置项", + "responses": { + "200": { + "description": "配置项列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OpenFlareOption" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/database/cleanup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按目标与保留天数清理可观测性相关数据表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "清理可观测性数据库", + "parameters": [ + { + "description": "清理参数", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/option.databaseCleanupInput" + } + } + ], + "responses": { + "200": { + "description": "清理结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.databaseCleanupResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/geoip/lookup": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按提供商与 IP 查询地理位置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "GeoIP 地址查询", + "parameters": [ + { + "description": "查询参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/option.geoIPLookupRequest" + } + } + ], + "responses": { + "200": { + "description": "GeoIP 查询结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.geoIPLookupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新单个 OpenFlare 配置项,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "更新 OpenFlare 配置项", + "parameters": [ + { + "description": "配置项", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.OpenFlareOption" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/option/update-batch": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "批量更新多个 OpenFlare 配置项,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "批量更新 OpenFlare 配置项", + "parameters": [ + { + "description": "批量配置项", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/option.optionBatchPayload" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有源站及关联代理规则数量,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "获取源站列表", + "responses": { + "200": { + "description": "源站列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/origin.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的上游源站记录,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "创建源站", + "parameters": [ + { + "description": "源站参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/origin.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定源站信息及关联代理规则摘要,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "获取源站详情", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "源站详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.DetailView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定源站记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "删除源站", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/origins/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定源站的配置信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-origin" + ], + "summary": "更新源站", + "parameters": [ + { + "type": "integer", + "description": "源站 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "源站参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/origin.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/origin.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或源站不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 OpenFlare Pages 项目,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 项目", + "responses": { + "200": { + "description": "Pages 项目列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 OpenFlare Pages 项目,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "创建 Pages 项目", + "parameters": [ + { + "description": "项目参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pages.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/deployments/{deployment_id}/files": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定部署包含的文件清单,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 部署文件", + "parameters": [ + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "部署文件列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.DeploymentFileView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 Pages 项目详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "获取 Pages 项目详情", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Pages 项目详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 OpenFlare Pages 项目,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "删除 Pages 项目", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定项目的全部部署记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "列出 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "部署列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/pages.DeploymentView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/upload": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "为指定项目上传 ZIP 部署包,需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "上传 Pages 部署包", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "部署包 ZIP 文件", + "name": "package", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "部署记录", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.DeploymentView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/{deployment_id}/activate": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将指定部署设为项目当前生效版本,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "激活 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "激活后的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目或部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/deployments/{deployment_id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定项目的部署记录,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "删除 Pages 部署", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "部署 ID", + "name": "deployment_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目或部署不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/pages/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 OpenFlare Pages 项目,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-pages" + ], + "summary": "更新 Pages 项目", + "parameters": [ + { + "type": "integer", + "description": "项目 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "项目参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pages.Input" + } + } + ], + "responses": { + "200": { + "description": "更新后的项目", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/pages.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "项目不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回所有代理规则配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "获取代理规则列表", + "responses": { + "200": { + "description": "代理规则列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的反向代理规则,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "创建代理规则", + "parameters": [ + { + "description": "代理规则参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/proxy_route.Input" + } + } + ], + "responses": { + "200": { + "description": "创建成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回指定代理规则的完整配置,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "获取代理规则详情", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "代理规则详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "删除指定代理规则,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "删除代理规则", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/proxy-routes/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "更新指定代理规则的配置,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-proxy-route" + ], + "summary": "更新代理规则", + "parameters": [ + { + "type": "integer", + "description": "代理规则 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "代理规则参数", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/proxy_route.Input" + } + } + ], + "responses": { + "200": { + "description": "更新成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/proxy_route.View" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "无权限或规则不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/status": { + "get": { + "description": "返回版本、认证源与系统公开配置,无需登录", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "获取 OpenFlare 公开状态", + "responses": { + "200": { + "description": "公开状态", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/option.statusView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 TLS 证书(不含 PEM),需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "列出 TLS 证书", + "responses": { + "200": { + "description": "证书列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "从 PEM 文本创建 TLS 证书,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "创建 TLS 证书", + "parameters": [ + { + "description": "证书参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.CertificateInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/apply": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "通过 ACME 申请新的 TLS 证书,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "申请 ACME 证书", + "parameters": [ + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "申请中的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/import-file": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "上传证书与私钥文件创建 TLS 证书,需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "从文件导入 TLS 证书", + "parameters": [ + { + "type": "string", + "description": "证书名称", + "name": "name", + "in": "formData" + }, + { + "type": "string", + "description": "备注", + "name": "remark", + "in": "formData" + }, + { + "type": "file", + "description": "证书文件", + "name": "cert_file", + "in": "formData", + "required": true + }, + { + "type": "file", + "description": "私钥文件", + "name": "key_file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "导入成功的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取 TLS 证书详情", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "证书详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/content": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回证书与私钥 PEM 内容,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "获取 TLS 证书 PEM 内容", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "证书 PEM 内容", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/tls.CertificateContent" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/convert-acme": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将已上传证书转换为 ACME 自动续期模式,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "将证书转为 ACME 管理", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "转换后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 TLS 证书,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "删除 TLS 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/renew": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "手动触发 ACME 证书续期,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "续期 ACME 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "续期后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 TLS 证书 PEM 信息,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 TLS 证书", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "证书参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.CertificateInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/tls-certificates/{id}/update-acme": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 ACME 证书申请配置,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-tls" + ], + "summary": "更新 ACME 证书配置", + "parameters": [ + { + "type": "integer", + "description": "证书 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "ACME 申请参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tls.ApplyInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的证书", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.TLSCertificate" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/latest-release": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "获取最新服务端发布版本", + "parameters": [ + { + "type": "string", + "description": "发布渠道(stable/preview)", + "name": "channel", + "in": "query" + } + ], + "responses": { + "200": { + "description": "最新发布信息", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/update.LatestReleaseView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/logs/ws": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "通过 WebSocket 推送升级进度快照,需要管理员权限", + "tags": [ + "openflare-update" + ], + "summary": "流式获取服务端升级日志", + "responses": { + "101": { + "description": "WebSocket 升级日志流", + "schema": { + "$ref": "#/definitions/update.StreamSnapshot" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/manual-upgrade": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "确认手动服务端升级", + "responses": { + "400": { + "description": "功能已禁用或参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/manual-upload": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "上传手动升级二进制", + "parameters": [ + { + "type": "file", + "description": "服务端二进制文件", + "name": "binary", + "in": "formData", + "required": true + } + ], + "responses": { + "400": { + "description": "功能已禁用或参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/update/upgrade": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-update" + ], + "summary": "触发服务端自动升级", + "parameters": [ + { + "description": "升级参数", + "name": "request", + "in": "body", + "schema": { + "$ref": "#/definitions/update.upgradeRequest" + } + } + ], + "responses": { + "200": { + "description": "升级任务已调度", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/update.LatestReleaseView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/uptimekuma/sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-option" + ], + "summary": "同步 Uptime Kuma", + "responses": { + "200": { + "description": "同步成功", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 WAF IP 组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "列出 WAF IP 组", + "responses": { + "200": { + "description": "IP 组列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 WAF IP 组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "创建 WAF IP 组", + "parameters": [ + { + "description": "IP 组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的 IP 组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/test": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "测试 WAF IP 组自动配置", + "parameters": [ + { + "description": "自动配置参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupAutoTestInput" + } + } + ], + "responses": { + "200": { + "description": "测试结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupAutoTestResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 WAF IP 组详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取 WAF IP 组详情", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "IP 组详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 WAF IP 组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "删除 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/sync": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "手动触发 WAF IP 组外部 IP 同步,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "同步 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "同步结果", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupSyncResult" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/ip-groups/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 WAF IP 组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "更新 WAF IP 组", + "parameters": [ + { + "type": "integer", + "description": "IP 组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "IP 组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IPGroupInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的 IP 组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.IPGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回全部 WAF 规则组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "列出 WAF 规则组", + "responses": { + "200": { + "description": "规则组列表", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "创建新的 WAF 规则组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "创建 WAF 规则组", + "parameters": [ + { + "description": "规则组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.RuleGroupInput" + } + } + ], + "responses": { + "200": { + "description": "创建成功的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 返回 WAF 规则组详情,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取 WAF 规则组详情", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "规则组详情", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/delete": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 删除 WAF 规则组,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "删除 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "删除成功", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/sites": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "替换 WAF 规则组关联的代理站点列表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "替换规则组站点绑定", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "站点 ID 列表", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IDsRequest" + } + } + ], + "responses": { + "200": { + "description": "更新后的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/rule-groups/{id}/update": { + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "按 ID 更新 WAF 规则组,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "更新 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "规则组 ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "规则组参数", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.RuleGroupInput" + } + } + ], + "responses": { + "200": { + "description": "更新后的规则组", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.RuleGroupView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, + "/api/v1/d/waf/sites/{route_id}/rule-groups": { + "get": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "返回代理站点关联的 WAF 规则组绑定,需要管理员权限", + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "获取站点 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "代理路由 ID", + "name": "route_id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "站点规则组绑定", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.SiteRuleGroupsView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + }, + "post": { + "security": [ + { + "SessionCookie": [] + } + ], + "description": "替换代理站点关联的 WAF 规则组列表,需要管理员权限", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "openflare-waf" + ], + "summary": "替换站点 WAF 规则组", + "parameters": [ + { + "type": "integer", + "description": "代理路由 ID", + "name": "route_id", + "in": "path", + "required": true + }, + { + "description": "规则组 ID 列表", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/waf.IDsRequest" + } + } + ], + "responses": { + "200": { + "description": "更新后的站点规则组绑定", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Any" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/waf.SiteRuleGroupsView" + } + } + } + ] + } + }, + "400": { + "description": "参数错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "401": { + "description": "未登录", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "403": { + "description": "无管理员权限", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "404": { + "description": "记录不存在", + "schema": { + "$ref": "#/definitions/response.Any" + } + }, + "500": { + "description": "内部错误", + "schema": { + "$ref": "#/definitions/response.Any" + } + } + } + } + }, "/api/v1/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -4509,7296 +10950,6 @@ } } }, - "/api/v1/openflare/about": { - "get": { - "description": "返回 OpenFlare 关于页面文本,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取关于信息", - "responses": { - "200": { - "description": "关于信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出访问日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按保留天数清理过期访问日志记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "清理访问日志", - "parameters": [ - { - "description": "清理参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/observability.AccessLogCleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/folds": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按时间桶聚合访问日志并分页返回,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出折叠访问日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "integer", - "description": "折叠时间窗口(分钟)", - "name": "fold_minutes", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "折叠访问日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.FoldedAccessLogList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/folds/ip-summary": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "在指定时间桶内按 IP 聚合访问统计,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出折叠访问日志 IP 汇总", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "string", - "description": "请求路径", - "name": "path", - "in": "query" - }, - { - "type": "string", - "description": "时间桶起始时间", - "name": "bucket_started_at", - "in": "query" - }, - { - "type": "integer", - "description": "折叠时间窗口(分钟)", - "name": "fold_minutes", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "折叠 IP 汇总列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.FoldedAccessLogIPList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/ip-summary": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 IP 聚合访问日志统计并分页返回,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "列出访问日志 IP 汇总", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "p", - "in": "query" - }, - { - "type": "integer", - "description": "每页条数", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "排序字段", - "name": "sort_by", - "in": "query" - }, - { - "type": "string", - "description": "排序方向", - "name": "sort_order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "IP 汇总列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogIPSummaryList" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/access-logs/ip-summary/trend": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-observability" - ], - "summary": "获取访问日志 IP 趋势", - "parameters": [ - { - "type": "string", - "description": "节点 ID", - "name": "node_id", - "in": "query" - }, - { - "type": "string", - "description": "客户端 IP", - "name": "remote_addr", - "in": "query" - }, - { - "type": "string", - "description": "请求 Host", - "name": "host", - "in": "query" - }, - { - "type": "integer", - "description": "统计时间范围(小时)", - "name": "hours", - "in": "query" - }, - { - "type": "integer", - "description": "时间桶粒度(分钟)", - "name": "bucket_minutes", - "in": "query" - } - ], - "responses": { - "200": { - "description": "IP 访问趋势", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/observability.AccessLogIPTrendView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/acme-accounts/default": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回系统默认 ACME 账号配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取默认 ACME 账号", - "responses": { - "200": { - "description": "默认 ACME 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.AcmeAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/apply-logs": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-apply-log" - ], - "summary": "获取配置下发日志", - "parameters": [ - { - "type": "string", - "description": "节点 ID 筛选", - "name": "node_id", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNo", - "in": "query" - }, - { - "type": "integer", - "description": "页码(别名)", - "name": "page_no", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(别名)", - "name": "page_size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "下发日志列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/apply_log.ListResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/apply-logs/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按保留天数清理历史下发记录,或删除全部记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-apply-log" - ], - "summary": "清理配置下发日志", - "parameters": [ - { - "description": "清理参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/apply_log.CleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/apply_log.CleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取配置版本列表", - "responses": { - "200": { - "description": "配置版本列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ConfigVersionSummary" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/active": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回当前正在使用的配置版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取当前活跃配置版本", - "responses": { - "200": { - "description": "活跃配置版本", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限、不存在或无活跃版本", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除超出保留数量的非活跃配置版本,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "清理历史配置版本", - "parameters": [ - { - "description": "清理参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/config_version.CleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.CleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/diff": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "对比当前草稿配置与活跃版本之间的差异,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "对比草稿与活跃配置", - "responses": { - "200": { - "description": "配置差异", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.ConfigDiffResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/preview": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "渲染并返回当前草稿配置的预览结果,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "预览当前草稿配置", - "responses": { - "200": { - "description": "配置预览", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/config_version.ConfigPreviewResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/publish": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将当前草稿配置发布为新版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "发布配置版本", - "parameters": [ - { - "type": "boolean", - "description": "是否强制发布", - "name": "force", - "in": "query" - } - ], - "responses": { - "200": { - "description": "发布成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定配置版本的完整快照与渲染内容,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "获取配置版本详情", - "parameters": [ - { - "type": "integer", - "description": "配置版本 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "配置版本详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或版本不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/config-versions/{id}/activate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将指定历史版本设为当前活跃配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-config-version" - ], - "summary": "激活配置版本", - "parameters": [ - { - "type": "integer", - "description": "配置版本 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "激活成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ConfigVersion" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或版本不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dashboard/overview": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-dashboard" - ], - "summary": "获取仪表盘概览", - "responses": { - "200": { - "description": "仪表盘概览", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/dashboard.OverviewPayload" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 DNS 提供商账号,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出 DNS 账号", - "responses": { - "200": { - "description": "DNS 账号列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 DNS 提供商账号,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建 DNS 账号", - "parameters": [ - { - "description": "DNS 账号参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.DNSAccountInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的 DNS 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 DNS 提供商账号,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除 DNS 账号", - "parameters": [ - { - "type": "integer", - "description": "DNS 账号 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/dns-accounts/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 DNS 提供商账号,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 DNS 账号", - "parameters": [ - { - "type": "integer", - "description": "DNS 账号 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "DNS 账号参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.DNSAccountInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的 DNS 账号", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.DNSAccount" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部托管域名及关联证书,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出托管域名", - "responses": { - "200": { - "description": "托管域名列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的托管域名记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建托管域名", - "parameters": [ - { - "description": "托管域名参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ManagedDomainInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的托管域名", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/match": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按域名查询可用的证书匹配候选,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "匹配托管域名证书", - "parameters": [ - { - "type": "string", - "description": "域名", - "name": "domain", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "证书匹配结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/tls.ManagedDomainMatchResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除托管域名,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除托管域名", - "parameters": [ - { - "type": "integer", - "description": "托管域名 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/managed-domains/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新托管域名,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新托管域名", - "parameters": [ - { - "type": "integer", - "description": "托管域名 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "托管域名参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ManagedDomainInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的托管域名", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.ManagedDomain" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有节点及最新配置下发记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取节点列表", - "responses": { - "200": { - "description": "节点列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/node.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的边缘节点记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "创建节点", - "parameters": [ - { - "description": "节点参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/node.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/bootstrap-token": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全局节点发现引导令牌,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取引导令牌", - "responses": { - "200": { - "description": "引导令牌", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.BootstrapView" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/bootstrap-token/rotate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "重新生成全局节点发现引导令牌,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "轮换引导令牌", - "responses": { - "200": { - "description": "新引导令牌", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.BootstrapView" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/agent-release": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定节点可用的最新 Agent 版本信息,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取 Agent 发布信息", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "发布渠道", - "name": "channel", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Agent 发布信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.AgentReleaseInfo" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/agent-update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发 Agent 自更新指令,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求 Agent 更新", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "更新参数(可选)", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/node.AgentUpdateInput" - } - } - ], - "responses": { - "200": { - "description": "更新请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定节点记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "删除节点", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/force-sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发强制同步当前活跃配置的指令,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求强制同步配置", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "同步请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/observability": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定节点的指标、健康事件与流量分析数据,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "获取节点可观测性数据", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "统计时间范围(小时)", - "name": "hours", - "in": "query" - }, - { - "type": "integer", - "description": "返回记录数量上限", - "name": "limit", - "in": "query" - } - ], - "responses": { - "200": { - "description": "可观测性数据", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.ObservabilityView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/observability/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "清理指定节点的历史健康事件记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "清理节点健康事件", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.HealthEventCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/openresty-restart": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "向指定节点下发 OpenResty 重启指令,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "请求重启 OpenResty", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "重启请求已下发", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/nodes/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定节点的配置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-node" - ], - "summary": "更新节点", - "parameters": [ - { - "type": "integer", - "description": "节点 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "节点参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/node.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/node.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或节点不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/notice": { - "get": { - "description": "返回 OpenFlare 控制台公告文本,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取系统公告", - "responses": { - "200": { - "description": "系统公告", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部非敏感 OpenFlare 配置项,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "列出 OpenFlare 配置项", - "responses": { - "200": { - "description": "配置项列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.OpenFlareOption" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/database/cleanup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按目标与保留天数清理可观测性相关数据表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "清理可观测性数据库", - "parameters": [ - { - "description": "清理参数", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/option.databaseCleanupInput" - } - } - ], - "responses": { - "200": { - "description": "清理结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.databaseCleanupResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/geoip/lookup": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按提供商与 IP 查询地理位置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "GeoIP 地址查询", - "parameters": [ - { - "description": "查询参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/option.geoIPLookupRequest" - } - } - ], - "responses": { - "200": { - "description": "GeoIP 查询结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.geoIPLookupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新单个 OpenFlare 配置项,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "更新 OpenFlare 配置项", - "parameters": [ - { - "description": "配置项", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/model.OpenFlareOption" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/option/update-batch": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "批量更新多个 OpenFlare 配置项,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "批量更新 OpenFlare 配置项", - "parameters": [ - { - "description": "批量配置项", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/option.optionBatchPayload" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有源站及关联代理规则数量,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "获取源站列表", - "responses": { - "200": { - "description": "源站列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/origin.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的上游源站记录,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "创建源站", - "parameters": [ - { - "description": "源站参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/origin.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定源站信息及关联代理规则摘要,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "获取源站详情", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "源站详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.DetailView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定源站记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "删除源站", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/origins/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定源站的配置信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-origin" - ], - "summary": "更新源站", - "parameters": [ - { - "type": "integer", - "description": "源站 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "源站参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/origin.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/origin.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或源站不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 OpenFlare Pages 项目,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 项目", - "responses": { - "200": { - "description": "Pages 项目列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 OpenFlare Pages 项目,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "创建 Pages 项目", - "parameters": [ - { - "description": "项目参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pages.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/deployments/{deployment_id}/files": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定部署包含的文件清单,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 部署文件", - "parameters": [ - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "部署文件列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.DeploymentFileView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 Pages 项目详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "获取 Pages 项目详情", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Pages 项目详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 OpenFlare Pages 项目,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "删除 Pages 项目", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定项目的全部部署记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "列出 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "部署列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/pages.DeploymentView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "为指定项目上传 ZIP 部署包,需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "上传 Pages 部署包", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "部署包 ZIP 文件", - "name": "package", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "部署记录", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.DeploymentView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/{deployment_id}/activate": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将指定部署设为项目当前生效版本,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "激活 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "激活后的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目或部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/deployments/{deployment_id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定项目的部署记录,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "删除 Pages 部署", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "部署 ID", - "name": "deployment_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目或部署不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/pages/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 OpenFlare Pages 项目,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-pages" - ], - "summary": "更新 Pages 项目", - "parameters": [ - { - "type": "integer", - "description": "项目 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "项目参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pages.Input" - } - } - ], - "responses": { - "200": { - "description": "更新后的项目", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/pages.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "项目不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回所有代理规则配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "获取代理规则列表", - "responses": { - "200": { - "description": "代理规则列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的反向代理规则,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "创建代理规则", - "parameters": [ - { - "description": "代理规则参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/proxy_route.Input" - } - } - ], - "responses": { - "200": { - "description": "创建成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回指定代理规则的完整配置,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "获取代理规则详情", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "代理规则详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "删除指定代理规则,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "删除代理规则", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/proxy-routes/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新指定代理规则的配置,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-proxy-route" - ], - "summary": "更新代理规则", - "parameters": [ - { - "type": "integer", - "description": "代理规则 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "代理规则参数", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/proxy_route.Input" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/proxy_route.View" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "无权限或规则不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/status": { - "get": { - "description": "返回版本、认证源与系统公开配置,无需登录", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "获取 OpenFlare 公开状态", - "responses": { - "200": { - "description": "公开状态", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/option.statusView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 TLS 证书(不含 PEM),需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "列出 TLS 证书", - "responses": { - "200": { - "description": "证书列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "从 PEM 文本创建 TLS 证书,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "创建 TLS 证书", - "parameters": [ - { - "description": "证书参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.CertificateInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/apply": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "通过 ACME 申请新的 TLS 证书,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "申请 ACME 证书", - "parameters": [ - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "申请中的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/import-file": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "上传证书与私钥文件创建 TLS 证书,需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "从文件导入 TLS 证书", - "parameters": [ - { - "type": "string", - "description": "证书名称", - "name": "name", - "in": "formData" - }, - { - "type": "string", - "description": "备注", - "name": "remark", - "in": "formData" - }, - { - "type": "file", - "description": "证书文件", - "name": "cert_file", - "in": "formData", - "required": true - }, - { - "type": "file", - "description": "私钥文件", - "name": "key_file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "导入成功的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取 TLS 证书详情", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "证书详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/content": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回证书与私钥 PEM 内容,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "获取 TLS 证书 PEM 内容", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "证书 PEM 内容", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/tls.CertificateContent" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/convert-acme": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将已上传证书转换为 ACME 自动续期模式,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "将证书转为 ACME 管理", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "转换后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 TLS 证书,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "删除 TLS 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/renew": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "手动触发 ACME 证书续期,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "续期 ACME 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "续期后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 TLS 证书 PEM 信息,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 TLS 证书", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "证书参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.CertificateInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/tls-certificates/{id}/update-acme": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 ACME 证书申请配置,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-tls" - ], - "summary": "更新 ACME 证书配置", - "parameters": [ - { - "type": "integer", - "description": "证书 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "ACME 申请参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tls.ApplyInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的证书", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.TLSCertificate" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/latest-release": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "获取最新服务端发布版本", - "parameters": [ - { - "type": "string", - "description": "发布渠道(stable/preview)", - "name": "channel", - "in": "query" - } - ], - "responses": { - "200": { - "description": "最新发布信息", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/update.LatestReleaseView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/logs/ws": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "通过 WebSocket 推送升级进度快照,需要管理员权限", - "tags": [ - "openflare-update" - ], - "summary": "流式获取服务端升级日志", - "responses": { - "101": { - "description": "WebSocket 升级日志流", - "schema": { - "$ref": "#/definitions/update.StreamSnapshot" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/manual-upgrade": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "确认手动服务端升级", - "responses": { - "400": { - "description": "功能已禁用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/manual-upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "上传手动升级二进制", - "parameters": [ - { - "type": "file", - "description": "服务端二进制文件", - "name": "binary", - "in": "formData", - "required": true - } - ], - "responses": { - "400": { - "description": "功能已禁用或参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/update/upgrade": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-update" - ], - "summary": "触发服务端自动升级", - "parameters": [ - { - "description": "升级参数", - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/update.upgradeRequest" - } - } - ], - "responses": { - "200": { - "description": "升级任务已调度", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/update.LatestReleaseView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/uptimekuma/sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-option" - ], - "summary": "同步 Uptime Kuma", - "responses": { - "200": { - "description": "同步成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "string" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 WAF IP 组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "列出 WAF IP 组", - "responses": { - "200": { - "description": "IP 组列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 WAF IP 组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "创建 WAF IP 组", - "parameters": [ - { - "description": "IP 组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的 IP 组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/test": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "测试 WAF IP 组自动配置", - "parameters": [ - { - "description": "自动配置参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupAutoTestInput" - } - } - ], - "responses": { - "200": { - "description": "测试结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupAutoTestResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 WAF IP 组详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取 WAF IP 组详情", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "IP 组详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 WAF IP 组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "删除 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/sync": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "手动触发 WAF IP 组外部 IP 同步,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "同步 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "同步结果", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupSyncResult" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/ip-groups/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 WAF IP 组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "更新 WAF IP 组", - "parameters": [ - { - "type": "integer", - "description": "IP 组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "IP 组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IPGroupInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的 IP 组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.IPGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回全部 WAF 规则组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "列出 WAF 规则组", - "responses": { - "200": { - "description": "规则组列表", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "创建新的 WAF 规则组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "创建 WAF 规则组", - "parameters": [ - { - "description": "规则组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.RuleGroupInput" - } - } - ], - "responses": { - "200": { - "description": "创建成功的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 返回 WAF 规则组详情,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取 WAF 规则组详情", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "规则组详情", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/delete": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 删除 WAF 规则组,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "删除 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/sites": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "替换 WAF 规则组关联的代理站点列表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "替换规则组站点绑定", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "站点 ID 列表", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IDsRequest" - } - } - ], - "responses": { - "200": { - "description": "更新后的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/rule-groups/{id}/update": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "按 ID 更新 WAF 规则组,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "更新 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "规则组 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "规则组参数", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.RuleGroupInput" - } - } - ], - "responses": { - "200": { - "description": "更新后的规则组", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.RuleGroupView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/openflare/waf/sites/{route_id}/rule-groups": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "返回代理站点关联的 WAF 规则组绑定,需要管理员权限", - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "获取站点 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "代理路由 ID", - "name": "route_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "站点规则组绑定", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.SiteRuleGroupsView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "替换代理站点关联的 WAF 规则组列表,需要管理员权限", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "openflare-waf" - ], - "summary": "替换站点 WAF 规则组", - "parameters": [ - { - "type": "integer", - "description": "代理路由 ID", - "name": "route_id", - "in": "path", - "required": true - }, - { - "description": "规则组 ID 列表", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/waf.IDsRequest" - } - } - ], - "responses": { - "200": { - "description": "更新后的站点规则组绑定", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/waf.SiteRuleGroupsView" - } - } - } - ] - } - }, - "400": { - "description": "参数错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无管理员权限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "记录不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload": { - "post": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "支持各种类型的通用文件上传,支持自动文件类型检测、哈希计算与“秒传”去重", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "上传文件", - "parameters": [ - { - "type": "file", - "description": "要上传的文件", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "string", - "description": "业务分类 (例如: avatar, attachment, doc,默认为 generic)", - "name": "type", - "in": "formData" - }, - { - "type": "string", - "description": "额外的 JSON 格式元数据", - "name": "metadata", - "in": "formData" - } - ], - "responses": { - "200": { - "description": "上传成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Upload" - } - } - } - ] - } - }, - "400": { - "description": "请求参数错误或文件受限", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload/my": { - "get": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "分页获取当前登录用户上传的文件,支持文件名关键词、业务类型、扩展名过滤", - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "获取我的文件列表", - "parameters": [ - { - "type": "integer", - "description": "页码(默认 1)", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "每页数量(默认 20,最大 100)", - "name": "page_size", - "in": "query" - }, - { - "type": "string", - "description": "文件名关键词(模糊匹配)", - "name": "keyword", - "in": "query" - }, - { - "type": "string", - "description": "业务分类过滤", - "name": "type", - "in": "query" - }, - { - "type": "string", - "description": "扩展名过滤", - "name": "extension", - "in": "query" - } - ], - "responses": { - "200": { - "description": "查询成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/handler.listMyFilesResponse" - } - } - } - ] - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, - "/api/v1/upload/{id}": { - "put": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "更新当前用户本人的文件名或访问权限模式 (AccessMode)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "更新我的文件信息", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "更新字段", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/handler.updateMyFileRequest" - } - } - ], - "responses": { - "200": { - "description": "更新成功", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Any" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/model.Upload" - } - } - } - ] - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - }, - "delete": { - "security": [ - { - "SessionCookie": [] - } - ], - "description": "将当前用户本人的文件状态置为 deleted(软删除)", - "produces": [ - "application/json" - ], - "tags": [ - "upload" - ], - "summary": "删除我的文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "删除成功", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "403": { - "description": "无权操作", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件不存在", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/api/v1/user-info": { "get": { "security": [ @@ -12405,65 +11556,6 @@ } } }, - "/f/{id}": { - "get": { - "description": "根据文件 ID 获取并提供已上传的临时或正式文件,若配置了缓存则优先走本地缓存,否则从 S3 等后端存储读取并流式返回", - "produces": [ - "application/octet-stream" - ], - "tags": [ - "upload" - ], - "summary": "获取已上传文件", - "parameters": [ - { - "type": "string", - "description": "文件 ID", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "图片质量 (low, medium, high, origin),默认为 origin", - "name": "quality", - "in": "query" - } - ], - "responses": { - "200": { - "description": "成功获取文件内容", - "schema": { - "type": "file" - } - }, - "400": { - "description": "文件 ID 格式错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "401": { - "description": "未登录", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "404": { - "description": "文件未找到", - "schema": { - "$ref": "#/definitions/response.Any" - } - }, - "500": { - "description": "服务内部错误", - "schema": { - "$ref": "#/definitions/response.Any" - } - } - } - } - }, "/robots.txt": { "get": { "description": "根据系统配置决定是否允许搜索引擎检索,并返回相应的 robots.txt 文件内容", @@ -13042,285 +12134,6 @@ } } }, - "handler.batchDownloadRequest": { - "type": "object", - "required": [ - "ids" - ], - "properties": { - "ids": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - }, - "handler.distributionItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "size": { - "type": "integer" - } - } - }, - "handler.fileStatsResponse": { - "type": "object", - "properties": { - "categories": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.distributionItem" - } - }, - "total_count": { - "type": "integer" - }, - "total_size": { - "type": "integer" - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.trendItem" - } - }, - "types": { - "type": "array", - "items": { - "$ref": "#/definitions/handler.distributionItem" - } - } - } - }, - "handler.listFilesResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Upload" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "handler.listMyFilesResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Upload" - } - }, - "page": { - "type": "integer" - }, - "page_size": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "handler.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - }, - "size": { - "type": "integer" - } - } - }, - "handler.updateMyFileRequest": { - "type": "object", - "properties": { - "access_mode": { - "type": "integer", - "enum": [ - 0, - 1 - ] - }, - "file_name": { - "type": "string", - "maxLength": 255 - } - } - }, - "logger.LogEntry": { - "type": "object", - "properties": { - "data": { - "description": "一行日志原文(含换行符)", - "type": "string" - }, - "index": { - "description": "全局递增序号", - "type": "integer" - } - } - }, - "logs.accessLogItem": { - "type": "object", - "properties": { - "created_at": { - "type": "string" - }, - "headers": { - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "ip": { - "type": "string" - }, - "latency": { - "type": "integer" - }, - "method": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "path": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "user_agent": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.accessLogsResponse": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.accessLogItem" - } - }, - "total": { - "type": "integer" - } - } - }, - "logs.browserItem": { - "type": "object", - "properties": { - "browser": { - "type": "string" - }, - "count": { - "type": "integer" - } - } - }, - "logs.logsAnalyticsResponse": { - "type": "object", - "properties": { - "browsers": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.browserItem" - } - }, - "top_users": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.topUserItem" - } - }, - "trend": { - "type": "array", - "items": { - "$ref": "#/definitions/logs.trendItem" - } - } - } - }, - "logs.logsResponse": { - "type": "object", - "properties": { - "has_more": { - "type": "boolean" - }, - "lines": { - "type": "array", - "items": { - "$ref": "#/definitions/logger.LogEntry" - } - }, - "next_cursor": { - "description": "用于加载更早日志的 cursor", - "type": "integer" - } - } - }, - "logs.topUserItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "nickname": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - }, - "username": { - "type": "string" - } - } - }, - "logs.trendItem": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "string" - } - } - }, "model.AccessToken": { "type": "object", "properties": { @@ -14120,133 +12933,6 @@ } } }, - "model.Upload": { - "type": "object", - "properties": { - "access_mode": { - "type": "integer" - }, - "created_at": { - "type": "string" - }, - "extension": { - "description": "文件后缀名 (不含点,如 png, pdf)", - "type": "string" - }, - "file_name": { - "description": "原始文件名 (例如: image.png)", - "type": "string" - }, - "file_path": { - "description": "文件相对路径 / S3 Key", - "type": "string" - }, - "file_size": { - "description": "文件大小(字节)", - "type": "integer" - }, - "hash": { - "description": "文件哈希 (SHA-256/MD5,可用于排重)", - "type": "string" - }, - "id": { - "type": "string", - "example": "0" - }, - "metadata": { - "description": "业务扩展元数据", - "allOf": [ - { - "$ref": "#/definitions/model.UploadMetadata" - } - ] - }, - "mime_type": { - "description": "媒体类型 (MIME, 如 image/png)", - "type": "string" - }, - "status": { - "description": "状态", - "allOf": [ - { - "$ref": "#/definitions/model.UploadStatus" - } - ] - }, - "type": { - "description": "业务标识类型 (如 avatar, doc, attachment)", - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "user_id": { - "type": "string", - "example": "0" - } - } - }, - "model.UploadMetadata": { - "type": "object", - "properties": { - "bucket": { - "description": "存储桶名称 (适用于 S3 等)", - "type": "string" - }, - "client_ip": { - "description": "上传者 IP", - "type": "string" - }, - "duration": { - "description": "音视频时长 (s)", - "type": "number" - }, - "extra": { - "description": "其它任意业务自定义元数据", - "type": "object", - "additionalProperties": {} - }, - "height": { - "description": "图像/视频高度 (px)", - "type": "integer" - }, - "original_mime": { - "description": "原始 MIME 类型", - "type": "string" - }, - "user_agent": { - "description": "上传者的 UA", - "type": "string" - }, - "width": { - "description": "图像/视频宽度 (px)", - "type": "integer" - } - } - }, - "model.UploadStatus": { - "type": "string", - "enum": [ - "pending", - "used", - "deleted" - ], - "x-enum-comments": { - "UploadStatusDeleted": "已删除", - "UploadStatusPending": "待使用", - "UploadStatusUsed": "已使用" - }, - "x-enum-descriptions": [ - "待使用", - "已使用", - "已删除" - ], - "x-enum-varnames": [ - "UploadStatusPending", - "UploadStatusUsed", - "UploadStatusDeleted" - ] - }, "node.AgentReleaseInfo": { "type": "object", "properties": { diff --git a/Wavelet/docs/swagger.yaml b/Wavelet/docs/swagger.yaml index 18e854d6..3abb81e5 100644 --- a/Wavelet/docs/swagger.yaml +++ b/Wavelet/docs/swagger.yaml @@ -367,190 +367,6 @@ definitions: token: type: string type: object - handler.batchDownloadRequest: - properties: - ids: - items: - type: string - minItems: 1 - type: array - required: - - ids - type: object - handler.distributionItem: - properties: - count: - type: integer - name: - type: string - size: - type: integer - type: object - handler.fileStatsResponse: - properties: - categories: - items: - $ref: '#/definitions/handler.distributionItem' - type: array - total_count: - type: integer - total_size: - type: integer - trend: - items: - $ref: '#/definitions/handler.trendItem' - type: array - types: - items: - $ref: '#/definitions/handler.distributionItem' - type: array - type: object - handler.listFilesResponse: - properties: - items: - items: - $ref: '#/definitions/model.Upload' - type: array - page: - type: integer - page_size: - type: integer - total: - type: integer - type: object - handler.listMyFilesResponse: - properties: - items: - items: - $ref: '#/definitions/model.Upload' - type: array - page: - type: integer - page_size: - type: integer - total: - type: integer - type: object - handler.trendItem: - properties: - count: - type: integer - date: - type: string - size: - type: integer - type: object - handler.updateMyFileRequest: - properties: - access_mode: - enum: - - 0 - - 1 - type: integer - file_name: - maxLength: 255 - type: string - type: object - logger.LogEntry: - properties: - data: - description: 一行日志原文(含换行符) - type: string - index: - description: 全局递增序号 - type: integer - type: object - logs.accessLogItem: - properties: - created_at: - type: string - headers: - type: string - id: - example: "0" - type: string - ip: - type: string - latency: - type: integer - method: - type: string - nickname: - type: string - path: - type: string - status: - type: integer - user_agent: - type: string - user_id: - example: "0" - type: string - username: - type: string - type: object - logs.accessLogsResponse: - properties: - list: - items: - $ref: '#/definitions/logs.accessLogItem' - type: array - total: - type: integer - type: object - logs.browserItem: - properties: - browser: - type: string - count: - type: integer - type: object - logs.logsAnalyticsResponse: - properties: - browsers: - items: - $ref: '#/definitions/logs.browserItem' - type: array - top_users: - items: - $ref: '#/definitions/logs.topUserItem' - type: array - trend: - items: - $ref: '#/definitions/logs.trendItem' - type: array - type: object - logs.logsResponse: - properties: - has_more: - type: boolean - lines: - items: - $ref: '#/definitions/logger.LogEntry' - type: array - next_cursor: - description: 用于加载更早日志的 cursor - type: integer - type: object - logs.topUserItem: - properties: - count: - type: integer - nickname: - type: string - user_id: - example: "0" - type: string - username: - type: string - type: object - logs.trendItem: - properties: - count: - type: integer - date: - type: string - type: object model.AccessToken: properties: created_at: @@ -1084,96 +900,6 @@ definitions: updated_at: type: string type: object - model.Upload: - properties: - access_mode: - type: integer - created_at: - type: string - extension: - description: 文件后缀名 (不含点,如 png, pdf) - type: string - file_name: - description: '原始文件名 (例如: image.png)' - type: string - file_path: - description: 文件相对路径 / S3 Key - type: string - file_size: - description: 文件大小(字节) - type: integer - hash: - description: 文件哈希 (SHA-256/MD5,可用于排重) - type: string - id: - example: "0" - type: string - metadata: - allOf: - - $ref: '#/definitions/model.UploadMetadata' - description: 业务扩展元数据 - mime_type: - description: 媒体类型 (MIME, 如 image/png) - type: string - status: - allOf: - - $ref: '#/definitions/model.UploadStatus' - description: 状态 - type: - description: 业务标识类型 (如 avatar, doc, attachment) - type: string - updated_at: - type: string - user_id: - example: "0" - type: string - type: object - model.UploadMetadata: - properties: - bucket: - description: 存储桶名称 (适用于 S3 等) - type: string - client_ip: - description: 上传者 IP - type: string - duration: - description: 音视频时长 (s) - type: number - extra: - additionalProperties: {} - description: 其它任意业务自定义元数据 - type: object - height: - description: 图像/视频高度 (px) - type: integer - original_mime: - description: 原始 MIME 类型 - type: string - user_agent: - description: 上传者的 UA - type: string - width: - description: 图像/视频宽度 (px) - type: integer - type: object - model.UploadStatus: - enum: - - pending - - used - - deleted - type: string - x-enum-comments: - UploadStatusDeleted: 已删除 - UploadStatusPending: 待使用 - UploadStatusUsed: 已使用 - x-enum-descriptions: - - 待使用 - - 已使用 - - 已删除 - x-enum-varnames: - - UploadStatusPending - - UploadStatusUsed - - UploadStatusDeleted node.AgentReleaseInfo: properties: body: @@ -3895,143 +3621,6 @@ paths: summary: 获取数据库所有表名 tags: - admin - /api/v1/admin/logs: - get: - description: 分页获取系统历史日志,cursor=0 获取最新日志,cursor>0 获取更早日志 - parameters: - - default: 0 - description: 日志游标,0=获取最新 - in: query - name: cursor - type: integer - - default: 200 - description: 每页条数 - in: query - name: limit - type: integer - produces: - - application/json - responses: - "200": - description: 日志列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/logs.logsResponse' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取系统日志 - tags: - - admin - /api/v1/admin/logs/access: - get: - description: 分页并按照用户、接口路径、时间范围等维度检索 ClickHouse 用户访问日志列表(需要管理员权限,ClickHouse 未启用时报错) - parameters: - - default: 1 - description: 页码 - in: query - name: page - type: integer - - default: 20 - description: 每页条数 - in: query - name: page_size - type: integer - - description: 用户名模糊搜索 - in: query - name: username - type: string - - description: 接口路径模糊搜索 - in: query - name: path - type: string - - description: 起始时间(RFC3339 或 YYYY-MM-DD HH:MM:SS) - in: query - name: start_time - type: string - - description: 结束时间(RFC3339 或 YYYY-MM-DD HH:MM:SS) - in: query - name: end_time - type: string - produces: - - application/json - responses: - "200": - description: 访问日志列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/logs.accessLogsResponse' - type: object - "400": - description: ClickHouse 未启用或参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取用户访问日志 - tags: - - admin - /api/v1/admin/logs/analytics: - get: - description: 聚合统计最近 7 天的每日访问趋势、浏览器分布以及前 10 名最活跃用户排行(需要管理员权限,ClickHouse 未启用时报错) - produces: - - application/json - responses: - "200": - description: 分析统计数据 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/logs.logsAnalyticsResponse' - type: object - "400": - description: ClickHouse 未启用 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取访问日志分析数据 - tags: - - admin - /api/v1/admin/logs/ws: - get: - description: 通过 WebSocket 实时推送系统日志,需要管理员权限 - responses: {} - summary: 系统日志实时推送 - tags: - - admin /api/v1/admin/push/channels: get: description: 返回系统配置的所有消息通道列表,需要管理员权限 @@ -5306,224 +4895,6 @@ paths: summary: 下载并应用应用更新 tags: - admin - /api/v1/admin/uploads: - get: - description: 分页获取系统上传的文件列表,支持文件名关键词、业务类型、扩展名、上传用户ID过滤 - parameters: - - description: 页码(默认 1) - in: query - name: page - type: integer - - description: 每页数量(默认 20,最大 100) - in: query - name: page_size - type: integer - - description: 文件名关键词(模糊匹配) - in: query - name: keyword - type: string - - description: 业务分类过滤 - in: query - name: type - type: string - - description: 扩展名过滤 - in: query - name: extension - type: string - - description: 上传用户 ID - format: int64 - in: query - name: user_id - type: integer - produces: - - application/json - responses: - "200": - description: 查询成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/handler.listFilesResponse' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取文件列表 - tags: - - admin - /api/v1/admin/uploads/{id}: - delete: - description: 将文件状态置为 deleted(软删除),不会立即清理底层存储对象 - parameters: - - description: 文件 ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无权操作 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 文件不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除文件 - tags: - - admin - /api/v1/admin/uploads/download/{id}: - get: - description: 根据文件 ID 获取文件,以附件形式 (Attachment) 强制开启客户端浏览器下载 - parameters: - - description: 文件 ID - in: path - name: id - required: true - type: string - - description: 图片质量 (low, medium, high, origin),默认为 origin - in: query - name: quality - type: string - produces: - - application/octet-stream - responses: - "200": - description: 成功下载文件 - schema: - type: file - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 文件不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 服务内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 下载单文件 - tags: - - admin - /api/v1/admin/uploads/download/batch: - post: - consumes: - - application/json - description: 传入多个文件 ID,后台实时将其打包压缩为 ZIP 流并输出,自动处理文件名重复冲突 - parameters: - - description: 包含文件 ID 数组 of string 的请求体 - in: body - name: request - required: true - schema: - $ref: '#/definitions/handler.batchDownloadRequest' - produces: - - application/octet-stream - responses: - "200": - description: 成功下载打包后的 ZIP - schema: - type: file - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 打包失败 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 批量打包下载 - tags: - - admin - /api/v1/admin/uploads/stats: - get: - description: 返回系统级的总文件数、占用大小、最近 7 天新增趋势、文件类型/格式分布等数据 - produces: - - application/json - responses: - "200": - description: 获取成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/handler.fileStatsResponse' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取文件统计数据 - tags: - - admin - /api/v1/admin/uploads/types: - get: - description: 返回数据库中所有已上传文件实际拥有的业务类型列表 - produces: - - application/json - responses: - "200": - description: 业务类型列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - type: string - type: array - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取文件业务类型列表 - tags: - - admin /api/v1/admin/users: get: description: 分页返回用户列表,支持按用户 ID 和用户名筛选,需要管理员权限 @@ -5798,6 +5169,4260 @@ paths: summary: Sample Hello API tags: - custom + /api/v1/d/about: + get: + description: 返回 OpenFlare 关于页面文本,无需登录 + produces: + - application/json + responses: + "200": + description: 关于信息 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + summary: 获取关于信息 + tags: + - openflare-option + /api/v1/d/access-logs: + get: + description: 分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限 + parameters: + - description: 节点 ID + in: query + name: node_id + type: string + - description: 客户端 IP + in: query + name: remote_addr + type: string + - description: 请求 Host + in: query + name: host + type: string + - description: 请求路径 + in: query + name: path + type: string + - description: 页码 + in: query + name: p + type: integer + - description: 每页条数 + in: query + name: page_size + type: integer + - description: 排序字段 + in: query + name: sort_by + type: string + - description: 排序方向 + in: query + name: sort_order + type: string + produces: + - application/json + responses: + "200": + description: 访问日志列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.AccessLogList' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出访问日志 + tags: + - openflare-observability + /api/v1/d/access-logs/cleanup: + post: + consumes: + - application/json + description: 按保留天数清理过期访问日志记录,需要管理员权限 + parameters: + - description: 清理参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/observability.AccessLogCleanupInput' + produces: + - application/json + responses: + "200": + description: 清理结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.AccessLogCleanupResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 清理访问日志 + tags: + - openflare-observability + /api/v1/d/access-logs/folds: + get: + description: 按时间桶聚合访问日志并分页返回,需要管理员权限 + parameters: + - description: 节点 ID + in: query + name: node_id + type: string + - description: 客户端 IP + in: query + name: remote_addr + type: string + - description: 请求 Host + in: query + name: host + type: string + - description: 请求路径 + in: query + name: path + type: string + - description: 折叠时间窗口(分钟) + in: query + name: fold_minutes + type: integer + - description: 页码 + in: query + name: p + type: integer + - description: 每页条数 + in: query + name: page_size + type: integer + - description: 排序字段 + in: query + name: sort_by + type: string + - description: 排序方向 + in: query + name: sort_order + type: string + produces: + - application/json + responses: + "200": + description: 折叠访问日志列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.FoldedAccessLogList' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出折叠访问日志 + tags: + - openflare-observability + /api/v1/d/access-logs/folds/ip-summary: + get: + description: 在指定时间桶内按 IP 聚合访问统计,需要管理员权限 + parameters: + - description: 节点 ID + in: query + name: node_id + type: string + - description: 客户端 IP + in: query + name: remote_addr + type: string + - description: 请求 Host + in: query + name: host + type: string + - description: 请求路径 + in: query + name: path + type: string + - description: 时间桶起始时间 + in: query + name: bucket_started_at + type: string + - description: 折叠时间窗口(分钟) + in: query + name: fold_minutes + type: integer + - description: 页码 + in: query + name: p + type: integer + - description: 每页条数 + in: query + name: page_size + type: integer + - description: 排序字段 + in: query + name: sort_by + type: string + - description: 排序方向 + in: query + name: sort_order + type: string + produces: + - application/json + responses: + "200": + description: 折叠 IP 汇总列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.FoldedAccessLogIPList' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出折叠访问日志 IP 汇总 + tags: + - openflare-observability + /api/v1/d/access-logs/ip-summary: + get: + description: 按 IP 聚合访问日志统计并分页返回,需要管理员权限 + parameters: + - description: 节点 ID + in: query + name: node_id + type: string + - description: 客户端 IP + in: query + name: remote_addr + type: string + - description: 请求 Host + in: query + name: host + type: string + - description: 页码 + in: query + name: p + type: integer + - description: 每页条数 + in: query + name: page_size + type: integer + - description: 排序字段 + in: query + name: sort_by + type: string + - description: 排序方向 + in: query + name: sort_order + type: string + produces: + - application/json + responses: + "200": + description: IP 汇总列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.AccessLogIPSummaryList' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出访问日志 IP 汇总 + tags: + - openflare-observability + /api/v1/d/access-logs/ip-summary/trend: + get: + description: 返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限 + parameters: + - description: 节点 ID + in: query + name: node_id + type: string + - description: 客户端 IP + in: query + name: remote_addr + type: string + - description: 请求 Host + in: query + name: host + type: string + - description: 统计时间范围(小时) + in: query + name: hours + type: integer + - description: 时间桶粒度(分钟) + in: query + name: bucket_minutes + type: integer + produces: + - application/json + responses: + "200": + description: IP 访问趋势 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/observability.AccessLogIPTrendView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取访问日志 IP 趋势 + tags: + - openflare-observability + /api/v1/d/acme-accounts/default: + get: + description: 返回系统默认 ACME 账号配置,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 默认 ACME 账号 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.AcmeAccount' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取默认 ACME 账号 + tags: + - openflare-tls + /api/v1/d/apply-logs: + get: + description: 分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限 + parameters: + - description: 节点 ID 筛选 + in: query + name: node_id + type: string + - description: 页码 + in: query + name: pageNo + type: integer + - description: 页码(别名) + in: query + name: page_no + type: integer + - description: 每页数量 + in: query + name: pageSize + type: integer + - description: 每页数量(别名) + in: query + name: page_size + type: integer + produces: + - application/json + responses: + "200": + description: 下发日志列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/apply_log.ListResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取配置下发日志 + tags: + - openflare-apply-log + /api/v1/d/apply-logs/cleanup: + post: + consumes: + - application/json + description: 按保留天数清理历史下发记录,或删除全部记录,需要管理员权限 + parameters: + - description: 清理参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/apply_log.CleanupInput' + produces: + - application/json + responses: + "200": + description: 清理结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/apply_log.CleanupResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 清理配置下发日志 + tags: + - openflare-apply-log + /api/v1/d/config-versions: + get: + description: 返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 配置版本列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.ConfigVersionSummary' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取配置版本列表 + tags: + - openflare-config-version + /api/v1/d/config-versions/{id}: + get: + description: 返回指定配置版本的完整快照与渲染内容,需要管理员权限 + parameters: + - description: 配置版本 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 配置版本详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ConfigVersion' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或版本不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取配置版本详情 + tags: + - openflare-config-version + /api/v1/d/config-versions/{id}/activate: + post: + description: 将指定历史版本设为当前活跃配置,需要管理员权限 + parameters: + - description: 配置版本 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 激活成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ConfigVersion' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或版本不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 激活配置版本 + tags: + - openflare-config-version + /api/v1/d/config-versions/active: + get: + description: 返回当前正在使用的配置版本,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 活跃配置版本 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ConfigVersion' + type: object + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限、不存在或无活跃版本 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取当前活跃配置版本 + tags: + - openflare-config-version + /api/v1/d/config-versions/cleanup: + post: + consumes: + - application/json + description: 删除超出保留数量的非活跃配置版本,需要管理员权限 + parameters: + - description: 清理参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/config_version.CleanupInput' + produces: + - application/json + responses: + "200": + description: 清理结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/config_version.CleanupResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 清理历史配置版本 + tags: + - openflare-config-version + /api/v1/d/config-versions/diff: + get: + description: 对比当前草稿配置与活跃版本之间的差异,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 配置差异 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/config_version.ConfigDiffResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 对比草稿与活跃配置 + tags: + - openflare-config-version + /api/v1/d/config-versions/preview: + get: + description: 渲染并返回当前草稿配置的预览结果,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 配置预览 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/config_version.ConfigPreviewResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 预览当前草稿配置 + tags: + - openflare-config-version + /api/v1/d/config-versions/publish: + post: + description: 将当前草稿配置发布为新版本,需要管理员权限 + parameters: + - description: 是否强制发布 + in: query + name: force + type: boolean + produces: + - application/json + responses: + "200": + description: 发布成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ConfigVersion' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 发布配置版本 + tags: + - openflare-config-version + /api/v1/d/dashboard/overview: + get: + description: 聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 仪表盘概览 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/dashboard.OverviewPayload' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取仪表盘概览 + tags: + - openflare-dashboard + /api/v1/d/dns-accounts: + get: + description: 返回全部 DNS 提供商账号,需要管理员权限 + produces: + - application/json + responses: + "200": + description: DNS 账号列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.DNSAccount' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 DNS 账号 + tags: + - openflare-tls + post: + consumes: + - application/json + description: 创建新的 DNS 提供商账号,需要管理员权限 + parameters: + - description: DNS 账号参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.DNSAccountInput' + produces: + - application/json + responses: + "200": + description: 创建成功的 DNS 账号 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.DNSAccount' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建 DNS 账号 + tags: + - openflare-tls + /api/v1/d/dns-accounts/{id}/delete: + post: + description: 按 ID 删除 DNS 提供商账号,需要管理员权限 + parameters: + - description: DNS 账号 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 DNS 账号 + tags: + - openflare-tls + /api/v1/d/dns-accounts/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新 DNS 提供商账号,需要管理员权限 + parameters: + - description: DNS 账号 ID + in: path + name: id + required: true + type: integer + - description: DNS 账号参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.DNSAccountInput' + produces: + - application/json + responses: + "200": + description: 更新后的 DNS 账号 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.DNSAccount' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 DNS 账号 + tags: + - openflare-tls + /api/v1/d/managed-domains: + get: + description: 返回全部托管域名及关联证书,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 托管域名列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.ManagedDomain' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出托管域名 + tags: + - openflare-tls + post: + consumes: + - application/json + description: 创建新的托管域名记录,需要管理员权限 + parameters: + - description: 托管域名参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.ManagedDomainInput' + produces: + - application/json + responses: + "200": + description: 创建成功的托管域名 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ManagedDomain' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建托管域名 + tags: + - openflare-tls + /api/v1/d/managed-domains/{id}/delete: + post: + description: 按 ID 删除托管域名,需要管理员权限 + parameters: + - description: 托管域名 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除托管域名 + tags: + - openflare-tls + /api/v1/d/managed-domains/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新托管域名,需要管理员权限 + parameters: + - description: 托管域名 ID + in: path + name: id + required: true + type: integer + - description: 托管域名参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.ManagedDomainInput' + produces: + - application/json + responses: + "200": + description: 更新后的托管域名 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.ManagedDomain' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新托管域名 + tags: + - openflare-tls + /api/v1/d/managed-domains/match: + get: + description: 按域名查询可用的证书匹配候选,需要管理员权限 + parameters: + - description: 域名 + in: query + name: domain + required: true + type: string + produces: + - application/json + responses: + "200": + description: 证书匹配结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/tls.ManagedDomainMatchResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 匹配托管域名证书 + tags: + - openflare-tls + /api/v1/d/nodes: + get: + description: 返回所有节点及最新配置下发记录,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 节点列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/node.View' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取节点列表 + tags: + - openflare-node + post: + consumes: + - application/json + description: 创建新的边缘节点记录,需要管理员权限 + parameters: + - description: 节点参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/node.Input' + produces: + - application/json + responses: + "200": + description: 创建成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建节点 + tags: + - openflare-node + /api/v1/d/nodes/{id}/agent-release: + get: + description: 返回指定节点可用的最新 Agent 版本信息,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + - description: 发布渠道 + in: query + name: channel + type: string + produces: + - application/json + responses: + "200": + description: Agent 发布信息 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.AgentReleaseInfo' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 Agent 发布信息 + tags: + - openflare-node + /api/v1/d/nodes/{id}/agent-update: + post: + consumes: + - application/json + description: 向指定节点下发 Agent 自更新指令,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + - description: 更新参数(可选) + in: body + name: body + schema: + $ref: '#/definitions/node.AgentUpdateInput' + produces: + - application/json + responses: + "200": + description: 更新请求已下发 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 请求 Agent 更新 + tags: + - openflare-node + /api/v1/d/nodes/{id}/delete: + post: + description: 删除指定节点记录,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除节点 + tags: + - openflare-node + /api/v1/d/nodes/{id}/force-sync: + post: + description: 向指定节点下发强制同步当前活跃配置的指令,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 同步请求已下发 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 请求强制同步配置 + tags: + - openflare-node + /api/v1/d/nodes/{id}/observability: + get: + description: 返回指定节点的指标、健康事件与流量分析数据,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + - description: 统计时间范围(小时) + in: query + name: hours + type: integer + - description: 返回记录数量上限 + in: query + name: limit + type: integer + produces: + - application/json + responses: + "200": + description: 可观测性数据 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.ObservabilityView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取节点可观测性数据 + tags: + - openflare-node + /api/v1/d/nodes/{id}/observability/cleanup: + post: + description: 清理指定节点的历史健康事件记录,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 清理结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.HealthEventCleanupResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 清理节点健康事件 + tags: + - openflare-node + /api/v1/d/nodes/{id}/openresty-restart: + post: + description: 向指定节点下发 OpenResty 重启指令,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 重启请求已下发 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 请求重启 OpenResty + tags: + - openflare-node + /api/v1/d/nodes/{id}/update: + post: + consumes: + - application/json + description: 更新指定节点的配置信息,需要管理员权限 + parameters: + - description: 节点 ID + in: path + name: id + required: true + type: integer + - description: 节点参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/node.Input' + produces: + - application/json + responses: + "200": + description: 更新成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或节点不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新节点 + tags: + - openflare-node + /api/v1/d/nodes/bootstrap-token: + get: + description: 返回全局节点发现引导令牌,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 引导令牌 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.BootstrapView' + type: object + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取引导令牌 + tags: + - openflare-node + /api/v1/d/nodes/bootstrap-token/rotate: + post: + description: 重新生成全局节点发现引导令牌,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 新引导令牌 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/node.BootstrapView' + type: object + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 轮换引导令牌 + tags: + - openflare-node + /api/v1/d/notice: + get: + description: 返回 OpenFlare 控制台公告文本,无需登录 + produces: + - application/json + responses: + "200": + description: 系统公告 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + summary: 获取系统公告 + tags: + - openflare-option + /api/v1/d/option: + get: + description: 返回全部非敏感 OpenFlare 配置项,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 配置项列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.OpenFlareOption' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 OpenFlare 配置项 + tags: + - openflare-option + /api/v1/d/option/database/cleanup: + post: + consumes: + - application/json + description: 按目标与保留天数清理可观测性相关数据表,需要管理员权限 + parameters: + - description: 清理参数 + in: body + name: request + schema: + $ref: '#/definitions/option.databaseCleanupInput' + produces: + - application/json + responses: + "200": + description: 清理结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/option.databaseCleanupResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 清理可观测性数据库 + tags: + - openflare-option + /api/v1/d/option/geoip/lookup: + post: + consumes: + - application/json + description: 按提供商与 IP 查询地理位置信息,需要管理员权限 + parameters: + - description: 查询参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/option.geoIPLookupRequest' + produces: + - application/json + responses: + "200": + description: GeoIP 查询结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/option.geoIPLookupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: GeoIP 地址查询 + tags: + - openflare-option + /api/v1/d/option/update: + post: + consumes: + - application/json + description: 更新单个 OpenFlare 配置项,需要管理员权限 + parameters: + - description: 配置项 + in: body + name: request + required: true + schema: + $ref: '#/definitions/model.OpenFlareOption' + produces: + - application/json + responses: + "200": + description: 更新成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 OpenFlare 配置项 + tags: + - openflare-option + /api/v1/d/option/update-batch: + post: + consumes: + - application/json + description: 批量更新多个 OpenFlare 配置项,需要管理员权限 + parameters: + - description: 批量配置项 + in: body + name: request + required: true + schema: + $ref: '#/definitions/option.optionBatchPayload' + produces: + - application/json + responses: + "200": + description: 更新成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 批量更新 OpenFlare 配置项 + tags: + - openflare-option + /api/v1/d/origins: + get: + description: 返回所有源站及关联代理规则数量,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 源站列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/origin.View' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取源站列表 + tags: + - openflare-origin + post: + consumes: + - application/json + description: 创建新的上游源站记录,需要管理员权限 + parameters: + - description: 源站参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/origin.Input' + produces: + - application/json + responses: + "200": + description: 创建成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/origin.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建源站 + tags: + - openflare-origin + /api/v1/d/origins/{id}: + get: + description: 返回指定源站信息及关联代理规则摘要,需要管理员权限 + parameters: + - description: 源站 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 源站详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/origin.DetailView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或源站不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取源站详情 + tags: + - openflare-origin + /api/v1/d/origins/{id}/delete: + post: + description: 删除指定源站记录,需要管理员权限 + parameters: + - description: 源站 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或源站不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除源站 + tags: + - openflare-origin + /api/v1/d/origins/{id}/update: + post: + consumes: + - application/json + description: 更新指定源站的配置信息,需要管理员权限 + parameters: + - description: 源站 ID + in: path + name: id + required: true + type: integer + - description: 源站参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/origin.Input' + produces: + - application/json + responses: + "200": + description: 更新成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/origin.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或源站不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新源站 + tags: + - openflare-origin + /api/v1/d/pages: + get: + description: 返回全部 OpenFlare Pages 项目,需要管理员权限 + produces: + - application/json + responses: + "200": + description: Pages 项目列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/pages.View' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 Pages 项目 + tags: + - openflare-pages + post: + consumes: + - application/json + description: 创建新的 OpenFlare Pages 项目,需要管理员权限 + parameters: + - description: 项目参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/pages.Input' + produces: + - application/json + responses: + "200": + description: 创建成功的项目 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/pages.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建 Pages 项目 + tags: + - openflare-pages + /api/v1/d/pages/{id}: + get: + description: 按 ID 返回 Pages 项目详情,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Pages 项目详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/pages.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 Pages 项目详情 + tags: + - openflare-pages + /api/v1/d/pages/{id}/delete: + post: + description: 按 ID 删除 OpenFlare Pages 项目,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 Pages 项目 + tags: + - openflare-pages + /api/v1/d/pages/{id}/deployments: + get: + description: 返回指定项目的全部部署记录,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 部署列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/pages.DeploymentView' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 Pages 部署 + tags: + - openflare-pages + /api/v1/d/pages/{id}/deployments/{deployment_id}/activate: + post: + description: 将指定部署设为项目当前生效版本,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + - description: 部署 ID + in: path + name: deployment_id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 激活后的项目 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/pages.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目或部署不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 激活 Pages 部署 + tags: + - openflare-pages + /api/v1/d/pages/{id}/deployments/{deployment_id}/delete: + post: + description: 删除指定项目的部署记录,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + - description: 部署 ID + in: path + name: deployment_id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目或部署不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 Pages 部署 + tags: + - openflare-pages + /api/v1/d/pages/{id}/deployments/upload: + post: + consumes: + - multipart/form-data + description: 为指定项目上传 ZIP 部署包,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + - description: 部署包 ZIP 文件 + in: formData + name: package + required: true + type: file + produces: + - application/json + responses: + "200": + description: 部署记录 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/pages.DeploymentView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 上传 Pages 部署包 + tags: + - openflare-pages + /api/v1/d/pages/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新 OpenFlare Pages 项目,需要管理员权限 + parameters: + - description: 项目 ID + in: path + name: id + required: true + type: integer + - description: 项目参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/pages.Input' + produces: + - application/json + responses: + "200": + description: 更新后的项目 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/pages.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 项目不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 Pages 项目 + tags: + - openflare-pages + /api/v1/d/pages/deployments/{deployment_id}/files: + get: + description: 返回指定部署包含的文件清单,需要管理员权限 + parameters: + - description: 部署 ID + in: path + name: deployment_id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 部署文件列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/pages.DeploymentFileView' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 部署不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 Pages 部署文件 + tags: + - openflare-pages + /api/v1/d/proxy-routes: + get: + description: 返回所有代理规则配置,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 代理规则列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/proxy_route.View' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取代理规则列表 + tags: + - openflare-proxy-route + post: + consumes: + - application/json + description: 创建新的反向代理规则,需要管理员权限 + parameters: + - description: 代理规则参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/proxy_route.Input' + produces: + - application/json + responses: + "200": + description: 创建成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/proxy_route.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建代理规则 + tags: + - openflare-proxy-route + /api/v1/d/proxy-routes/{id}: + get: + description: 返回指定代理规则的完整配置,需要管理员权限 + parameters: + - description: 代理规则 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 代理规则详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/proxy_route.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或规则不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取代理规则详情 + tags: + - openflare-proxy-route + /api/v1/d/proxy-routes/{id}/delete: + post: + description: 删除指定代理规则,需要管理员权限 + parameters: + - description: 代理规则 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或规则不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除代理规则 + tags: + - openflare-proxy-route + /api/v1/d/proxy-routes/{id}/update: + post: + consumes: + - application/json + description: 更新指定代理规则的配置,需要管理员权限 + parameters: + - description: 代理规则 ID + in: path + name: id + required: true + type: integer + - description: 代理规则参数 + in: body + name: body + required: true + schema: + $ref: '#/definitions/proxy_route.Input' + produces: + - application/json + responses: + "200": + description: 更新成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/proxy_route.View' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 无权限或规则不存在 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新代理规则 + tags: + - openflare-proxy-route + /api/v1/d/status: + get: + description: 返回版本、认证源与系统公开配置,无需登录 + produces: + - application/json + responses: + "200": + description: 公开状态 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/option.statusView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + summary: 获取 OpenFlare 公开状态 + tags: + - openflare-option + /api/v1/d/tls-certificates: + get: + description: 返回全部 TLS 证书(不含 PEM),需要管理员权限 + produces: + - application/json + responses: + "200": + description: 证书列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/model.TLSCertificate' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 TLS 证书 + tags: + - openflare-tls + post: + consumes: + - application/json + description: 从 PEM 文本创建 TLS 证书,需要管理员权限 + parameters: + - description: 证书参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.CertificateInput' + produces: + - application/json + responses: + "200": + description: 创建成功的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建 TLS 证书 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}: + get: + description: 按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 证书详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 TLS 证书详情 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/content: + get: + description: 按 ID 返回证书与私钥 PEM 内容,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 证书 PEM 内容 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/tls.CertificateContent' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 TLS 证书 PEM 内容 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/convert-acme: + post: + consumes: + - application/json + description: 将已上传证书转换为 ACME 自动续期模式,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + - description: ACME 申请参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.ApplyInput' + produces: + - application/json + responses: + "200": + description: 转换后的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 将证书转为 ACME 管理 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/delete: + post: + description: 按 ID 删除 TLS 证书,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 TLS 证书 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/renew: + post: + description: 手动触发 ACME 证书续期,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 续期后的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 续期 ACME 证书 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新 TLS 证书 PEM 信息,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + - description: 证书参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.CertificateInput' + produces: + - application/json + responses: + "200": + description: 更新后的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 TLS 证书 + tags: + - openflare-tls + /api/v1/d/tls-certificates/{id}/update-acme: + post: + consumes: + - application/json + description: 按 ID 更新 ACME 证书申请配置,需要管理员权限 + parameters: + - description: 证书 ID + in: path + name: id + required: true + type: integer + - description: ACME 申请参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.ApplyInput' + produces: + - application/json + responses: + "200": + description: 更新后的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 ACME 证书配置 + tags: + - openflare-tls + /api/v1/d/tls-certificates/apply: + post: + consumes: + - application/json + description: 通过 ACME 申请新的 TLS 证书,需要管理员权限 + parameters: + - description: ACME 申请参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/tls.ApplyInput' + produces: + - application/json + responses: + "200": + description: 申请中的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 申请 ACME 证书 + tags: + - openflare-tls + /api/v1/d/tls-certificates/import-file: + post: + consumes: + - multipart/form-data + description: 上传证书与私钥文件创建 TLS 证书,需要管理员权限 + parameters: + - description: 证书名称 + in: formData + name: name + type: string + - description: 备注 + in: formData + name: remark + type: string + - description: 证书文件 + in: formData + name: cert_file + required: true + type: file + - description: 私钥文件 + in: formData + name: key_file + required: true + type: file + produces: + - application/json + responses: + "200": + description: 导入成功的证书 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/model.TLSCertificate' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 从文件导入 TLS 证书 + tags: + - openflare-tls + /api/v1/d/update/latest-release: + get: + description: 查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限 + parameters: + - description: 发布渠道(stable/preview) + in: query + name: channel + type: string + produces: + - application/json + responses: + "200": + description: 最新发布信息 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/update.LatestReleaseView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取最新服务端发布版本 + tags: + - openflare-update + /api/v1/d/update/logs/ws: + get: + description: 通过 WebSocket 推送升级进度快照,需要管理员权限 + responses: + "101": + description: WebSocket 升级日志流 + schema: + $ref: '#/definitions/update.StreamSnapshot' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 流式获取服务端升级日志 + tags: + - openflare-update + /api/v1/d/update/manual-upgrade: + post: + consumes: + - application/json + description: 确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限 + produces: + - application/json + responses: + "400": + description: 功能已禁用或参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 确认手动服务端升级 + tags: + - openflare-update + /api/v1/d/update/manual-upload: + post: + consumes: + - multipart/form-data + description: 上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限 + parameters: + - description: 服务端二进制文件 + in: formData + name: binary + required: true + type: file + produces: + - application/json + responses: + "400": + description: 功能已禁用或参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 上传手动升级二进制 + tags: + - openflare-update + /api/v1/d/update/upgrade: + post: + consumes: + - application/json + description: 从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限 + parameters: + - description: 升级参数 + in: body + name: request + schema: + $ref: '#/definitions/update.upgradeRequest' + produces: + - application/json + responses: + "200": + description: 升级任务已调度 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/update.LatestReleaseView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 触发服务端自动升级 + tags: + - openflare-update + /api/v1/d/uptimekuma/sync: + post: + consumes: + - application/json + description: 将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 同步成功 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + type: string + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 同步 Uptime Kuma + tags: + - openflare-option + /api/v1/d/waf/ip-groups: + get: + description: 返回全部 WAF IP 组,需要管理员权限 + produces: + - application/json + responses: + "200": + description: IP 组列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/waf.IPGroupView' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 WAF IP 组 + tags: + - openflare-waf + post: + consumes: + - application/json + description: 创建新的 WAF IP 组,需要管理员权限 + parameters: + - description: IP 组参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.IPGroupInput' + produces: + - application/json + responses: + "200": + description: 创建成功的 IP 组 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.IPGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建 WAF IP 组 + tags: + - openflare-waf + /api/v1/d/waf/ip-groups/{id}: + get: + description: 按 ID 返回 WAF IP 组详情,需要管理员权限 + parameters: + - description: IP 组 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: IP 组详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.IPGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 WAF IP 组详情 + tags: + - openflare-waf + /api/v1/d/waf/ip-groups/{id}/delete: + post: + description: 按 ID 删除 WAF IP 组,需要管理员权限 + parameters: + - description: IP 组 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 WAF IP 组 + tags: + - openflare-waf + /api/v1/d/waf/ip-groups/{id}/sync: + post: + description: 手动触发 WAF IP 组外部 IP 同步,需要管理员权限 + parameters: + - description: IP 组 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 同步结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.IPGroupSyncResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 同步 WAF IP 组 + tags: + - openflare-waf + /api/v1/d/waf/ip-groups/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新 WAF IP 组,需要管理员权限 + parameters: + - description: IP 组 ID + in: path + name: id + required: true + type: integer + - description: IP 组参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.IPGroupInput' + produces: + - application/json + responses: + "200": + description: 更新后的 IP 组 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.IPGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 WAF IP 组 + tags: + - openflare-waf + /api/v1/d/waf/ip-groups/test: + post: + consumes: + - application/json + description: 根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限 + parameters: + - description: 自动配置参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.IPGroupAutoTestInput' + produces: + - application/json + responses: + "200": + description: 测试结果 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.IPGroupAutoTestResult' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 测试 WAF IP 组自动配置 + tags: + - openflare-waf + /api/v1/d/waf/rule-groups: + get: + description: 返回全部 WAF 规则组,需要管理员权限 + produces: + - application/json + responses: + "200": + description: 规则组列表 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + items: + $ref: '#/definitions/waf.RuleGroupView' + type: array + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 列出 WAF 规则组 + tags: + - openflare-waf + post: + consumes: + - application/json + description: 创建新的 WAF 规则组,需要管理员权限 + parameters: + - description: 规则组参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.RuleGroupInput' + produces: + - application/json + responses: + "200": + description: 创建成功的规则组 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.RuleGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 创建 WAF 规则组 + tags: + - openflare-waf + /api/v1/d/waf/rule-groups/{id}: + get: + description: 按 ID 返回 WAF 规则组详情,需要管理员权限 + parameters: + - description: 规则组 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 规则组详情 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.RuleGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取 WAF 规则组详情 + tags: + - openflare-waf + /api/v1/d/waf/rule-groups/{id}/delete: + post: + description: 按 ID 删除 WAF 规则组,需要管理员权限 + parameters: + - description: 规则组 ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 删除成功 + schema: + $ref: '#/definitions/response.Any' + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 删除 WAF 规则组 + tags: + - openflare-waf + /api/v1/d/waf/rule-groups/{id}/sites: + post: + consumes: + - application/json + description: 替换 WAF 规则组关联的代理站点列表,需要管理员权限 + parameters: + - description: 规则组 ID + in: path + name: id + required: true + type: integer + - description: 站点 ID 列表 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.IDsRequest' + produces: + - application/json + responses: + "200": + description: 更新后的规则组 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.RuleGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 替换规则组站点绑定 + tags: + - openflare-waf + /api/v1/d/waf/rule-groups/{id}/update: + post: + consumes: + - application/json + description: 按 ID 更新 WAF 规则组,需要管理员权限 + parameters: + - description: 规则组 ID + in: path + name: id + required: true + type: integer + - description: 规则组参数 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.RuleGroupInput' + produces: + - application/json + responses: + "200": + description: 更新后的规则组 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.RuleGroupView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 更新 WAF 规则组 + tags: + - openflare-waf + /api/v1/d/waf/sites/{route_id}/rule-groups: + get: + description: 返回代理站点关联的 WAF 规则组绑定,需要管理员权限 + parameters: + - description: 代理路由 ID + in: path + name: route_id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: 站点规则组绑定 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.SiteRuleGroupsView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 获取站点 WAF 规则组 + tags: + - openflare-waf + post: + consumes: + - application/json + description: 替换代理站点关联的 WAF 规则组列表,需要管理员权限 + parameters: + - description: 代理路由 ID + in: path + name: route_id + required: true + type: integer + - description: 规则组 ID 列表 + in: body + name: request + required: true + schema: + $ref: '#/definitions/waf.IDsRequest' + produces: + - application/json + responses: + "200": + description: 更新后的站点规则组绑定 + schema: + allOf: + - $ref: '#/definitions/response.Any' + - properties: + data: + $ref: '#/definitions/waf.SiteRuleGroupsView' + type: object + "400": + description: 参数错误 + schema: + $ref: '#/definitions/response.Any' + "401": + description: 未登录 + schema: + $ref: '#/definitions/response.Any' + "403": + description: 无管理员权限 + schema: + $ref: '#/definitions/response.Any' + "404": + description: 记录不存在 + schema: + $ref: '#/definitions/response.Any' + "500": + description: 内部错误 + schema: + $ref: '#/definitions/response.Any' + security: + - SessionCookie: [] + summary: 替换站点 WAF 规则组 + tags: + - openflare-waf /api/v1/oauth/{source}/authorize: get: description: 根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。 @@ -6037,4423 +9662,6 @@ paths: summary: 获取当前登录用户信息 tags: - oauth - /api/v1/openflare/about: - get: - description: 返回 OpenFlare 关于页面文本,无需登录 - produces: - - application/json - responses: - "200": - description: 关于信息 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - summary: 获取关于信息 - tags: - - openflare-option - /api/v1/openflare/access-logs: - get: - description: 分页返回 OpenFlare 访问日志,支持按节点、IP、主机与路径筛选,需要管理员权限 - parameters: - - description: 节点 ID - in: query - name: node_id - type: string - - description: 客户端 IP - in: query - name: remote_addr - type: string - - description: 请求 Host - in: query - name: host - type: string - - description: 请求路径 - in: query - name: path - type: string - - description: 页码 - in: query - name: p - type: integer - - description: 每页条数 - in: query - name: page_size - type: integer - - description: 排序字段 - in: query - name: sort_by - type: string - - description: 排序方向 - in: query - name: sort_order - type: string - produces: - - application/json - responses: - "200": - description: 访问日志列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.AccessLogList' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出访问日志 - tags: - - openflare-observability - /api/v1/openflare/access-logs/cleanup: - post: - consumes: - - application/json - description: 按保留天数清理过期访问日志记录,需要管理员权限 - parameters: - - description: 清理参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/observability.AccessLogCleanupInput' - produces: - - application/json - responses: - "200": - description: 清理结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.AccessLogCleanupResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 清理访问日志 - tags: - - openflare-observability - /api/v1/openflare/access-logs/folds: - get: - description: 按时间桶聚合访问日志并分页返回,需要管理员权限 - parameters: - - description: 节点 ID - in: query - name: node_id - type: string - - description: 客户端 IP - in: query - name: remote_addr - type: string - - description: 请求 Host - in: query - name: host - type: string - - description: 请求路径 - in: query - name: path - type: string - - description: 折叠时间窗口(分钟) - in: query - name: fold_minutes - type: integer - - description: 页码 - in: query - name: p - type: integer - - description: 每页条数 - in: query - name: page_size - type: integer - - description: 排序字段 - in: query - name: sort_by - type: string - - description: 排序方向 - in: query - name: sort_order - type: string - produces: - - application/json - responses: - "200": - description: 折叠访问日志列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.FoldedAccessLogList' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出折叠访问日志 - tags: - - openflare-observability - /api/v1/openflare/access-logs/folds/ip-summary: - get: - description: 在指定时间桶内按 IP 聚合访问统计,需要管理员权限 - parameters: - - description: 节点 ID - in: query - name: node_id - type: string - - description: 客户端 IP - in: query - name: remote_addr - type: string - - description: 请求 Host - in: query - name: host - type: string - - description: 请求路径 - in: query - name: path - type: string - - description: 时间桶起始时间 - in: query - name: bucket_started_at - type: string - - description: 折叠时间窗口(分钟) - in: query - name: fold_minutes - type: integer - - description: 页码 - in: query - name: p - type: integer - - description: 每页条数 - in: query - name: page_size - type: integer - - description: 排序字段 - in: query - name: sort_by - type: string - - description: 排序方向 - in: query - name: sort_order - type: string - produces: - - application/json - responses: - "200": - description: 折叠 IP 汇总列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.FoldedAccessLogIPList' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出折叠访问日志 IP 汇总 - tags: - - openflare-observability - /api/v1/openflare/access-logs/ip-summary: - get: - description: 按 IP 聚合访问日志统计并分页返回,需要管理员权限 - parameters: - - description: 节点 ID - in: query - name: node_id - type: string - - description: 客户端 IP - in: query - name: remote_addr - type: string - - description: 请求 Host - in: query - name: host - type: string - - description: 页码 - in: query - name: p - type: integer - - description: 每页条数 - in: query - name: page_size - type: integer - - description: 排序字段 - in: query - name: sort_by - type: string - - description: 排序方向 - in: query - name: sort_order - type: string - produces: - - application/json - responses: - "200": - description: IP 汇总列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.AccessLogIPSummaryList' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出访问日志 IP 汇总 - tags: - - openflare-observability - /api/v1/openflare/access-logs/ip-summary/trend: - get: - description: 返回指定 IP 在时间范围内的访问趋势数据,需要管理员权限 - parameters: - - description: 节点 ID - in: query - name: node_id - type: string - - description: 客户端 IP - in: query - name: remote_addr - type: string - - description: 请求 Host - in: query - name: host - type: string - - description: 统计时间范围(小时) - in: query - name: hours - type: integer - - description: 时间桶粒度(分钟) - in: query - name: bucket_minutes - type: integer - produces: - - application/json - responses: - "200": - description: IP 访问趋势 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/observability.AccessLogIPTrendView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取访问日志 IP 趋势 - tags: - - openflare-observability - /api/v1/openflare/acme-accounts/default: - get: - description: 返回系统默认 ACME 账号配置,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 默认 ACME 账号 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.AcmeAccount' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取默认 ACME 账号 - tags: - - openflare-tls - /api/v1/openflare/apply-logs: - get: - description: 分页返回节点配置下发记录,支持按节点 ID 筛选,需要管理员权限 - parameters: - - description: 节点 ID 筛选 - in: query - name: node_id - type: string - - description: 页码 - in: query - name: pageNo - type: integer - - description: 页码(别名) - in: query - name: page_no - type: integer - - description: 每页数量 - in: query - name: pageSize - type: integer - - description: 每页数量(别名) - in: query - name: page_size - type: integer - produces: - - application/json - responses: - "200": - description: 下发日志列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/apply_log.ListResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取配置下发日志 - tags: - - openflare-apply-log - /api/v1/openflare/apply-logs/cleanup: - post: - consumes: - - application/json - description: 按保留天数清理历史下发记录,或删除全部记录,需要管理员权限 - parameters: - - description: 清理参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/apply_log.CleanupInput' - produces: - - application/json - responses: - "200": - description: 清理结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/apply_log.CleanupResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 清理配置下发日志 - tags: - - openflare-apply-log - /api/v1/openflare/config-versions: - get: - description: 返回所有已发布的 OpenResty 配置版本摘要,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 配置版本列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.ConfigVersionSummary' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取配置版本列表 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/{id}: - get: - description: 返回指定配置版本的完整快照与渲染内容,需要管理员权限 - parameters: - - description: 配置版本 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 配置版本详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ConfigVersion' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或版本不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取配置版本详情 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/{id}/activate: - post: - description: 将指定历史版本设为当前活跃配置,需要管理员权限 - parameters: - - description: 配置版本 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 激活成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ConfigVersion' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或版本不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 激活配置版本 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/active: - get: - description: 返回当前正在使用的配置版本,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 活跃配置版本 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ConfigVersion' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限、不存在或无活跃版本 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取当前活跃配置版本 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/cleanup: - post: - consumes: - - application/json - description: 删除超出保留数量的非活跃配置版本,需要管理员权限 - parameters: - - description: 清理参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/config_version.CleanupInput' - produces: - - application/json - responses: - "200": - description: 清理结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/config_version.CleanupResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 清理历史配置版本 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/diff: - get: - description: 对比当前草稿配置与活跃版本之间的差异,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 配置差异 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/config_version.ConfigDiffResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 对比草稿与活跃配置 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/preview: - get: - description: 渲染并返回当前草稿配置的预览结果,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 配置预览 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/config_version.ConfigPreviewResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 预览当前草稿配置 - tags: - - openflare-config-version - /api/v1/openflare/config-versions/publish: - post: - description: 将当前草稿配置发布为新版本,需要管理员权限 - parameters: - - description: 是否强制发布 - in: query - name: force - type: boolean - produces: - - application/json - responses: - "200": - description: 发布成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ConfigVersion' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 发布配置版本 - tags: - - openflare-config-version - /api/v1/openflare/dashboard/overview: - get: - description: 聚合节点与可观测性数据,返回 OpenFlare 控制台仪表盘概览,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 仪表盘概览 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/dashboard.OverviewPayload' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取仪表盘概览 - tags: - - openflare-dashboard - /api/v1/openflare/dns-accounts: - get: - description: 返回全部 DNS 提供商账号,需要管理员权限 - produces: - - application/json - responses: - "200": - description: DNS 账号列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.DNSAccount' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 DNS 账号 - tags: - - openflare-tls - post: - consumes: - - application/json - description: 创建新的 DNS 提供商账号,需要管理员权限 - parameters: - - description: DNS 账号参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.DNSAccountInput' - produces: - - application/json - responses: - "200": - description: 创建成功的 DNS 账号 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.DNSAccount' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建 DNS 账号 - tags: - - openflare-tls - /api/v1/openflare/dns-accounts/{id}/delete: - post: - description: 按 ID 删除 DNS 提供商账号,需要管理员权限 - parameters: - - description: DNS 账号 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 DNS 账号 - tags: - - openflare-tls - /api/v1/openflare/dns-accounts/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新 DNS 提供商账号,需要管理员权限 - parameters: - - description: DNS 账号 ID - in: path - name: id - required: true - type: integer - - description: DNS 账号参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.DNSAccountInput' - produces: - - application/json - responses: - "200": - description: 更新后的 DNS 账号 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.DNSAccount' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 DNS 账号 - tags: - - openflare-tls - /api/v1/openflare/managed-domains: - get: - description: 返回全部托管域名及关联证书,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 托管域名列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.ManagedDomain' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出托管域名 - tags: - - openflare-tls - post: - consumes: - - application/json - description: 创建新的托管域名记录,需要管理员权限 - parameters: - - description: 托管域名参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.ManagedDomainInput' - produces: - - application/json - responses: - "200": - description: 创建成功的托管域名 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ManagedDomain' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建托管域名 - tags: - - openflare-tls - /api/v1/openflare/managed-domains/{id}/delete: - post: - description: 按 ID 删除托管域名,需要管理员权限 - parameters: - - description: 托管域名 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除托管域名 - tags: - - openflare-tls - /api/v1/openflare/managed-domains/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新托管域名,需要管理员权限 - parameters: - - description: 托管域名 ID - in: path - name: id - required: true - type: integer - - description: 托管域名参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.ManagedDomainInput' - produces: - - application/json - responses: - "200": - description: 更新后的托管域名 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.ManagedDomain' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新托管域名 - tags: - - openflare-tls - /api/v1/openflare/managed-domains/match: - get: - description: 按域名查询可用的证书匹配候选,需要管理员权限 - parameters: - - description: 域名 - in: query - name: domain - required: true - type: string - produces: - - application/json - responses: - "200": - description: 证书匹配结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/tls.ManagedDomainMatchResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 匹配托管域名证书 - tags: - - openflare-tls - /api/v1/openflare/nodes: - get: - description: 返回所有节点及最新配置下发记录,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 节点列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/node.View' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取节点列表 - tags: - - openflare-node - post: - consumes: - - application/json - description: 创建新的边缘节点记录,需要管理员权限 - parameters: - - description: 节点参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/node.Input' - produces: - - application/json - responses: - "200": - description: 创建成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建节点 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/agent-release: - get: - description: 返回指定节点可用的最新 Agent 版本信息,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - - description: 发布渠道 - in: query - name: channel - type: string - produces: - - application/json - responses: - "200": - description: Agent 发布信息 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.AgentReleaseInfo' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 Agent 发布信息 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/agent-update: - post: - consumes: - - application/json - description: 向指定节点下发 Agent 自更新指令,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - - description: 更新参数(可选) - in: body - name: body - schema: - $ref: '#/definitions/node.AgentUpdateInput' - produces: - - application/json - responses: - "200": - description: 更新请求已下发 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 请求 Agent 更新 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/delete: - post: - description: 删除指定节点记录,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除节点 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/force-sync: - post: - description: 向指定节点下发强制同步当前活跃配置的指令,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 同步请求已下发 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 请求强制同步配置 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/observability: - get: - description: 返回指定节点的指标、健康事件与流量分析数据,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - - description: 统计时间范围(小时) - in: query - name: hours - type: integer - - description: 返回记录数量上限 - in: query - name: limit - type: integer - produces: - - application/json - responses: - "200": - description: 可观测性数据 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.ObservabilityView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取节点可观测性数据 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/observability/cleanup: - post: - description: 清理指定节点的历史健康事件记录,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 清理结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.HealthEventCleanupResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 清理节点健康事件 - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/openresty-restart: - post: - description: 向指定节点下发 OpenResty 重启指令,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 重启请求已下发 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 请求重启 OpenResty - tags: - - openflare-node - /api/v1/openflare/nodes/{id}/update: - post: - consumes: - - application/json - description: 更新指定节点的配置信息,需要管理员权限 - parameters: - - description: 节点 ID - in: path - name: id - required: true - type: integer - - description: 节点参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/node.Input' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或节点不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新节点 - tags: - - openflare-node - /api/v1/openflare/nodes/bootstrap-token: - get: - description: 返回全局节点发现引导令牌,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 引导令牌 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.BootstrapView' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取引导令牌 - tags: - - openflare-node - /api/v1/openflare/nodes/bootstrap-token/rotate: - post: - description: 重新生成全局节点发现引导令牌,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 新引导令牌 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/node.BootstrapView' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 轮换引导令牌 - tags: - - openflare-node - /api/v1/openflare/notice: - get: - description: 返回 OpenFlare 控制台公告文本,无需登录 - produces: - - application/json - responses: - "200": - description: 系统公告 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - summary: 获取系统公告 - tags: - - openflare-option - /api/v1/openflare/option: - get: - description: 返回全部非敏感 OpenFlare 配置项,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 配置项列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.OpenFlareOption' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 OpenFlare 配置项 - tags: - - openflare-option - /api/v1/openflare/option/database/cleanup: - post: - consumes: - - application/json - description: 按目标与保留天数清理可观测性相关数据表,需要管理员权限 - parameters: - - description: 清理参数 - in: body - name: request - schema: - $ref: '#/definitions/option.databaseCleanupInput' - produces: - - application/json - responses: - "200": - description: 清理结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/option.databaseCleanupResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 清理可观测性数据库 - tags: - - openflare-option - /api/v1/openflare/option/geoip/lookup: - post: - consumes: - - application/json - description: 按提供商与 IP 查询地理位置信息,需要管理员权限 - parameters: - - description: 查询参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/option.geoIPLookupRequest' - produces: - - application/json - responses: - "200": - description: GeoIP 查询结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/option.geoIPLookupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: GeoIP 地址查询 - tags: - - openflare-option - /api/v1/openflare/option/update: - post: - consumes: - - application/json - description: 更新单个 OpenFlare 配置项,需要管理员权限 - parameters: - - description: 配置项 - in: body - name: request - required: true - schema: - $ref: '#/definitions/model.OpenFlareOption' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 OpenFlare 配置项 - tags: - - openflare-option - /api/v1/openflare/option/update-batch: - post: - consumes: - - application/json - description: 批量更新多个 OpenFlare 配置项,需要管理员权限 - parameters: - - description: 批量配置项 - in: body - name: request - required: true - schema: - $ref: '#/definitions/option.optionBatchPayload' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 批量更新 OpenFlare 配置项 - tags: - - openflare-option - /api/v1/openflare/origins: - get: - description: 返回所有源站及关联代理规则数量,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 源站列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/origin.View' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取源站列表 - tags: - - openflare-origin - post: - consumes: - - application/json - description: 创建新的上游源站记录,需要管理员权限 - parameters: - - description: 源站参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/origin.Input' - produces: - - application/json - responses: - "200": - description: 创建成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/origin.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建源站 - tags: - - openflare-origin - /api/v1/openflare/origins/{id}: - get: - description: 返回指定源站信息及关联代理规则摘要,需要管理员权限 - parameters: - - description: 源站 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 源站详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/origin.DetailView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或源站不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取源站详情 - tags: - - openflare-origin - /api/v1/openflare/origins/{id}/delete: - post: - description: 删除指定源站记录,需要管理员权限 - parameters: - - description: 源站 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或源站不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除源站 - tags: - - openflare-origin - /api/v1/openflare/origins/{id}/update: - post: - consumes: - - application/json - description: 更新指定源站的配置信息,需要管理员权限 - parameters: - - description: 源站 ID - in: path - name: id - required: true - type: integer - - description: 源站参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/origin.Input' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/origin.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或源站不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新源站 - tags: - - openflare-origin - /api/v1/openflare/pages: - get: - description: 返回全部 OpenFlare Pages 项目,需要管理员权限 - produces: - - application/json - responses: - "200": - description: Pages 项目列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/pages.View' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 Pages 项目 - tags: - - openflare-pages - post: - consumes: - - application/json - description: 创建新的 OpenFlare Pages 项目,需要管理员权限 - parameters: - - description: 项目参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/pages.Input' - produces: - - application/json - responses: - "200": - description: 创建成功的项目 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/pages.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建 Pages 项目 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}: - get: - description: 按 ID 返回 Pages 项目详情,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: Pages 项目详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/pages.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 Pages 项目详情 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/delete: - post: - description: 按 ID 删除 OpenFlare Pages 项目,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 Pages 项目 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/deployments: - get: - description: 返回指定项目的全部部署记录,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 部署列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/pages.DeploymentView' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 Pages 部署 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/deployments/{deployment_id}/activate: - post: - description: 将指定部署设为项目当前生效版本,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - - description: 部署 ID - in: path - name: deployment_id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 激活后的项目 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/pages.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目或部署不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 激活 Pages 部署 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/deployments/{deployment_id}/delete: - post: - description: 删除指定项目的部署记录,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - - description: 部署 ID - in: path - name: deployment_id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目或部署不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 Pages 部署 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/deployments/upload: - post: - consumes: - - multipart/form-data - description: 为指定项目上传 ZIP 部署包,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - - description: 部署包 ZIP 文件 - in: formData - name: package - required: true - type: file - produces: - - application/json - responses: - "200": - description: 部署记录 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/pages.DeploymentView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 上传 Pages 部署包 - tags: - - openflare-pages - /api/v1/openflare/pages/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新 OpenFlare Pages 项目,需要管理员权限 - parameters: - - description: 项目 ID - in: path - name: id - required: true - type: integer - - description: 项目参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/pages.Input' - produces: - - application/json - responses: - "200": - description: 更新后的项目 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/pages.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 项目不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 Pages 项目 - tags: - - openflare-pages - /api/v1/openflare/pages/deployments/{deployment_id}/files: - get: - description: 返回指定部署包含的文件清单,需要管理员权限 - parameters: - - description: 部署 ID - in: path - name: deployment_id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 部署文件列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/pages.DeploymentFileView' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 部署不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 Pages 部署文件 - tags: - - openflare-pages - /api/v1/openflare/proxy-routes: - get: - description: 返回所有代理规则配置,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 代理规则列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/proxy_route.View' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取代理规则列表 - tags: - - openflare-proxy-route - post: - consumes: - - application/json - description: 创建新的反向代理规则,需要管理员权限 - parameters: - - description: 代理规则参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/proxy_route.Input' - produces: - - application/json - responses: - "200": - description: 创建成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/proxy_route.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建代理规则 - tags: - - openflare-proxy-route - /api/v1/openflare/proxy-routes/{id}: - get: - description: 返回指定代理规则的完整配置,需要管理员权限 - parameters: - - description: 代理规则 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 代理规则详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/proxy_route.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或规则不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取代理规则详情 - tags: - - openflare-proxy-route - /api/v1/openflare/proxy-routes/{id}/delete: - post: - description: 删除指定代理规则,需要管理员权限 - parameters: - - description: 代理规则 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或规则不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除代理规则 - tags: - - openflare-proxy-route - /api/v1/openflare/proxy-routes/{id}/update: - post: - consumes: - - application/json - description: 更新指定代理规则的配置,需要管理员权限 - parameters: - - description: 代理规则 ID - in: path - name: id - required: true - type: integer - - description: 代理规则参数 - in: body - name: body - required: true - schema: - $ref: '#/definitions/proxy_route.Input' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/proxy_route.View' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 无权限或规则不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新代理规则 - tags: - - openflare-proxy-route - /api/v1/openflare/status: - get: - description: 返回版本、认证源与系统公开配置,无需登录 - produces: - - application/json - responses: - "200": - description: 公开状态 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/option.statusView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - summary: 获取 OpenFlare 公开状态 - tags: - - openflare-option - /api/v1/openflare/tls-certificates: - get: - description: 返回全部 TLS 证书(不含 PEM),需要管理员权限 - produces: - - application/json - responses: - "200": - description: 证书列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/model.TLSCertificate' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 TLS 证书 - tags: - - openflare-tls - post: - consumes: - - application/json - description: 从 PEM 文本创建 TLS 证书,需要管理员权限 - parameters: - - description: 证书参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.CertificateInput' - produces: - - application/json - responses: - "200": - description: 创建成功的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建 TLS 证书 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}: - get: - description: 按 ID 返回 TLS 证书详情(不含 PEM),需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 证书详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 TLS 证书详情 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/content: - get: - description: 按 ID 返回证书与私钥 PEM 内容,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 证书 PEM 内容 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/tls.CertificateContent' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 TLS 证书 PEM 内容 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/convert-acme: - post: - consumes: - - application/json - description: 将已上传证书转换为 ACME 自动续期模式,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - - description: ACME 申请参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.ApplyInput' - produces: - - application/json - responses: - "200": - description: 转换后的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 将证书转为 ACME 管理 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/delete: - post: - description: 按 ID 删除 TLS 证书,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 TLS 证书 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/renew: - post: - description: 手动触发 ACME 证书续期,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 续期后的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 续期 ACME 证书 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新 TLS 证书 PEM 信息,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - - description: 证书参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.CertificateInput' - produces: - - application/json - responses: - "200": - description: 更新后的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 TLS 证书 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/{id}/update-acme: - post: - consumes: - - application/json - description: 按 ID 更新 ACME 证书申请配置,需要管理员权限 - parameters: - - description: 证书 ID - in: path - name: id - required: true - type: integer - - description: ACME 申请参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.ApplyInput' - produces: - - application/json - responses: - "200": - description: 更新后的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 ACME 证书配置 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/apply: - post: - consumes: - - application/json - description: 通过 ACME 申请新的 TLS 证书,需要管理员权限 - parameters: - - description: ACME 申请参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/tls.ApplyInput' - produces: - - application/json - responses: - "200": - description: 申请中的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 申请 ACME 证书 - tags: - - openflare-tls - /api/v1/openflare/tls-certificates/import-file: - post: - consumes: - - multipart/form-data - description: 上传证书与私钥文件创建 TLS 证书,需要管理员权限 - parameters: - - description: 证书名称 - in: formData - name: name - type: string - - description: 备注 - in: formData - name: remark - type: string - - description: 证书文件 - in: formData - name: cert_file - required: true - type: file - - description: 私钥文件 - in: formData - name: key_file - required: true - type: file - produces: - - application/json - responses: - "200": - description: 导入成功的证书 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.TLSCertificate' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 从文件导入 TLS 证书 - tags: - - openflare-tls - /api/v1/openflare/update/latest-release: - get: - description: 查询 OpenFlare 服务端最新 GitHub Release 及升级状态,需要管理员权限 - parameters: - - description: 发布渠道(stable/preview) - in: query - name: channel - type: string - produces: - - application/json - responses: - "200": - description: 最新发布信息 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/update.LatestReleaseView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取最新服务端发布版本 - tags: - - openflare-update - /api/v1/openflare/update/logs/ws: - get: - description: 通过 WebSocket 推送升级进度快照,需要管理员权限 - responses: - "101": - description: WebSocket 升级日志流 - schema: - $ref: '#/definitions/update.StreamSnapshot' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 流式获取服务端升级日志 - tags: - - openflare-update - /api/v1/openflare/update/manual-upgrade: - post: - consumes: - - application/json - description: 确认并执行手动上传的服务端升级(当前功能已禁用),需要管理员权限 - produces: - - application/json - responses: - "400": - description: 功能已禁用或参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 确认手动服务端升级 - tags: - - openflare-update - /api/v1/openflare/update/manual-upload: - post: - consumes: - - multipart/form-data - description: 上传服务端二进制以进行手动升级(当前功能已禁用),需要管理员权限 - parameters: - - description: 服务端二进制文件 - in: formData - name: binary - required: true - type: file - produces: - - application/json - responses: - "400": - description: 功能已禁用或参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 上传手动升级二进制 - tags: - - openflare-update - /api/v1/openflare/update/upgrade: - post: - consumes: - - application/json - description: 从最新 Release 调度 OpenFlare 服务端自动升级,需要管理员权限 - parameters: - - description: 升级参数 - in: body - name: request - schema: - $ref: '#/definitions/update.upgradeRequest' - produces: - - application/json - responses: - "200": - description: 升级任务已调度 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/update.LatestReleaseView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 触发服务端自动升级 - tags: - - openflare-update - /api/v1/openflare/uptimekuma/sync: - post: - consumes: - - application/json - description: 将 OpenFlare 节点同步到 Uptime Kuma,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 同步成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - type: string - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 同步 Uptime Kuma - tags: - - openflare-option - /api/v1/openflare/waf/ip-groups: - get: - description: 返回全部 WAF IP 组,需要管理员权限 - produces: - - application/json - responses: - "200": - description: IP 组列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/waf.IPGroupView' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 WAF IP 组 - tags: - - openflare-waf - post: - consumes: - - application/json - description: 创建新的 WAF IP 组,需要管理员权限 - parameters: - - description: IP 组参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.IPGroupInput' - produces: - - application/json - responses: - "200": - description: 创建成功的 IP 组 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.IPGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建 WAF IP 组 - tags: - - openflare-waf - /api/v1/openflare/waf/ip-groups/{id}: - get: - description: 按 ID 返回 WAF IP 组详情,需要管理员权限 - parameters: - - description: IP 组 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: IP 组详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.IPGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 WAF IP 组详情 - tags: - - openflare-waf - /api/v1/openflare/waf/ip-groups/{id}/delete: - post: - description: 按 ID 删除 WAF IP 组,需要管理员权限 - parameters: - - description: IP 组 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 WAF IP 组 - tags: - - openflare-waf - /api/v1/openflare/waf/ip-groups/{id}/sync: - post: - description: 手动触发 WAF IP 组外部 IP 同步,需要管理员权限 - parameters: - - description: IP 组 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 同步结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.IPGroupSyncResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 同步 WAF IP 组 - tags: - - openflare-waf - /api/v1/openflare/waf/ip-groups/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新 WAF IP 组,需要管理员权限 - parameters: - - description: IP 组 ID - in: path - name: id - required: true - type: integer - - description: IP 组参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.IPGroupInput' - produces: - - application/json - responses: - "200": - description: 更新后的 IP 组 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.IPGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 WAF IP 组 - tags: - - openflare-waf - /api/v1/openflare/waf/ip-groups/test: - post: - consumes: - - application/json - description: 根据自动配置规则测试 IP 匹配结果(桩实现),需要管理员权限 - parameters: - - description: 自动配置参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.IPGroupAutoTestInput' - produces: - - application/json - responses: - "200": - description: 测试结果 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.IPGroupAutoTestResult' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 测试 WAF IP 组自动配置 - tags: - - openflare-waf - /api/v1/openflare/waf/rule-groups: - get: - description: 返回全部 WAF 规则组,需要管理员权限 - produces: - - application/json - responses: - "200": - description: 规则组列表 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - items: - $ref: '#/definitions/waf.RuleGroupView' - type: array - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 列出 WAF 规则组 - tags: - - openflare-waf - post: - consumes: - - application/json - description: 创建新的 WAF 规则组,需要管理员权限 - parameters: - - description: 规则组参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.RuleGroupInput' - produces: - - application/json - responses: - "200": - description: 创建成功的规则组 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.RuleGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 创建 WAF 规则组 - tags: - - openflare-waf - /api/v1/openflare/waf/rule-groups/{id}: - get: - description: 按 ID 返回 WAF 规则组详情,需要管理员权限 - parameters: - - description: 规则组 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 规则组详情 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.RuleGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取 WAF 规则组详情 - tags: - - openflare-waf - /api/v1/openflare/waf/rule-groups/{id}/delete: - post: - description: 按 ID 删除 WAF 规则组,需要管理员权限 - parameters: - - description: 规则组 ID - in: path - name: id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除 WAF 规则组 - tags: - - openflare-waf - /api/v1/openflare/waf/rule-groups/{id}/sites: - post: - consumes: - - application/json - description: 替换 WAF 规则组关联的代理站点列表,需要管理员权限 - parameters: - - description: 规则组 ID - in: path - name: id - required: true - type: integer - - description: 站点 ID 列表 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.IDsRequest' - produces: - - application/json - responses: - "200": - description: 更新后的规则组 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.RuleGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 替换规则组站点绑定 - tags: - - openflare-waf - /api/v1/openflare/waf/rule-groups/{id}/update: - post: - consumes: - - application/json - description: 按 ID 更新 WAF 规则组,需要管理员权限 - parameters: - - description: 规则组 ID - in: path - name: id - required: true - type: integer - - description: 规则组参数 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.RuleGroupInput' - produces: - - application/json - responses: - "200": - description: 更新后的规则组 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.RuleGroupView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新 WAF 规则组 - tags: - - openflare-waf - /api/v1/openflare/waf/sites/{route_id}/rule-groups: - get: - description: 返回代理站点关联的 WAF 规则组绑定,需要管理员权限 - parameters: - - description: 代理路由 ID - in: path - name: route_id - required: true - type: integer - produces: - - application/json - responses: - "200": - description: 站点规则组绑定 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.SiteRuleGroupsView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取站点 WAF 规则组 - tags: - - openflare-waf - post: - consumes: - - application/json - description: 替换代理站点关联的 WAF 规则组列表,需要管理员权限 - parameters: - - description: 代理路由 ID - in: path - name: route_id - required: true - type: integer - - description: 规则组 ID 列表 - in: body - name: request - required: true - schema: - $ref: '#/definitions/waf.IDsRequest' - produces: - - application/json - responses: - "200": - description: 更新后的站点规则组绑定 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/waf.SiteRuleGroupsView' - type: object - "400": - description: 参数错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无管理员权限 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 记录不存在 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 替换站点 WAF 规则组 - tags: - - openflare-waf - /api/v1/upload: - post: - consumes: - - multipart/form-data - description: 支持各种类型的通用文件上传,支持自动文件类型检测、哈希计算与“秒传”去重 - parameters: - - description: 要上传的文件 - in: formData - name: file - required: true - type: file - - description: '业务分类 (例如: avatar, attachment, doc,默认为 generic)' - in: formData - name: type - type: string - - description: 额外的 JSON 格式元数据 - in: formData - name: metadata - type: string - produces: - - application/json - responses: - "200": - description: 上传成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.Upload' - type: object - "400": - description: 请求参数错误或文件受限 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 内部错误 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 上传文件 - tags: - - upload - /api/v1/upload/{id}: - delete: - description: 将当前用户本人的文件状态置为 deleted(软删除) - parameters: - - description: 文件 ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: 删除成功 - schema: - $ref: '#/definitions/response.Any' - "403": - description: 无权操作 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 文件不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 删除我的文件 - tags: - - upload - put: - consumes: - - application/json - description: 更新当前用户本人的文件名或访问权限模式 (AccessMode) - parameters: - - description: 文件 ID - in: path - name: id - required: true - type: string - - description: 更新字段 - in: body - name: request - required: true - schema: - $ref: '#/definitions/handler.updateMyFileRequest' - produces: - - application/json - responses: - "200": - description: 更新成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/model.Upload' - type: object - "403": - description: 无权操作 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 文件不存在 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 更新我的文件信息 - tags: - - upload - /api/v1/upload/my: - get: - description: 分页获取当前登录用户上传的文件,支持文件名关键词、业务类型、扩展名过滤 - parameters: - - description: 页码(默认 1) - in: query - name: page - type: integer - - description: 每页数量(默认 20,最大 100) - in: query - name: page_size - type: integer - - description: 文件名关键词(模糊匹配) - in: query - name: keyword - type: string - - description: 业务分类过滤 - in: query - name: type - type: string - - description: 扩展名过滤 - in: query - name: extension - type: string - produces: - - application/json - responses: - "200": - description: 查询成功 - schema: - allOf: - - $ref: '#/definitions/response.Any' - - properties: - data: - $ref: '#/definitions/handler.listMyFilesResponse' - type: object - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - security: - - SessionCookie: [] - summary: 获取我的文件列表 - tags: - - upload /api/v1/user-info: get: description: 返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。 @@ -10810,45 +10018,6 @@ paths: summary: 发送邮箱验证码 tags: - user - /f/{id}: - get: - description: 根据文件 ID 获取并提供已上传的临时或正式文件,若配置了缓存则优先走本地缓存,否则从 S3 等后端存储读取并流式返回 - parameters: - - description: 文件 ID - in: path - name: id - required: true - type: string - - description: 图片质量 (low, medium, high, origin),默认为 origin - in: query - name: quality - type: string - produces: - - application/octet-stream - responses: - "200": - description: 成功获取文件内容 - schema: - type: file - "400": - description: 文件 ID 格式错误 - schema: - $ref: '#/definitions/response.Any' - "401": - description: 未登录 - schema: - $ref: '#/definitions/response.Any' - "404": - description: 文件未找到 - schema: - $ref: '#/definitions/response.Any' - "500": - description: 服务内部错误 - schema: - $ref: '#/definitions/response.Any' - summary: 获取已上传文件 - tags: - - upload /robots.txt: get: description: 根据系统配置决定是否允许搜索引擎检索,并返回相应的 robots.txt 文件内容 diff --git a/Wavelet/frontend/lib/services/openflare/access-log.service.ts b/Wavelet/frontend/lib/services/openflare/access-log.service.ts index fc2964d8..59489465 100644 --- a/Wavelet/frontend/lib/services/openflare/access-log.service.ts +++ b/Wavelet/frontend/lib/services/openflare/access-log.service.ts @@ -26,7 +26,7 @@ function buildSearchParams(filters: object): Record { } export class AccessLogService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/access-logs'; + protected static override readonly basePath: string = '/api/v1/d/access-logs'; static list(filters: AccessLogFilters = {}): Promise { return this.get('/', buildSearchParams(filters)); diff --git a/Wavelet/frontend/lib/services/openflare/apply-log.service.ts b/Wavelet/frontend/lib/services/openflare/apply-log.service.ts index 38032cd0..e10f4a69 100644 --- a/Wavelet/frontend/lib/services/openflare/apply-log.service.ts +++ b/Wavelet/frontend/lib/services/openflare/apply-log.service.ts @@ -7,7 +7,7 @@ import type { } from './types'; export class ApplyLogService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/apply-logs'; + protected static override readonly basePath: string = '/api/v1/d/apply-logs'; static list(query: ApplyLogListQuery = {}): Promise { const params: Record = {}; diff --git a/Wavelet/frontend/lib/services/openflare/base.service.ts b/Wavelet/frontend/lib/services/openflare/base.service.ts index 1a03379f..9310d40a 100644 --- a/Wavelet/frontend/lib/services/openflare/base.service.ts +++ b/Wavelet/frontend/lib/services/openflare/base.service.ts @@ -1,5 +1,5 @@ import {BaseService} from '@/lib/services/core'; export class OpenFlareBaseService extends BaseService { - protected static override readonly basePath: string = '/api/v1/openflare'; + protected static override readonly basePath: string = '/api/v1/d'; } \ No newline at end of file diff --git a/Wavelet/frontend/lib/services/openflare/config-version.service.ts b/Wavelet/frontend/lib/services/openflare/config-version.service.ts index 2847c7b0..461a6855 100644 --- a/Wavelet/frontend/lib/services/openflare/config-version.service.ts +++ b/Wavelet/frontend/lib/services/openflare/config-version.service.ts @@ -11,7 +11,7 @@ import type { } from './types'; export class ConfigVersionService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/config-versions'; + protected static override readonly basePath: string = '/api/v1/d/config-versions'; static list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/dashboard.service.ts b/Wavelet/frontend/lib/services/openflare/dashboard.service.ts index 7f67fa06..5e81c8e9 100644 --- a/Wavelet/frontend/lib/services/openflare/dashboard.service.ts +++ b/Wavelet/frontend/lib/services/openflare/dashboard.service.ts @@ -231,7 +231,7 @@ function normalizeDashboardOverview( } export class DashboardService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/dashboard'; + protected static override readonly basePath: string = '/api/v1/d/dashboard'; static async getOverview(): Promise { const overview = await this.get< diff --git a/Wavelet/frontend/lib/services/openflare/dns-account.service.ts b/Wavelet/frontend/lib/services/openflare/dns-account.service.ts index 96519ade..d3d7924b 100644 --- a/Wavelet/frontend/lib/services/openflare/dns-account.service.ts +++ b/Wavelet/frontend/lib/services/openflare/dns-account.service.ts @@ -2,7 +2,7 @@ import {OpenFlareBaseService} from './base.service'; import type {DnsAccountItem, DnsAccountMutationPayload} from './types'; export class DnsAccountService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/dns-accounts'; + protected static override readonly basePath: string = '/api/v1/d/dns-accounts'; static async list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/node.service.ts b/Wavelet/frontend/lib/services/openflare/node.service.ts index cf3e5a61..ae240e51 100644 --- a/Wavelet/frontend/lib/services/openflare/node.service.ts +++ b/Wavelet/frontend/lib/services/openflare/node.service.ts @@ -10,7 +10,7 @@ import type { } from './types'; export class NodeService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/nodes'; + protected static override readonly basePath: string = '/api/v1/d/nodes'; static async listNodes(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/option.service.ts b/Wavelet/frontend/lib/services/openflare/option.service.ts index d5d4f97f..5b0dab85 100644 --- a/Wavelet/frontend/lib/services/openflare/option.service.ts +++ b/Wavelet/frontend/lib/services/openflare/option.service.ts @@ -8,7 +8,7 @@ import type { } from './types'; export class OptionService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/option'; + protected static override readonly basePath: string = '/api/v1/d/option'; static list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/origin.service.ts b/Wavelet/frontend/lib/services/openflare/origin.service.ts index cc864873..98d7cb09 100644 --- a/Wavelet/frontend/lib/services/openflare/origin.service.ts +++ b/Wavelet/frontend/lib/services/openflare/origin.service.ts @@ -2,7 +2,7 @@ import {OpenFlareBaseService} from './base.service'; import type {OriginDetail, OriginItem, OriginMutationPayload} from './types'; export class OriginService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/origins'; + protected static override readonly basePath: string = '/api/v1/d/origins'; static list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/pages.service.ts b/Wavelet/frontend/lib/services/openflare/pages.service.ts index ff86db41..5ff6858a 100644 --- a/Wavelet/frontend/lib/services/openflare/pages.service.ts +++ b/Wavelet/frontend/lib/services/openflare/pages.service.ts @@ -13,7 +13,7 @@ import type { } from './types'; export class PagesService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/pages'; + protected static override readonly basePath: string = '/api/v1/d/pages'; static listProjects(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/proxy-route.service.ts b/Wavelet/frontend/lib/services/openflare/proxy-route.service.ts index 8ca84d1d..49843558 100644 --- a/Wavelet/frontend/lib/services/openflare/proxy-route.service.ts +++ b/Wavelet/frontend/lib/services/openflare/proxy-route.service.ts @@ -2,7 +2,7 @@ import {OpenFlareBaseService} from './base.service'; import type {ProxyRouteItem, ProxyRouteMutationPayload} from './types'; export class ProxyRouteService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/proxy-routes'; + protected static override readonly basePath: string = '/api/v1/d/proxy-routes'; static async list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/tls-certificate.service.ts b/Wavelet/frontend/lib/services/openflare/tls-certificate.service.ts index fcbbd56f..3886ae3e 100644 --- a/Wavelet/frontend/lib/services/openflare/tls-certificate.service.ts +++ b/Wavelet/frontend/lib/services/openflare/tls-certificate.service.ts @@ -10,7 +10,7 @@ import type { } from './types'; class AcmeAccountApi extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/acme-accounts'; + protected static override readonly basePath: string = '/api/v1/d/acme-accounts'; static getDefault(): Promise { return this.get('/default'); @@ -18,7 +18,7 @@ class AcmeAccountApi extends OpenFlareBaseService { } export class TlsCertificateService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/tls-certificates'; + protected static override readonly basePath: string = '/api/v1/d/tls-certificates'; static async list(): Promise { return this.get('/'); diff --git a/Wavelet/frontend/lib/services/openflare/update.service.ts b/Wavelet/frontend/lib/services/openflare/update.service.ts index 4e2c6941..be2e2c08 100644 --- a/Wavelet/frontend/lib/services/openflare/update.service.ts +++ b/Wavelet/frontend/lib/services/openflare/update.service.ts @@ -8,10 +8,10 @@ import {OpenFlareBaseService} from './base.service'; import type {LatestReleaseInfo, ReleaseChannel, UpgradeStreamSnapshot, UploadedServerBinaryInfo} from './types'; /** - * OpenFlare 服务端升级 API(`/api/v1/openflare/update/*`)。 + * OpenFlare 服务端升级 API(`/api/v1/d/update/*`)。 */ export class UpdateService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/update'; + protected static override readonly basePath: string = '/api/v1/d/update'; private static getApiUrl(path: string): string { const baseURL = getApiBaseUrl(); diff --git a/Wavelet/frontend/lib/services/openflare/uptimekuma.service.ts b/Wavelet/frontend/lib/services/openflare/uptimekuma.service.ts index 5ac34a7d..4b9b933c 100644 --- a/Wavelet/frontend/lib/services/openflare/uptimekuma.service.ts +++ b/Wavelet/frontend/lib/services/openflare/uptimekuma.service.ts @@ -1,7 +1,7 @@ import {OpenFlareBaseService} from './base.service'; export class UptimeKumaService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/uptimekuma'; + protected static override readonly basePath: string = '/api/v1/d/uptimekuma'; static sync(): Promise { return this.post('/sync'); diff --git a/Wavelet/frontend/lib/services/openflare/waf.service.ts b/Wavelet/frontend/lib/services/openflare/waf.service.ts index 5ffc73cb..9f4f1870 100644 --- a/Wavelet/frontend/lib/services/openflare/waf.service.ts +++ b/Wavelet/frontend/lib/services/openflare/waf.service.ts @@ -11,7 +11,7 @@ import type { } from './types'; export class WafService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/waf'; + protected static override readonly basePath: string = '/api/v1/d/waf'; static async listRuleGroups(): Promise { return this.get('/rule-groups'); diff --git a/Wavelet/frontend/lib/services/openflare/website.service.ts b/Wavelet/frontend/lib/services/openflare/website.service.ts index b312f8ad..1617b7d2 100644 --- a/Wavelet/frontend/lib/services/openflare/website.service.ts +++ b/Wavelet/frontend/lib/services/openflare/website.service.ts @@ -6,7 +6,7 @@ import type { } from './types'; export class WebsiteService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/openflare/managed-domains'; + protected static override readonly basePath: string = '/api/v1/d/managed-domains'; static async list(): Promise { return this.get('/'); diff --git a/Wavelet/internal/apps/openflare/apply_log/routers.go b/Wavelet/internal/apps/openflare/apply_log/routers.go index 8396f57f..255cd8f7 100644 --- a/Wavelet/internal/apps/openflare/apply_log/routers.go +++ b/Wavelet/internal/apps/openflare/apply_log/routers.go @@ -28,7 +28,7 @@ import ( // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/apply-logs [get] +// @Router /api/v1/d/apply-logs [get] func GetApplyLogs(c *gin.Context) { result, err := ListPage(c.Request.Context(), ListQuery{ NodeID: c.Query("node_id"), @@ -53,7 +53,7 @@ func GetApplyLogs(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/apply-logs/cleanup [post] +// @Router /api/v1/d/apply-logs/cleanup [post] func CleanupApplyLogs(c *gin.Context) { var input CleanupInput if !apiutil.BindJSON(c, &input) { diff --git a/Wavelet/internal/apps/openflare/config_version/routers.go b/Wavelet/internal/apps/openflare/config_version/routers.go index ead52819..fe37dba1 100644 --- a/Wavelet/internal/apps/openflare/config_version/routers.go +++ b/Wavelet/internal/apps/openflare/config_version/routers.go @@ -29,7 +29,7 @@ func handleLogicError(c *gin.Context, err error) bool { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/config-versions [get] +// @Router /api/v1/d/config-versions [get] func ListConfigVersionsHandler(c *gin.Context) { versions, err := ListConfigVersions(c.Request.Context()) if handleLogicError(c, err) { @@ -49,7 +49,7 @@ func ListConfigVersionsHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或版本不存在" -// @Router /api/v1/openflare/config-versions/{id} [get] +// @Router /api/v1/d/config-versions/{id} [get] func GetConfigVersionHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -71,7 +71,7 @@ func GetConfigVersionHandler(c *gin.Context) { // @Success 200 {object} response.Any{data=model.ConfigVersion} "活跃配置版本" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限、不存在或无活跃版本" -// @Router /api/v1/openflare/config-versions/active [get] +// @Router /api/v1/d/config-versions/active [get] func GetActiveConfigVersionHandler(c *gin.Context) { version, err := GetActiveConfigVersion(c.Request.Context()) if apiutil.AbortNotFoundIfMissing(c, err, errNoActiveVersion) { @@ -90,7 +90,7 @@ func GetActiveConfigVersionHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/config-versions/preview [get] +// @Router /api/v1/d/config-versions/preview [get] func PreviewConfigVersionHandler(c *gin.Context) { preview, err := PreviewConfigVersion(c.Request.Context()) if handleLogicError(c, err) { @@ -109,7 +109,7 @@ func PreviewConfigVersionHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/config-versions/diff [get] +// @Router /api/v1/d/config-versions/diff [get] func DiffConfigVersionHandler(c *gin.Context) { diff, err := DiffConfigVersion(c.Request.Context()) if handleLogicError(c, err) { @@ -129,7 +129,7 @@ func DiffConfigVersionHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/config-versions/publish [post] +// @Router /api/v1/d/config-versions/publish [post] func PublishConfigVersionHandler(c *gin.Context) { username := c.GetString("username") force := c.Query("force") == "true" @@ -151,7 +151,7 @@ func PublishConfigVersionHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或版本不存在" -// @Router /api/v1/openflare/config-versions/{id}/activate [post] +// @Router /api/v1/d/config-versions/{id}/activate [post] func ActivateConfigVersionHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -176,7 +176,7 @@ func ActivateConfigVersionHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/config-versions/cleanup [post] +// @Router /api/v1/d/config-versions/cleanup [post] func CleanupConfigVersionsHandler(c *gin.Context) { var input CleanupInput if !apiutil.BindJSON(c, &input) { diff --git a/Wavelet/internal/apps/openflare/dashboard/routers.go b/Wavelet/internal/apps/openflare/dashboard/routers.go index 9619290f..e226d308 100644 --- a/Wavelet/internal/apps/openflare/dashboard/routers.go +++ b/Wavelet/internal/apps/openflare/dashboard/routers.go @@ -22,7 +22,7 @@ import ( // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/dashboard/overview [get] +// @Router /api/v1/d/dashboard/overview [get] func GetOverviewHandler(c *gin.Context) { overview, err := GetOverview(c.Request.Context()) if apiutil.AbortBadRequestOnError(c, err) { diff --git a/Wavelet/internal/apps/openflare/integration/agent_protocol_test.go b/Wavelet/internal/apps/openflare/integration/agent_protocol_test.go index aa9a19ff..8c36041f 100644 --- a/Wavelet/internal/apps/openflare/integration/agent_protocol_test.go +++ b/Wavelet/internal/apps/openflare/integration/agent_protocol_test.go @@ -84,7 +84,7 @@ func TestAgentRelayFlaredProtocol(t *testing.T) { require.NotEmpty(t, edge.AccessToken) assert.Equal(t, "edge_node", edge.NodeType) - rec := performJSONRequest(t, engine, http.MethodPost, "/api/agent/nodes/heartbeat", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/agent/nodes/heartbeat", map[string]any{ "name": "edge-1", "ip": "203.0.113.10", "version": "0.1.0", @@ -119,7 +119,7 @@ func TestAgentRelayFlaredProtocol(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, relayNode.AccessToken) - rec := performJSONRequest(t, engine, http.MethodPost, "/api/relay/heartbeat", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/relay/heartbeat", map[string]any{ "version": "v0.1.0", "frp_version": "0.61.0", "relay_status": "healthy", @@ -155,7 +155,7 @@ func TestAgentRelayFlaredProtocol(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, clientNode.AccessToken) - rec := performJSONRequest(t, engine, http.MethodPost, "/api/flared/heartbeat", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/tunnel/heartbeat", map[string]any{ "client_version": "v0.2.0", "frp_version": "0.61.0", "tunnel_status": "running", @@ -178,7 +178,7 @@ func TestAgentRelayFlaredProtocol(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, bootstrap.DiscoveryToken) - rec := performJSONRequest(t, engine, http.MethodPost, "/api/agent/nodes/register", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/agent/nodes/register", map[string]any{ "name": "discovered-edge", "ip": "203.0.113.30", "version": "0.2.0", @@ -209,7 +209,7 @@ func TestAgentRelayFlaredProtocol(t *testing.T) { }) require.NoError(t, err) - rec := performJSONRequest(t, engine, http.MethodPost, "/api/agent/apply-logs", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/agent/apply-logs", map[string]any{ "version": "20260618-001", "result": "success", "message": "apply ok", diff --git a/Wavelet/internal/apps/openflare/integration/core_chain_test.go b/Wavelet/internal/apps/openflare/integration/core_chain_test.go index ca5c8627..dcb71989 100644 --- a/Wavelet/internal/apps/openflare/integration/core_chain_test.go +++ b/Wavelet/internal/apps/openflare/integration/core_chain_test.go @@ -209,7 +209,7 @@ func TestCoreChainMigrationFlow(t *testing.T) { }) t.Run("create apply log for node", func(t *testing.T) { - rec := performJSONRequest(t, engine, http.MethodPost, "/api/agent/apply-logs", map[string]any{ + rec := performJSONRequest(t, engine, http.MethodPost, "/api/v1/agent/apply-logs", map[string]any{ "version": configVersion, "result": "success", "message": "config applied", diff --git a/Wavelet/internal/apps/openflare/integration/helpers_test.go b/Wavelet/internal/apps/openflare/integration/helpers_test.go index cfa5f4ba..92909dce 100644 --- a/Wavelet/internal/apps/openflare/integration/helpers_test.go +++ b/Wavelet/internal/apps/openflare/integration/helpers_test.go @@ -83,8 +83,6 @@ func unmarshalEnvelopeSlice(t *testing.T, data any) []any { func mountOpenFlareTestRoutes(engine *gin.Engine) { api := engine.Group("/api") - ofrouter.RegisterRoutes(api) - apiV1 := api.Group("/v1") v1.RegisterV1Routes(apiV1, api) } diff --git a/Wavelet/internal/apps/openflare/node/routers.go b/Wavelet/internal/apps/openflare/node/routers.go index 0f4cdd39..d49aee9f 100644 --- a/Wavelet/internal/apps/openflare/node/routers.go +++ b/Wavelet/internal/apps/openflare/node/routers.go @@ -32,7 +32,7 @@ func handleLogicError(c *gin.Context, err error) bool { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/nodes [get] +// @Router /api/v1/d/nodes [get] func ListNodesHandler(c *gin.Context) { nodes, err := ListNodes(c.Request.Context()) if handleLogicError(c, err) { @@ -53,7 +53,7 @@ func ListNodesHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/nodes [post] +// @Router /api/v1/d/nodes [post] func CreateNodeHandler(c *gin.Context) { var input Input if !apiutil.BindJSON(c, &input) { @@ -79,7 +79,7 @@ func CreateNodeHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/update [post] +// @Router /api/v1/d/nodes/{id}/update [post] func UpdateNodeHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -107,7 +107,7 @@ func UpdateNodeHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/delete [post] +// @Router /api/v1/d/nodes/{id}/delete [post] func DeleteNodeHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -128,7 +128,7 @@ func DeleteNodeHandler(c *gin.Context) { // @Success 200 {object} response.Any{data=node.BootstrapView} "引导令牌" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/nodes/bootstrap-token [get] +// @Router /api/v1/d/nodes/bootstrap-token [get] func GetBootstrapTokenHandler(c *gin.Context) { view, err := GetBootstrapToken(c.Request.Context()) if handleLogicError(c, err) { @@ -146,7 +146,7 @@ func GetBootstrapTokenHandler(c *gin.Context) { // @Success 200 {object} response.Any{data=node.BootstrapView} "新引导令牌" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/nodes/bootstrap-token/rotate [post] +// @Router /api/v1/d/nodes/bootstrap-token/rotate [post] func RotateBootstrapTokenHandler(c *gin.Context) { view, err := RotateBootstrapToken(c.Request.Context()) if handleLogicError(c, err) { @@ -167,7 +167,7 @@ func RotateBootstrapTokenHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/agent-release [get] +// @Router /api/v1/d/nodes/{id}/agent-release [get] func GetAgentReleaseHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -193,7 +193,7 @@ func GetAgentReleaseHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/agent-update [post] +// @Router /api/v1/d/nodes/{id}/agent-update [post] func RequestAgentUpdateHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -224,7 +224,7 @@ func RequestAgentUpdateHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/openresty-restart [post] +// @Router /api/v1/d/nodes/{id}/openresty-restart [post] func RequestOpenrestyRestartHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -248,7 +248,7 @@ func RequestOpenrestyRestartHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/force-sync [post] +// @Router /api/v1/d/nodes/{id}/force-sync [post] func RequestForceSyncHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -274,7 +274,7 @@ func RequestForceSyncHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/observability [get] +// @Router /api/v1/d/nodes/{id}/observability [get] func GetObservabilityHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -303,7 +303,7 @@ func GetObservabilityHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或节点不存在" -// @Router /api/v1/openflare/nodes/{id}/observability/cleanup [post] +// @Router /api/v1/d/nodes/{id}/observability/cleanup [post] func CleanupHealthEventsHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { diff --git a/Wavelet/internal/apps/openflare/observability/routers.go b/Wavelet/internal/apps/openflare/observability/routers.go index 3aca53c1..500a209d 100644 --- a/Wavelet/internal/apps/openflare/observability/routers.go +++ b/Wavelet/internal/apps/openflare/observability/routers.go @@ -31,7 +31,7 @@ import ( // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs [get] +// @Router /api/v1/d/access-logs [get] func GetAccessLogsHandler(c *gin.Context) { logs, err := ListAccessLogs(c.Request.Context(), readAccessLogQuery(c)) if apiutil.AbortBadRequestOnError(c, err) { @@ -60,7 +60,7 @@ func GetAccessLogsHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs/folds [get] +// @Router /api/v1/d/access-logs/folds [get] func GetFoldedAccessLogsHandler(c *gin.Context) { query := readAccessLogQuery(c) query.FoldMinutes = readQueryInt(c, "fold_minutes") @@ -92,7 +92,7 @@ func GetFoldedAccessLogsHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs/folds/ip-summary [get] +// @Router /api/v1/d/access-logs/folds/ip-summary [get] func GetFoldedAccessLogIPsHandler(c *gin.Context) { result, err := ListFoldedAccessLogIPs(c.Request.Context(), FoldedAccessLogIPQuery{ NodeID: c.Query("node_id"), @@ -130,7 +130,7 @@ func GetFoldedAccessLogIPsHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs/ip-summary [get] +// @Router /api/v1/d/access-logs/ip-summary [get] func GetAccessLogIPSummariesHandler(c *gin.Context) { result, err := ListAccessLogIPSummaries(c.Request.Context(), AccessLogIPSummaryQuery{ NodeID: c.Query("node_id"), @@ -163,7 +163,7 @@ func GetAccessLogIPSummariesHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs/ip-summary/trend [get] +// @Router /api/v1/d/access-logs/ip-summary/trend [get] func GetAccessLogIPTrendHandler(c *gin.Context) { result, err := GetAccessLogIPTrend(c.Request.Context(), AccessLogIPTrendQuery{ NodeID: c.Query("node_id"), @@ -191,7 +191,7 @@ func GetAccessLogIPTrendHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/access-logs/cleanup [post] +// @Router /api/v1/d/access-logs/cleanup [post] func CleanupAccessLogsHandler(c *gin.Context) { var input AccessLogCleanupInput if !apiutil.BindJSON(c, &input) { diff --git a/Wavelet/internal/apps/openflare/option/routers.go b/Wavelet/internal/apps/openflare/option/routers.go index db748ed8..e846a2b5 100644 --- a/Wavelet/internal/apps/openflare/option/routers.go +++ b/Wavelet/internal/apps/openflare/option/routers.go @@ -23,9 +23,9 @@ import ( // @Success 200 {object} response.Any{data=option.statusView} "公开状态" // @Failure 400 {object} response.Any "参数错误" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/status [get] +// @Router /api/v1/d/status [get] func GetStatusHandler(c *gin.Context) { - view, err := getStatus(c.Request.Context(), "/api/v1/openflare") + view, err := getStatus(c.Request.Context(), "/api/v1/d") if apiutil.AbortBadRequestOnError(c, err) { return } @@ -40,7 +40,7 @@ func GetStatusHandler(c *gin.Context) { // @Success 200 {object} response.Any{data=string} "系统公告" // @Failure 400 {object} response.Any "参数错误" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/notice [get] +// @Router /api/v1/d/notice [get] // GetNoticeHandler returns the notice content. func GetNoticeHandler(c *gin.Context) { notice, err := getNotice(c.Request.Context()) @@ -58,7 +58,7 @@ func GetNoticeHandler(c *gin.Context) { // @Success 200 {object} response.Any{data=string} "关于信息" // @Failure 400 {object} response.Any "参数错误" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/about [get] +// @Router /api/v1/d/about [get] // GetAboutHandler returns the about content. func GetAboutHandler(c *gin.Context) { about, err := getAbout(c.Request.Context()) @@ -79,7 +79,7 @@ func GetAboutHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/option [get] +// @Router /api/v1/d/option [get] // ListOptionsHandler lists OpenFlare options. func ListOptionsHandler(c *gin.Context) { options, err := listOptions(c.Request.Context()) @@ -102,7 +102,7 @@ func ListOptionsHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/option/update [post] +// @Router /api/v1/d/option/update [post] // UpdateOptionHandler updates a single option. func UpdateOptionHandler(c *gin.Context) { var option model.OpenFlareOption @@ -128,7 +128,7 @@ func UpdateOptionHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/option/update-batch [post] +// @Router /api/v1/d/option/update-batch [post] // UpdateOptionsBatchHandler updates options in batch. func UpdateOptionsBatchHandler(c *gin.Context) { var payload optionBatchPayload @@ -154,7 +154,7 @@ func UpdateOptionsBatchHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/option/geoip/lookup [post] +// @Router /api/v1/d/option/geoip/lookup [post] // LookupGeoIPHandler performs a GeoIP lookup. func LookupGeoIPHandler(c *gin.Context) { var request geoIPLookupRequest @@ -181,7 +181,7 @@ func LookupGeoIPHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/option/database/cleanup [post] +// @Router /api/v1/d/option/database/cleanup [post] // CleanupDatabaseHandler cleans up observability data. func CleanupDatabaseHandler(c *gin.Context) { var input databaseCleanupInput @@ -208,7 +208,7 @@ func CleanupDatabaseHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/uptimekuma/sync [post] +// @Router /api/v1/d/uptimekuma/sync [post] // SyncUptimeKumaHandler triggers UptimeKuma sync. func SyncUptimeKumaHandler(c *gin.Context) { if apiutil.AbortBadRequestOnError(c, syncUptimeKuma(c.Request.Context())) { diff --git a/Wavelet/internal/apps/openflare/origin/routers.go b/Wavelet/internal/apps/openflare/origin/routers.go index 34bd3f2b..0fa12b5c 100644 --- a/Wavelet/internal/apps/openflare/origin/routers.go +++ b/Wavelet/internal/apps/openflare/origin/routers.go @@ -29,7 +29,7 @@ func handleLogicError(c *gin.Context, err error) bool { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/origins [get] +// @Router /api/v1/d/origins [get] func GetOrigins(c *gin.Context) { origins, err := ListOrigins(c.Request.Context()) if handleLogicError(c, err) { @@ -49,7 +49,7 @@ func GetOrigins(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或源站不存在" -// @Router /api/v1/openflare/origins/{id} [get] +// @Router /api/v1/d/origins/{id} [get] func GetOrigin(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -74,7 +74,7 @@ func GetOrigin(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/origins [post] +// @Router /api/v1/d/origins [post] func CreateOriginHandler(c *gin.Context) { var input Input if !apiutil.BindJSON(c, &input) { @@ -100,7 +100,7 @@ func CreateOriginHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或源站不存在" -// @Router /api/v1/openflare/origins/{id}/update [post] +// @Router /api/v1/d/origins/{id}/update [post] func UpdateOriginHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -128,7 +128,7 @@ func UpdateOriginHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或源站不存在" -// @Router /api/v1/openflare/origins/{id}/delete [post] +// @Router /api/v1/d/origins/{id}/delete [post] func DeleteOriginHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { diff --git a/Wavelet/internal/apps/openflare/pages/routers.go b/Wavelet/internal/apps/openflare/pages/routers.go index 8f0109b8..11a68f59 100644 --- a/Wavelet/internal/apps/openflare/pages/routers.go +++ b/Wavelet/internal/apps/openflare/pages/routers.go @@ -45,7 +45,7 @@ func deploymentIDParam(c *gin.Context) (uint, bool) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages [get] +// @Router /api/v1/d/pages [get] func ListProjectsHandler(c *gin.Context) { projects, err := ListProjects(c.Request.Context()) if handleLogicError(c, err) { @@ -67,7 +67,7 @@ func ListProjectsHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id} [get] +// @Router /api/v1/d/pages/{id} [get] func GetProjectHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -93,7 +93,7 @@ func GetProjectHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages [post] +// @Router /api/v1/d/pages [post] func CreateProjectHandler(c *gin.Context) { var input Input if !apiutil.BindJSON(c, &input) { @@ -121,7 +121,7 @@ func CreateProjectHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/update [post] +// @Router /api/v1/d/pages/{id}/update [post] func UpdateProjectHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -151,7 +151,7 @@ func UpdateProjectHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/delete [post] +// @Router /api/v1/d/pages/{id}/delete [post] func DeleteProjectHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -176,7 +176,7 @@ func DeleteProjectHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/deployments [get] +// @Router /api/v1/d/pages/{id}/deployments [get] func ListDeploymentsHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -204,7 +204,7 @@ func ListDeploymentsHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/deployments/upload [post] +// @Router /api/v1/d/pages/{id}/deployments/upload [post] func UploadDeploymentHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -236,7 +236,7 @@ func UploadDeploymentHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目或部署不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/deployments/{deployment_id}/activate [post] +// @Router /api/v1/d/pages/{id}/deployments/{deployment_id}/activate [post] func ActivateDeploymentHandler(c *gin.Context) { projectID, ok := apiutil.IDParam(c) if !ok { @@ -267,7 +267,7 @@ func ActivateDeploymentHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "项目或部署不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/{id}/deployments/{deployment_id}/delete [post] +// @Router /api/v1/d/pages/{id}/deployments/{deployment_id}/delete [post] func DeleteDeploymentHandler(c *gin.Context) { projectID, ok := apiutil.IDParam(c) if !ok { @@ -296,7 +296,7 @@ func DeleteDeploymentHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "部署不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/pages/deployments/{deployment_id}/files [get] +// @Router /api/v1/d/pages/deployments/{deployment_id}/files [get] func ListDeploymentFilesHandler(c *gin.Context) { deploymentID, ok := deploymentIDParam(c) if !ok { diff --git a/Wavelet/internal/apps/openflare/proxy_route/routers.go b/Wavelet/internal/apps/openflare/proxy_route/routers.go index ce2bee9a..e9214a73 100644 --- a/Wavelet/internal/apps/openflare/proxy_route/routers.go +++ b/Wavelet/internal/apps/openflare/proxy_route/routers.go @@ -29,7 +29,7 @@ func handleLogicError(c *gin.Context, err error) bool { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/proxy-routes [get] +// @Router /api/v1/d/proxy-routes [get] func GetProxyRoutes(c *gin.Context) { routes, err := ListProxyRoutes(c.Request.Context()) if handleLogicError(c, err) { @@ -49,7 +49,7 @@ func GetProxyRoutes(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或规则不存在" -// @Router /api/v1/openflare/proxy-routes/{id} [get] +// @Router /api/v1/d/proxy-routes/{id} [get] func GetProxyRouteHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -74,7 +74,7 @@ func GetProxyRouteHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或不存在" -// @Router /api/v1/openflare/proxy-routes [post] +// @Router /api/v1/d/proxy-routes [post] func CreateProxyRouteHandler(c *gin.Context) { var input Input if !apiutil.BindJSON(c, &input) { @@ -100,7 +100,7 @@ func CreateProxyRouteHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或规则不存在" -// @Router /api/v1/openflare/proxy-routes/{id}/update [post] +// @Router /api/v1/d/proxy-routes/{id}/update [post] func UpdateProxyRouteHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -128,7 +128,7 @@ func UpdateProxyRouteHandler(c *gin.Context) { // @Failure 400 {object} response.Any "参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 404 {object} response.Any "无权限或规则不存在" -// @Router /api/v1/openflare/proxy-routes/{id}/delete [post] +// @Router /api/v1/d/proxy-routes/{id}/delete [post] func DeleteProxyRouteHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { diff --git a/Wavelet/internal/apps/openflare/tls/routers.go b/Wavelet/internal/apps/openflare/tls/routers.go index 8285c16d..7b19e664 100644 --- a/Wavelet/internal/apps/openflare/tls/routers.go +++ b/Wavelet/internal/apps/openflare/tls/routers.go @@ -31,7 +31,7 @@ func handleLogicError(c *gin.Context, err error) bool { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates [get] +// @Router /api/v1/d/tls-certificates [get] func GetCertificates(c *gin.Context) { certificates, err := ListCertificates(c.Request.Context()) if handleLogicError(c, err) { @@ -53,7 +53,7 @@ func GetCertificates(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id} [get] +// @Router /api/v1/d/tls-certificates/{id} [get] func GetCertificateDetail(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -79,7 +79,7 @@ func GetCertificateDetail(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/content [get] +// @Router /api/v1/d/tls-certificates/{id}/content [get] func GetCertificateContentHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -105,7 +105,7 @@ func GetCertificateContentHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates [post] +// @Router /api/v1/d/tls-certificates [post] func CreateCertificateHandler(c *gin.Context) { var input CertificateInput if !apiutil.BindJSON(c, &input) { @@ -133,7 +133,7 @@ func CreateCertificateHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/update [post] +// @Router /api/v1/d/tls-certificates/{id}/update [post] func UpdateCertificateHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -166,7 +166,7 @@ func UpdateCertificateHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/import-file [post] +// @Router /api/v1/d/tls-certificates/import-file [post] func ImportCertificateFile(c *gin.Context) { name := c.PostForm("name") remark := c.PostForm("remark") @@ -200,7 +200,7 @@ func ImportCertificateFile(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/delete [post] +// @Router /api/v1/d/tls-certificates/{id}/delete [post] func DeleteCertificateHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -225,7 +225,7 @@ func DeleteCertificateHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/apply [post] +// @Router /api/v1/d/tls-certificates/apply [post] func ApplyCertificateHandler(c *gin.Context) { var input ApplyInput if !apiutil.BindJSON(c, &input) { @@ -253,7 +253,7 @@ func ApplyCertificateHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/update-acme [post] +// @Router /api/v1/d/tls-certificates/{id}/update-acme [post] func UpdateACMECertificateHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -285,7 +285,7 @@ func UpdateACMECertificateHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/convert-acme [post] +// @Router /api/v1/d/tls-certificates/{id}/convert-acme [post] func ConvertCertificateToACMEHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -315,7 +315,7 @@ func ConvertCertificateToACMEHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/tls-certificates/{id}/renew [post] +// @Router /api/v1/d/tls-certificates/{id}/renew [post] func RenewCertificateHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -339,7 +339,7 @@ func RenewCertificateHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/managed-domains [get] +// @Router /api/v1/d/managed-domains [get] func GetManagedDomains(c *gin.Context) { domains, err := ListManagedDomains(c.Request.Context()) if handleLogicError(c, err) { @@ -361,7 +361,7 @@ func GetManagedDomains(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/managed-domains [post] +// @Router /api/v1/d/managed-domains [post] func CreateManagedDomainHandler(c *gin.Context) { var input ManagedDomainInput if !apiutil.BindJSON(c, &input) { @@ -389,7 +389,7 @@ func CreateManagedDomainHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/managed-domains/{id}/update [post] +// @Router /api/v1/d/managed-domains/{id}/update [post] func UpdateManagedDomainHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -419,7 +419,7 @@ func UpdateManagedDomainHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/managed-domains/{id}/delete [post] +// @Router /api/v1/d/managed-domains/{id}/delete [post] func DeleteManagedDomainHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -443,7 +443,7 @@ func DeleteManagedDomainHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/managed-domains/match [get] +// @Router /api/v1/d/managed-domains/match [get] func MatchManagedDomainCertificateHandler(c *gin.Context) { domain := strings.TrimSpace(c.Query("domain")) result, err := MatchManagedDomainCertificate(c.Request.Context(), domain) @@ -464,7 +464,7 @@ func MatchManagedDomainCertificateHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/dns-accounts [get] +// @Router /api/v1/d/dns-accounts [get] func GetDNSAccounts(c *gin.Context) { accounts, err := ListDNSAccounts(c.Request.Context()) if handleLogicError(c, err) { @@ -486,7 +486,7 @@ func GetDNSAccounts(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/dns-accounts [post] +// @Router /api/v1/d/dns-accounts [post] func CreateDNSAccountHandler(c *gin.Context) { var input DNSAccountInput if !apiutil.BindJSON(c, &input) { @@ -514,7 +514,7 @@ func CreateDNSAccountHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/dns-accounts/{id}/update [post] +// @Router /api/v1/d/dns-accounts/{id}/update [post] func UpdateDNSAccountHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -544,7 +544,7 @@ func UpdateDNSAccountHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/dns-accounts/{id}/delete [post] +// @Router /api/v1/d/dns-accounts/{id}/delete [post] func DeleteDNSAccountHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -568,7 +568,7 @@ func DeleteDNSAccountHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/acme-accounts/default [get] +// @Router /api/v1/d/acme-accounts/default [get] func GetDefaultAcmeAccountHandler(c *gin.Context) { account, err := GetDefaultAcmeAccount(c.Request.Context()) if handleLogicError(c, err) { diff --git a/Wavelet/internal/apps/openflare/update/routers.go b/Wavelet/internal/apps/openflare/update/routers.go index 84e4dab6..b78a8808 100644 --- a/Wavelet/internal/apps/openflare/update/routers.go +++ b/Wavelet/internal/apps/openflare/update/routers.go @@ -33,7 +33,7 @@ var upgradeLogsUpgrader = websocket.Upgrader{ // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/update/latest-release [get] +// @Router /api/v1/d/update/latest-release [get] func GetLatestReleaseHandler(c *gin.Context) { release, err := GetLatestRelease(c.Request.Context(), c.Query("channel")) if apiutil.AbortBadRequestOnError(c, err) { @@ -55,7 +55,7 @@ func GetLatestReleaseHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/update/upgrade [post] +// @Router /api/v1/d/update/upgrade [post] func UpgradeServerHandler(c *gin.Context) { var request upgradeRequest if err := bindOptionalJSON(c.Request.Body, &request); err != nil { @@ -82,7 +82,7 @@ func UpgradeServerHandler(c *gin.Context) { // @Failure 400 {object} response.Any "功能已禁用或参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" -// @Router /api/v1/openflare/update/manual-upload [post] +// @Router /api/v1/d/update/manual-upload [post] func UploadManualServerBinaryHandler(c *gin.Context) { if apiutil.AbortBadRequestOnError(c, UploadManualBinary()) { return @@ -99,7 +99,7 @@ func UploadManualServerBinaryHandler(c *gin.Context) { // @Failure 400 {object} response.Any "功能已禁用或参数错误" // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" -// @Router /api/v1/openflare/update/manual-upgrade [post] +// @Router /api/v1/d/update/manual-upgrade [post] func ConfirmManualServerUpgradeHandler(c *gin.Context) { if apiutil.AbortBadRequestOnError(c, ConfirmManualUpgrade()) { return @@ -114,7 +114,7 @@ func ConfirmManualServerUpgradeHandler(c *gin.Context) { // @Success 101 {object} update.StreamSnapshot "WebSocket 升级日志流" // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" -// @Router /api/v1/openflare/update/logs/ws [get] +// @Router /api/v1/d/update/logs/ws [get] func StreamServerUpgradeLogsHandler(c *gin.Context) { conn, err := upgradeLogsUpgrader.Upgrade(c.Writer, c.Request, nil) if err != nil { diff --git a/Wavelet/internal/apps/openflare/waf/routers.go b/Wavelet/internal/apps/openflare/waf/routers.go index e183f075..738c117a 100644 --- a/Wavelet/internal/apps/openflare/waf/routers.go +++ b/Wavelet/internal/apps/openflare/waf/routers.go @@ -45,7 +45,7 @@ func routeIDParam(c *gin.Context) (uint, bool) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups [get] +// @Router /api/v1/d/waf/rule-groups [get] func ListRuleGroupsHandler(c *gin.Context) { groups, err := ListRuleGroups(c.Request.Context()) if handleLogicError(c, err) { @@ -67,7 +67,7 @@ func ListRuleGroupsHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups/{id} [get] +// @Router /api/v1/d/waf/rule-groups/{id} [get] func GetRuleGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -93,7 +93,7 @@ func GetRuleGroupHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups [post] +// @Router /api/v1/d/waf/rule-groups [post] func CreateRuleGroupHandler(c *gin.Context) { var input RuleGroupInput if !apiutil.BindJSON(c, &input) { @@ -121,7 +121,7 @@ func CreateRuleGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups/{id}/update [post] +// @Router /api/v1/d/waf/rule-groups/{id}/update [post] func UpdateRuleGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -151,7 +151,7 @@ func UpdateRuleGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups/{id}/delete [post] +// @Router /api/v1/d/waf/rule-groups/{id}/delete [post] func DeleteRuleGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -178,7 +178,7 @@ func DeleteRuleGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/rule-groups/{id}/sites [post] +// @Router /api/v1/d/waf/rule-groups/{id}/sites [post] func ReplaceRuleGroupSitesHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -208,7 +208,7 @@ func ReplaceRuleGroupSitesHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/sites/{route_id}/rule-groups [get] +// @Router /api/v1/d/waf/sites/{route_id}/rule-groups [get] func GetSiteRuleGroupsHandler(c *gin.Context) { routeID, ok := routeIDParam(c) if !ok { @@ -236,7 +236,7 @@ func GetSiteRuleGroupsHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/sites/{route_id}/rule-groups [post] +// @Router /api/v1/d/waf/sites/{route_id}/rule-groups [post] func ReplaceSiteRuleGroupsHandler(c *gin.Context) { routeID, ok := routeIDParam(c) if !ok { @@ -264,7 +264,7 @@ func ReplaceSiteRuleGroupsHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups [get] +// @Router /api/v1/d/waf/ip-groups [get] func ListIPGroupsHandler(c *gin.Context) { groups, err := ListIPGroups(c.Request.Context()) if handleLogicError(c, err) { @@ -286,7 +286,7 @@ func ListIPGroupsHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups/{id} [get] +// @Router /api/v1/d/waf/ip-groups/{id} [get] func GetIPGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -312,7 +312,7 @@ func GetIPGroupHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups [post] +// @Router /api/v1/d/waf/ip-groups [post] func CreateIPGroupHandler(c *gin.Context) { var input IPGroupInput if !apiutil.BindJSON(c, &input) { @@ -340,7 +340,7 @@ func CreateIPGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups/{id}/update [post] +// @Router /api/v1/d/waf/ip-groups/{id}/update [post] func UpdateIPGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -370,7 +370,7 @@ func UpdateIPGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups/{id}/delete [post] +// @Router /api/v1/d/waf/ip-groups/{id}/delete [post] func DeleteIPGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -395,7 +395,7 @@ func DeleteIPGroupHandler(c *gin.Context) { // @Failure 403 {object} response.Any "无管理员权限" // @Failure 404 {object} response.Any "记录不存在" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups/{id}/sync [post] +// @Router /api/v1/d/waf/ip-groups/{id}/sync [post] func SyncIPGroupHandler(c *gin.Context) { id, ok := apiutil.IDParam(c) if !ok { @@ -421,7 +421,7 @@ func SyncIPGroupHandler(c *gin.Context) { // @Failure 401 {object} response.Any "未登录" // @Failure 403 {object} response.Any "无管理员权限" // @Failure 500 {object} response.Any "内部错误" -// @Router /api/v1/openflare/waf/ip-groups/test [post] +// @Router /api/v1/d/waf/ip-groups/test [post] func TestIPGroupAutoConfigHandler(c *gin.Context) { var input IPGroupAutoTestInput if !apiutil.BindJSON(c, &input) { diff --git a/Wavelet/internal/router/router.go b/Wavelet/internal/router/router.go index 8f891d7a..bd133b88 100644 --- a/Wavelet/internal/router/router.go +++ b/Wavelet/internal/router/router.go @@ -18,7 +18,6 @@ import ( "github.com/Rain-kl/Wavelet/internal/apps/risk_control" router_root "github.com/Rain-kl/Wavelet/internal/router/root" v1 "github.com/Rain-kl/Wavelet/internal/router/v1" - ofrouter "github.com/Rain-kl/Wavelet/internal/router/v1/openflare" "github.com/Rain-kl/Wavelet/internal/apps/oauth" "github.com/Rain-kl/Wavelet/internal/config" @@ -116,10 +115,6 @@ func registerRoutes(r *gin.Engine) { apiGroup := r.Group(config.Config.App.APIPrefix) { - // OpenFlare Agent/Relay/Flared protocol routes under /api/* - ofrouter.RegisterRoutes(apiGroup) - - // API V1 apiV1Router := apiGroup.Group("/v1") { v1.RegisterV1Routes(apiV1Router, apiGroup) diff --git a/Wavelet/internal/router/v1/openflare/openflare.go b/Wavelet/internal/router/v1/openflare/openflare.go index 0f531465..bba95eb7 100644 --- a/Wavelet/internal/router/v1/openflare/openflare.go +++ b/Wavelet/internal/router/v1/openflare/openflare.go @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // Package openflare registers OpenFlare HTTP routes. -// Management console APIs are mounted via RegisterV1Routes under /api/v1/openflare. -// Agent/Relay/Flared protocol routes are mounted via RegisterRoutes under /api. +// Management console APIs are mounted via RegisterV1Routes under /api/v1/d. +// Agent/Relay/Tunnel protocol routes are mounted via RegisterRoutes under /api/v1. package openflare import "github.com/gin-gonic/gin" -// RegisterRoutes mounts Agent/Relay/Flared protocol routes under the /api group. -func RegisterRoutes(apiGroup *gin.RouterGroup) { - registerAgentRoutes(apiGroup) - registerRelayRoutes(apiGroup) - registerFlaredRoutes(apiGroup) +// RegisterRoutes mounts Agent/Relay/Tunnel protocol routes under the /api/v1 group. +func RegisterRoutes(apiV1Router *gin.RouterGroup) { + registerAgentRoutes(apiV1Router) + registerRelayRoutes(apiV1Router) + registerTunnelRoutes(apiV1Router) } diff --git a/Wavelet/internal/router/v1/openflare/register_agent.go b/Wavelet/internal/router/v1/openflare/register_agent.go index 973ff12c..3d4e911b 100644 --- a/Wavelet/internal/router/v1/openflare/register_agent.go +++ b/Wavelet/internal/router/v1/openflare/register_agent.go @@ -8,8 +8,8 @@ import ( "github.com/gin-gonic/gin" ) -func registerAgentRoutes(apiGroup *gin.RouterGroup) { - agentRoute := apiGroup.Group("/agent") +func registerAgentRoutes(apiV1Router *gin.RouterGroup) { + agentRoute := apiV1Router.Group("/agent") { discoveryRoute := agentRoute.Group("/") discoveryRoute.Use(agent.AgentRegisterAuth()) diff --git a/Wavelet/internal/router/v1/openflare/register_relay_flared.go b/Wavelet/internal/router/v1/openflare/register_relay_flared.go index 55e98f9e..377961ec 100644 --- a/Wavelet/internal/router/v1/openflare/register_relay_flared.go +++ b/Wavelet/internal/router/v1/openflare/register_relay_flared.go @@ -9,8 +9,8 @@ import ( "github.com/gin-gonic/gin" ) -func registerRelayRoutes(apiGroup *gin.RouterGroup) { - relayRoute := apiGroup.Group("/relay") +func registerRelayRoutes(apiV1Router *gin.RouterGroup) { + relayRoute := apiV1Router.Group("/relay") relayRoute.Use(relay.RelayAuth()) { relayRoute.POST("/heartbeat", relay.PostHeartbeat) @@ -18,13 +18,13 @@ func registerRelayRoutes(apiGroup *gin.RouterGroup) { } } -func registerFlaredRoutes(apiGroup *gin.RouterGroup) { - flaredRoute := apiGroup.Group("/flared") - flaredRoute.Use(flared.TunnelAuth()) +func registerTunnelRoutes(apiV1Router *gin.RouterGroup) { + tunnelRoute := apiV1Router.Group("/tunnel") + tunnelRoute.Use(flared.TunnelAuth()) { - flaredRoute.POST("/heartbeat", flared.PostHeartbeat) - flaredRoute.GET("/config/active", flared.GetActiveConfig) - flaredRoute.POST("/apply-log", flared.PostApplyLog) - flaredRoute.GET("/ws", flared.GetWebSocket) + tunnelRoute.POST("/heartbeat", flared.PostHeartbeat) + tunnelRoute.GET("/config/active", flared.GetActiveConfig) + tunnelRoute.POST("/apply-log", flared.PostApplyLog) + tunnelRoute.GET("/ws", flared.GetWebSocket) } } diff --git a/Wavelet/internal/router/v1/openflare/v1.go b/Wavelet/internal/router/v1/openflare/v1.go index 8654d3e5..e73853a5 100644 --- a/Wavelet/internal/router/v1/openflare/v1.go +++ b/Wavelet/internal/router/v1/openflare/v1.go @@ -6,11 +6,11 @@ package openflare import "github.com/gin-gonic/gin" // V1BasePath is the OpenFlare console API prefix under /api/v1. -const V1BasePath = "/api/v1/openflare" +const V1BasePath = "/api/v1/d" -// RegisterV1Routes mounts OpenFlare management console APIs under /api/v1/openflare. +// RegisterV1Routes mounts OpenFlare management console APIs under /api/v1/d. func RegisterV1Routes(apiV1Router *gin.RouterGroup) { - group := apiV1Router.Group("/openflare") + group := apiV1Router.Group("/d") registerOptionRoutes(group) registerOriginRoutes(group) registerApplyLogRoutes(group) diff --git a/Wavelet/internal/router/v1/v1.go b/Wavelet/internal/router/v1/v1.go index dac12ccc..8efd4183 100644 --- a/Wavelet/internal/router/v1/v1.go +++ b/Wavelet/internal/router/v1/v1.go @@ -17,8 +17,9 @@ func RegisterV1Routes(apiV1Router *gin.RouterGroup, apiGroup *gin.RouterGroup) { // 2. Admin routes RegisterAdminRoutes(apiV1Router) - // 3. OpenFlare management console APIs + // 3. OpenFlare management console APIs and Agent/Relay/Tunnel protocol routes ofrouter.RegisterV1Routes(apiV1Router) + ofrouter.RegisterRoutes(apiV1Router) // 4. Custom business routes (example only) RegisterCustomRoutes(apiV1Router) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 744b69db..e30043a9 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -16,6 +16,10 @@ sidebar: false ## [Unreleased] +### 变更 + +- Wavelet API 路径统一:管理端由 `/api/v1/openflare/*` 调整为 `/api/v1/d/*`;Agent/Relay/Tunnel 协议路由分别迁移至 `/api/v1/agent/*`、`/api/v1/relay/*`、`/api/v1/tunnel/*`(原 `/api/flared/*`)。同步更新 Wavelet 前端服务层与 `openflare-agent`、`openflare-relay`、`openflared` 客户端连接端点。 + ### 新增 - Wavelet 总览仪表盘图表对齐旧前端 ECharts 样式:24 小时请求/容量趋势补充请求量与错误量展示,新增网络与磁盘趋势、Top 节点榜单、来源分布、状态码分布与 Top Domain 板块。 diff --git a/openflare-agent/internal/agent/runner_test.go b/openflare-agent/internal/agent/runner_test.go index 4edc3be4..09d18430 100644 --- a/openflare-agent/internal/agent/runner_test.go +++ b/openflare-agent/internal/agent/runner_test.go @@ -156,7 +156,7 @@ type fakeWebSocketConnection struct { } func (f *fakeWebSocketConnection) URL() string { - return "ws://127.0.0.1/api/agent/ws" + return "ws://127.0.0.1/api/v1/agent/ws" } func (f *fakeWebSocketConnection) SendStatus(payload protocol.NodePayload) error { diff --git a/openflare-agent/internal/httpclient/client.go b/openflare-agent/internal/httpclient/client.go index 1f0327f8..8a7e6203 100644 --- a/openflare-agent/internal/httpclient/client.go +++ b/openflare-agent/internal/httpclient/client.go @@ -34,7 +34,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { func (c *Client) RegisterNode(ctx context.Context, payload protocol.NodePayload) (*protocol.RegisterNodeResponse, error) { slog.Debug("http register node request", "node_id", payload.NodeID, "current_version", payload.CurrentVersion) resp := protocol.APIResponse[protocol.RegisterNodeResponse]{} - if err := c.postJSON(ctx, "/api/agent/nodes/register", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/agent/nodes/register", payload, &resp); err != nil { return nil, err } if !resp.Success { @@ -46,7 +46,7 @@ func (c *Client) RegisterNode(ctx context.Context, payload protocol.NodePayload) func (c *Client) Heartbeat(ctx context.Context, payload protocol.NodePayload) (*protocol.HeartbeatResult, error) { resp := protocol.HeartbeatAPIResponse{} - if err := c.postJSON(ctx, "/api/agent/nodes/heartbeat", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/agent/nodes/heartbeat", payload, &resp); err != nil { return nil, err } if !resp.Success { @@ -61,7 +61,7 @@ func (c *Client) Heartbeat(ctx context.Context, payload protocol.NodePayload) (* func (c *Client) GetActiveConfig(ctx context.Context) (*protocol.ActiveConfigResponse, error) { resp := protocol.APIResponse[protocol.ActiveConfigResponse]{} - if err := c.getJSON(ctx, "/api/agent/config-versions/active", &resp); err != nil { + if err := c.getJSON(ctx, "/api/v1/agent/config-versions/active", &resp); err != nil { return nil, err } if !resp.Success { @@ -73,12 +73,12 @@ func (c *Client) GetActiveConfig(ctx context.Context) (*protocol.ActiveConfigRes func (c *Client) ReportApplyLog(ctx context.Context, payload protocol.ApplyLogPayload) error { slog.Debug("http report apply log request", "node_id", payload.NodeID, "version", payload.Version, "result", payload.Result) - return c.postJSON(ctx, "/api/agent/apply-logs", payload, nil) + return c.postJSON(ctx, "/api/v1/agent/apply-logs", payload, nil) } func (c *Client) SyncWAFIPGroups(ctx context.Context, payload protocol.WAFIPGroupSyncRequest) (*protocol.WAFIPGroupSyncResponse, error) { resp := protocol.APIResponse[protocol.WAFIPGroupSyncResponse]{} - if err := c.postJSON(ctx, "/api/agent/waf/ip-groups/sync", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/agent/waf/ip-groups/sync", payload, &resp); err != nil { return nil, err } if !resp.Success { @@ -88,7 +88,7 @@ func (c *Client) SyncWAFIPGroups(ctx context.Context, payload protocol.WAFIPGrou } func (c *Client) DownloadPagesDeploymentPackage(ctx context.Context, deploymentID uint) ([]byte, error) { - req, err := http.NewRequestWithContext(ctx, http.MethodGet, c.baseURL+fmt.Sprintf("/api/agent/pages/deployments/%d/package", deploymentID), nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, c.baseURL+fmt.Sprintf("/api/v1/agent/pages/deployments/%d/package", deploymentID), nil) if err != nil { return nil, err } diff --git a/openflare-agent/internal/wsclient/client.go b/openflare-agent/internal/wsclient/client.go index d461a8a9..a6584b6a 100644 --- a/openflare-agent/internal/wsclient/client.go +++ b/openflare-agent/internal/wsclient/client.go @@ -26,7 +26,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { Token: token, Timeout: timeout, HeaderKey: "X-Agent-Token", - WSPath: "/api/agent/ws", + WSPath: "/api/v1/agent/ws", }), } } diff --git a/openflare-relay/internal/httpclient/client.go b/openflare-relay/internal/httpclient/client.go index e92bfd76..f610b2f8 100644 --- a/openflare-relay/internal/httpclient/client.go +++ b/openflare-relay/internal/httpclient/client.go @@ -38,7 +38,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { func (c *Client) Heartbeat(ctx context.Context, payload service.RelayHeartbeatPayload) (*service.RelayHeartbeatResponse, error) { resp := APIResponse[service.RelayHeartbeatResponse]{} - if err := c.postJSON(ctx, "/api/relay/heartbeat", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/relay/heartbeat", payload, &resp); err != nil { return nil, err } if !resp.Success { diff --git a/openflare-relay/internal/wsclient/client.go b/openflare-relay/internal/wsclient/client.go index e4022a9b..81c089a5 100644 --- a/openflare-relay/internal/wsclient/client.go +++ b/openflare-relay/internal/wsclient/client.go @@ -27,7 +27,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { Token: token, Timeout: timeout, HeaderKey: "X-Agent-Token", - WSPath: "/api/relay/ws", + WSPath: "/api/v1/relay/ws", }), } } diff --git a/openflared/internal/httpclient/client.go b/openflared/internal/httpclient/client.go index ae604d01..190032d9 100644 --- a/openflared/internal/httpclient/client.go +++ b/openflared/internal/httpclient/client.go @@ -38,7 +38,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { func (c *Client) Heartbeat(ctx context.Context, payload service.FlaredHeartbeatPayload) (*service.FlaredHeartbeatResponse, error) { resp := APIResponse[service.FlaredHeartbeatResponse]{} - if err := c.postJSON(ctx, "/api/flared/heartbeat", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/tunnel/heartbeat", payload, &resp); err != nil { return nil, err } if !resp.Success { @@ -49,7 +49,7 @@ func (c *Client) Heartbeat(ctx context.Context, payload service.FlaredHeartbeatP func (c *Client) GetActiveConfig(ctx context.Context) (*service.FlaredTunnelConfigResponse, error) { resp := APIResponse[service.FlaredTunnelConfigResponse]{} - if err := c.getJSON(ctx, "/api/flared/config/active", &resp); err != nil { + if err := c.getJSON(ctx, "/api/v1/tunnel/config/active", &resp); err != nil { return nil, err } if !resp.Success { @@ -60,7 +60,7 @@ func (c *Client) GetActiveConfig(ctx context.Context) (*service.FlaredTunnelConf func (c *Client) ReportApplyLog(ctx context.Context, payload service.ApplyLogPayload) error { resp := APIResponse[any]{} - if err := c.postJSON(ctx, "/api/flared/apply-log", payload, &resp); err != nil { + if err := c.postJSON(ctx, "/api/v1/tunnel/apply-log", payload, &resp); err != nil { return err } if !resp.Success { diff --git a/openflared/internal/wsclient/client.go b/openflared/internal/wsclient/client.go index 64ce5bf7..fce44832 100644 --- a/openflared/internal/wsclient/client.go +++ b/openflared/internal/wsclient/client.go @@ -27,7 +27,7 @@ func New(baseURL string, token string, timeout time.Duration) *Client { Token: token, Timeout: timeout, HeaderKey: "X-Tunnel-Token", - WSPath: "/api/flared/ws", + WSPath: "/api/v1/tunnel/ws", }), } }