This commit is contained in:
Alex Yang
2026-04-01 12:22:55 +08:00
parent 61789061ce
commit efebce3c39
46 changed files with 4797716 additions and 462145 deletions
+364 -2
View File
@@ -437,15 +437,43 @@
"/config": {
"get": {
"summary": "获取系统配置",
"description": "获取当前系统配置",
"description": "获取当前系统配置。支持通过时间戳参数防止缓存,每次请求都会从 config.ini 重新读取最新配置。",
"tags": ["server"],
"parameters": [
{
"name": "t",
"in": "query",
"schema": {
"type": "integer"
},
"description": "时间戳参数,用于防止浏览器缓存响应。例如:Date.now()"
}
],
"responses": {
"200": {
"description": "配置信息",
"content": {
"application/json": {
"schema": {
"type": "object"
"type": "object",
"properties": {
"DNSServer": {
"type": "object",
"description": "DNS 服务器配置"
},
"HTTPServer": {
"type": "object",
"description": "HTTP 服务器配置"
},
"Shield": {
"type": "object",
"description": "Shield 屏蔽配置"
},
"GFWList": {
"type": "object",
"description": "GFWList 配置"
}
}
}
}
}
@@ -1670,6 +1698,340 @@
}
}
}
},
"/alert": {
"get": {
"summary": "获取威胁告警列表",
"description": "获取威胁告警列表,支持分页和级别过滤",
"tags": ["threat"],
"parameters": [
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer",
"default": 100
},
"description": "返回告警数量"
},
{
"name": "offset",
"in": "query",
"schema": {
"type": "integer",
"default": 0
},
"description": "偏移量"
},
{
"name": "level",
"in": "query",
"schema": {
"type": "string"
},
"description": "告警级别过滤"
}
],
"responses": {
"200": {
"description": "告警列表",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alerts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"timestamp": {
"type": "string"
},
"level": {
"type": "string"
},
"type": {
"type": "string"
},
"description": {
"type": "string"
},
"details": {
"type": "string"
},
"sourceIP": {
"type": "string"
},
"domain": {
"type": "string"
},
"queryType": {
"type": "string"
},
"resolved": {
"type": "boolean"
},
"resolvedTime": {
"type": "string"
},
"action": {
"type": "string"
}
}
}
},
"total": {
"type": "integer"
}
}
}
}
}
}
}
}
},
"/alert/resolve": {
"post": {
"summary": "解决威胁告警",
"description": "解决指定的威胁告警,支持屏蔽或放行操作",
"tags": ["threat"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"alertId": {
"type": "string",
"description": "告警ID"
},
"action": {
"type": "string",
"description": "处理动作:blocked 或 allowed"
}
},
"required": ["alertId", "action"]
}
}
}
},
"responses": {
"200": {
"description": "解决成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success"
}
}
}
}
}
},
"400": {
"description": "请求参数错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "服务器内部错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/threat/domain": {
"get": {
"summary": "获取所有威胁域名",
"description": "获取威胁域名数据库中的所有域名",
"tags": ["threat"],
"responses": {
"200": {
"description": "威胁域名列表",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"post": {
"summary": "添加威胁域名",
"description": "添加新的威胁域名到数据库",
"tags": ["threat"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "要添加的威胁域名"
}
},
"required": ["domain"]
}
}
}
},
"responses": {
"200": {
"description": "添加成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success"
}
}
}
}
}
},
"400": {
"description": "请求参数错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "服务器内部错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "删除威胁域名",
"description": "从威胁域名数据库中删除指定域名",
"tags": ["threat"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "要删除的威胁域名"
}
},
"required": ["domain"]
}
}
}
},
"responses": {
"200": {
"description": "删除成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success"
}
}
}
}
}
},
"400": {
"description": "请求参数错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "服务器内部错误",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"tags": [