diff --git a/Wavelet/docs/docs.go b/Wavelet/docs/docs.go index 475418be..67fb5d2d 100644 --- a/Wavelet/docs/docs.go +++ b/Wavelet/docs/docs.go @@ -4109,7028 +4109,6 @@ const docTemplate = `{ } } }, - "/api/v1/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -11538,6 +4516,7028 @@ 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": [ diff --git a/Wavelet/docs/swagger.json b/Wavelet/docs/swagger.json index 7d7620d9..6798434c 100644 --- a/Wavelet/docs/swagger.json +++ b/Wavelet/docs/swagger.json @@ -4102,7028 +4102,6 @@ } } }, - "/api/v1/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/oauth/callback": { "post": { "description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。", @@ -11531,6 +4509,7028 @@ } } }, + "/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": [ diff --git a/Wavelet/docs/swagger.yaml b/Wavelet/docs/swagger.yaml index c39f6185..18e854d6 100644 --- a/Wavelet/docs/swagger.yaml +++ b/Wavelet/docs/swagger.yaml @@ -5798,4260 +5798,6 @@ paths: summary: Sample Hello API tags: - custom - /api/v1/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/custom/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/oauth/{source}/authorize: get: description: 根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。 @@ -10291,6 +6037,4260 @@ 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: diff --git a/Wavelet/frontend/lib/services/openflare/access-log.service.ts b/Wavelet/frontend/lib/services/openflare/access-log.service.ts index c444f52a..fc2964d8 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/custom/openflare/access-logs'; + protected static override readonly basePath: string = '/api/v1/openflare/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 8502a045..38032cd0 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/custom/openflare/apply-logs'; + protected static override readonly basePath: string = '/api/v1/openflare/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 50ac648c..1a03379f 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/custom/openflare'; + protected static override readonly basePath: string = '/api/v1/openflare'; } \ 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 a870dec0..2847c7b0 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/custom/openflare/config-versions'; + protected static override readonly basePath: string = '/api/v1/openflare/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 92399354..7f67fa06 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/custom/openflare/dashboard'; + protected static override readonly basePath: string = '/api/v1/openflare/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 b1c607aa..96519ade 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/custom/openflare/dns-accounts'; + protected static override readonly basePath: string = '/api/v1/openflare/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 77707f18..cf3e5a61 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/custom/openflare/nodes'; + protected static override readonly basePath: string = '/api/v1/openflare/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 c10fa006..d5d4f97f 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/custom/openflare/option'; + protected static override readonly basePath: string = '/api/v1/openflare/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 f460b89a..cc864873 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/custom/openflare/origins'; + protected static override readonly basePath: string = '/api/v1/openflare/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 99ea1da7..ff86db41 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/custom/openflare/pages'; + protected static override readonly basePath: string = '/api/v1/openflare/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 9898992d..8ca84d1d 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/custom/openflare/proxy-routes'; + protected static override readonly basePath: string = '/api/v1/openflare/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 60646a5e..fcbbd56f 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/custom/openflare/acme-accounts'; + protected static override readonly basePath: string = '/api/v1/openflare/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/custom/openflare/tls-certificates'; + protected static override readonly basePath: string = '/api/v1/openflare/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 c2c570b9..4e2c6941 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/custom/openflare/update/*`)。 + * OpenFlare 服务端升级 API(`/api/v1/openflare/update/*`)。 */ export class UpdateService extends OpenFlareBaseService { - protected static override readonly basePath: string = '/api/v1/custom/openflare/update'; + protected static override readonly basePath: string = '/api/v1/openflare/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 6e9f6ee8..5ac34a7d 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/custom/openflare/uptimekuma'; + protected static override readonly basePath: string = '/api/v1/openflare/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 d338790f..5ffc73cb 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/custom/openflare/waf'; + protected static override readonly basePath: string = '/api/v1/openflare/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 33896b56..b312f8ad 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/custom/openflare/managed-domains'; + protected static override readonly basePath: string = '/api/v1/openflare/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 c0c88810..8396f57f 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/custom/openflare/apply-logs [get] +// @Router /api/v1/openflare/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/custom/openflare/apply-logs/cleanup [post] +// @Router /api/v1/openflare/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 e5ea4e62..ead52819 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/custom/openflare/config-versions [get] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/active [get] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/preview [get] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/diff [get] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/publish [post] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/{id}/activate [post] +// @Router /api/v1/openflare/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/custom/openflare/config-versions/cleanup [post] +// @Router /api/v1/openflare/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 9263b2b8..9619290f 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/custom/openflare/dashboard/overview [get] +// @Router /api/v1/openflare/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/node/routers.go b/Wavelet/internal/apps/openflare/node/routers.go index 66ff3808..0f4cdd39 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/custom/openflare/nodes [get] +// @Router /api/v1/openflare/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/custom/openflare/nodes [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/bootstrap-token [get] +// @Router /api/v1/openflare/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/custom/openflare/nodes/bootstrap-token/rotate [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/agent-release [get] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/agent-update [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/openresty-restart [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/force-sync [post] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/observability [get] +// @Router /api/v1/openflare/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/custom/openflare/nodes/{id}/observability/cleanup [post] +// @Router /api/v1/openflare/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 c3e4be46..3aca53c1 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/custom/openflare/access-logs [get] +// @Router /api/v1/openflare/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/custom/openflare/access-logs/folds [get] +// @Router /api/v1/openflare/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/custom/openflare/access-logs/folds/ip-summary [get] +// @Router /api/v1/openflare/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/custom/openflare/access-logs/ip-summary [get] +// @Router /api/v1/openflare/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/custom/openflare/access-logs/ip-summary/trend [get] +// @Router /api/v1/openflare/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/custom/openflare/access-logs/cleanup [post] +// @Router /api/v1/openflare/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 a7827b69..db748ed8 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/custom/openflare/status [get] +// @Router /api/v1/openflare/status [get] func GetStatusHandler(c *gin.Context) { - view, err := getStatus(c.Request.Context(), "/api/v1/custom/openflare") + view, err := getStatus(c.Request.Context(), "/api/v1/openflare") 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/custom/openflare/notice [get] +// @Router /api/v1/openflare/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/custom/openflare/about [get] +// @Router /api/v1/openflare/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/custom/openflare/option [get] +// @Router /api/v1/openflare/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/custom/openflare/option/update [post] +// @Router /api/v1/openflare/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/custom/openflare/option/update-batch [post] +// @Router /api/v1/openflare/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/custom/openflare/option/geoip/lookup [post] +// @Router /api/v1/openflare/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/custom/openflare/option/database/cleanup [post] +// @Router /api/v1/openflare/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/custom/openflare/uptimekuma/sync [post] +// @Router /api/v1/openflare/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 d375117b..34bd3f2b 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/custom/openflare/origins [get] +// @Router /api/v1/openflare/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/custom/openflare/origins/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/origins [post] +// @Router /api/v1/openflare/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/custom/openflare/origins/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/origins/{id}/delete [post] +// @Router /api/v1/openflare/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 ad084a59..8f0109b8 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/custom/openflare/pages [get] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/pages [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/deployments [get] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/deployments/upload [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/deployments/{deployment_id}/activate [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/{id}/deployments/{deployment_id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/pages/deployments/{deployment_id}/files [get] +// @Router /api/v1/openflare/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 728b687b..ce2bee9a 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/custom/openflare/proxy-routes [get] +// @Router /api/v1/openflare/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/custom/openflare/proxy-routes/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/proxy-routes [post] +// @Router /api/v1/openflare/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/custom/openflare/proxy-routes/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/proxy-routes/{id}/delete [post] +// @Router /api/v1/openflare/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 42b23fae..8285c16d 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/custom/openflare/tls-certificates [get] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/content [get] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/import-file [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/apply [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/update-acme [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/convert-acme [post] +// @Router /api/v1/openflare/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/custom/openflare/tls-certificates/{id}/renew [post] +// @Router /api/v1/openflare/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/custom/openflare/managed-domains [get] +// @Router /api/v1/openflare/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/custom/openflare/managed-domains [post] +// @Router /api/v1/openflare/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/custom/openflare/managed-domains/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/managed-domains/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/managed-domains/match [get] +// @Router /api/v1/openflare/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/custom/openflare/dns-accounts [get] +// @Router /api/v1/openflare/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/custom/openflare/dns-accounts [post] +// @Router /api/v1/openflare/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/custom/openflare/dns-accounts/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/dns-accounts/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/acme-accounts/default [get] +// @Router /api/v1/openflare/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 ef133273..84e4dab6 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/custom/openflare/update/latest-release [get] +// @Router /api/v1/openflare/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/custom/openflare/update/upgrade [post] +// @Router /api/v1/openflare/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/custom/openflare/update/manual-upload [post] +// @Router /api/v1/openflare/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/custom/openflare/update/manual-upgrade [post] +// @Router /api/v1/openflare/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/custom/openflare/update/logs/ws [get] +// @Router /api/v1/openflare/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 67af78b3..e183f075 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/custom/openflare/waf/rule-groups [get] +// @Router /api/v1/openflare/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/custom/openflare/waf/rule-groups/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/waf/rule-groups [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/rule-groups/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/rule-groups/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/rule-groups/{id}/sites [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/sites/{route_id}/rule-groups [get] +// @Router /api/v1/openflare/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/custom/openflare/waf/sites/{route_id}/rule-groups [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups [get] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups/{id} [get] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups/{id}/update [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups/{id}/delete [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups/{id}/sync [post] +// @Router /api/v1/openflare/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/custom/openflare/waf/ip-groups/test [post] +// @Router /api/v1/openflare/waf/ip-groups/test [post] func TestIPGroupAutoConfigHandler(c *gin.Context) { var input IPGroupAutoTestInput if !apiutil.BindJSON(c, &input) { diff --git a/Wavelet/internal/router/v1/custom.go b/Wavelet/internal/router/v1/custom.go index 80bb4eb1..ba88641d 100644 --- a/Wavelet/internal/router/v1/custom.go +++ b/Wavelet/internal/router/v1/custom.go @@ -6,7 +6,6 @@ package v1 import ( "github.com/Rain-kl/Wavelet/internal/apps/custom" - ofrouter "github.com/Rain-kl/Wavelet/internal/router/v1/openflare" "github.com/gin-gonic/gin" ) @@ -15,6 +14,5 @@ func RegisterCustomRoutes(apiV1Router *gin.RouterGroup) { customRouter := apiV1Router.Group("/custom") { customRouter.GET("/hello", custom.Hello) - ofrouter.RegisterV1Routes(customRouter) } } diff --git a/Wavelet/internal/router/v1/openflare/openflare.go b/Wavelet/internal/router/v1/openflare/openflare.go index 2b4268fc..0f531465 100644 --- a/Wavelet/internal/router/v1/openflare/openflare.go +++ b/Wavelet/internal/router/v1/openflare/openflare.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package openflare registers OpenFlare HTTP routes. -// Management console APIs are mounted via RegisterV1Routes under /api/v1/custom/openflare. +// Management console APIs are mounted via RegisterV1Routes under /api/v1/openflare. // Agent/Relay/Flared protocol routes are mounted via RegisterRoutes under /api. package openflare diff --git a/Wavelet/internal/router/v1/openflare/v1.go b/Wavelet/internal/router/v1/openflare/v1.go index 5ea94768..8654d3e5 100644 --- a/Wavelet/internal/router/v1/openflare/v1.go +++ b/Wavelet/internal/router/v1/openflare/v1.go @@ -5,13 +5,12 @@ package openflare import "github.com/gin-gonic/gin" -// V1BasePath is the OpenFlare console API prefix under /api/v1/custom. -const V1BasePath = "/api/v1/custom/openflare" +// V1BasePath is the OpenFlare console API prefix under /api/v1. +const V1BasePath = "/api/v1/openflare" -// RegisterV1Routes mounts OpenFlare management console APIs under /custom/openflare. -// The parent group must already be the /custom router group from v1/custom.go. -func RegisterV1Routes(customGroup *gin.RouterGroup) { - group := customGroup.Group("/openflare") +// RegisterV1Routes mounts OpenFlare management console APIs under /api/v1/openflare. +func RegisterV1Routes(apiV1Router *gin.RouterGroup) { + group := apiV1Router.Group("/openflare") registerOptionRoutes(group) registerOriginRoutes(group) registerApplyLogRoutes(group) diff --git a/Wavelet/internal/router/v1/v1.go b/Wavelet/internal/router/v1/v1.go index 42213796..dac12ccc 100644 --- a/Wavelet/internal/router/v1/v1.go +++ b/Wavelet/internal/router/v1/v1.go @@ -5,6 +5,7 @@ package v1 import ( + ofrouter "github.com/Rain-kl/Wavelet/internal/router/v1/openflare" "github.com/gin-gonic/gin" ) @@ -16,6 +17,9 @@ func RegisterV1Routes(apiV1Router *gin.RouterGroup, apiGroup *gin.RouterGroup) { // 2. Admin routes RegisterAdminRoutes(apiV1Router) - // 3. Register custom business routes + // 3. OpenFlare management console APIs + ofrouter.RegisterV1Routes(apiV1Router) + + // 4. Custom business routes (example only) RegisterCustomRoutes(apiV1Router) } diff --git a/docs/changelog/index.md b/docs/changelog/index.md index 0f7c3687..744b69db 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -73,10 +73,11 @@ sidebar: false - 移除 `internal/router/openflare` 中与 Wavelet `/api/v1` 重复的 legacy 认证路由(用户登录/注册、OAuth、Cap、认证源等),统一由 Wavelet 内置用户/OAuth/Cap 模块提供。 - OpenFlare 路由注册统一收敛至 `internal/router/v1/openflare/`(`register_*.go` + `RegisterV1Routes`);`internal/apps/openflare/*/routers.go` 仅保留 Handler 与业务逻辑。 - 将 OpenFlare 路由注册包从 `internal/router/openflare/` 迁移至 `internal/router/v1/openflare/`,与 v1 路由分层目录结构对齐。 -- OpenFlare 管理控制台 API 统一迁移至 `/api/v1/custom/openflare/*`,响应格式对齐 Wavelet `{error_msg, data}` + `response.Abort*`。 +- OpenFlare 管理端路由注册从 `RegisterCustomRoutes` 移至 `v1.RegisterV1Routes`,API 前缀由 `/api/v1/custom/openflare` 调整为 `/api/v1/openflare`。 +- OpenFlare 管理控制台 API 统一迁移至 `/api/v1/openflare/*`,响应格式对齐 Wavelet `{error_msg, data}` + `response.Abort*`。 - `/api/*` 仅保留 Agent/Relay/Flared 节点协议路由(legacy `{success, message, data}` 信封);控制台鉴权改为 `apiutil.AdminRequired()`。 - 前端 OpenFlare Service 层由 `LegacyOpenFlareBaseService` 切换为 `OpenFlareBaseService`(`BaseService` + v1 路径)。 -- 为 OpenFlare v1 管理端 API 补充 Swagger 注解(`/api/v1/custom/openflare/*`,约 99 个端点)。 +- 为 OpenFlare v1 管理端 API 补充 Swagger 注解(`/api/v1/openflare/*`,约 99 个端点)。 - 移除已无引用的 `internal/apps/openflare/auth/`、`compat/auth.go`、`compat/routes.go` 及前端 `legacy-base.service.ts`。 ## [v2.3.4] - 2026-06-17