WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s

This commit is contained in:
yawan
2026-09-22 16:19:06 +08:00
commit f7fc992f57
3929 changed files with 1006607 additions and 0 deletions
+255
View File
@@ -0,0 +1,255 @@
# 系统管理 API
[返回目录](./README.md)
| 方法 | 路径 | 描述 |
| ------ | --------------------------------- | ---------------------- |
| GET | `/system/capabilities` | 获取部署能力清单 |
| GET | `/system/info` | 获取系统信息 |
| GET | `/system/parser-engines` | 获取解析引擎列表 |
| POST | `/system/parser-engines/check` | 检查解析引擎可用性 |
| POST | `/system/docreader/reconnect` | 重连文档解析服务 |
| GET | `/system/storage-engine-status` | 获取存储引擎状态 |
| POST | `/system/storage-engine-check` | 检查存储引擎连通性 |
## GET `/system/capabilities` - 获取部署能力清单
返回当前部署版本,以及各功能模块是否已在后端注册对应路由。`supported: false` 表示 SPA 应隐藏相关入口;字段缺失或接口不可用时不应据此清空整个菜单(fail-open),但 Lite 版会始终将 `organizations` 标记为不支持。
**权限**:Viewer+(租户成员);任意有效 API Key 可读(`apiKeyAny`)。
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/capabilities' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'
```
**响应**:
```json
{
"code": 0,
"msg": "success",
"data": {
"edition": "standard",
"capabilities": {
"organizations": { "supported": true },
"agents": { "supported": true },
"integrations.im": { "supported": true },
"integrations.embed": { "supported": false, "reason": "route_not_registered" },
"integrations.api": { "supported": true },
"settings.mcp": { "supported": true },
"settings.websearch": { "supported": true },
"settings.vectorstore": { "supported": true },
"settings.storage": { "supported": true },
"settings.sandbox": { "supported": true }
}
}
}
```
Lite 版示例(共享空间不可用):
```json
{
"capabilities": {
"organizations": {
"supported": false,
"reason": "not_supported_in_lite"
}
}
}
```
## GET `/system/info` - 获取系统信息
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/info' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json'
```
**响应**:
```json
{
"data": {
"version": "1.2.0",
"edition": "community",
"commit_id": "a1b2c3d",
"build_time": "2025-08-12T08:00:00Z",
"go_version": "go1.21.5",
"keyword_index_engine": "bleve",
"vector_store_engine": "milvus",
"graph_database_engine": "neo4j",
"minio_enabled": true,
"db_version": "20250810_001"
},
"success": true
}
```
## GET `/system/parser-engines` - 获取解析引擎列表
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/parser-engines' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json'
```
**响应**:
```json
{
"data": [
{
"name": "docreader",
"label": "DocReader",
"description": "高精度文档解析引擎",
"available": true
},
{
"name": "tika",
"label": "Apache Tika",
"description": "通用文档解析引擎",
"available": false
}
],
"connected": true,
"success": true
}
```
## POST `/system/parser-engines/check` - 检查解析引擎可用性
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/parser-engines/check' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json' \
--data '{
"addr": "http://docreader:8000"
}'
```
**响应**:
```json
{
"data": [
{
"name": "docreader",
"label": "DocReader",
"description": "高精度文档解析引擎",
"available": true
}
],
"success": true
}
```
## POST `/system/docreader/reconnect` - 重连文档解析服务
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/docreader/reconnect' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json' \
--data '{
"addr": "http://docreader:8000"
}'
```
**响应**:
```json
{
"success": true
}
```
## GET `/system/storage-engine-status` - 获取存储引擎状态
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/storage-engine-status' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json'
```
**响应**:
```json
{
"data": {
"engines": [
{
"name": "minio",
"available": true,
"description": "MinIO 对象存储"
},
{
"name": "cos",
"available": false,
"description": "腾讯云 COS 对象存储"
},
{
"name": "s3",
"available": false,
"description": "AWS S3 对象存储"
},
{
"name": "oss",
"available": false,
"description": "阿里云 OSS 对象存储"
}
],
"minio_env_available": true
},
"success": true
}
```
## POST `/system/storage-engine-check` - 检查存储引擎连通性
**请求**:
```curl
curl --location 'http://localhost:8080/api/v1/system/storage-engine-check' \
--header 'X-API-Key: sk-xxxxx' \
--header 'Content-Type: application/json' \
--data '{
"provider": "minio",
"minio": {
"endpoint": "localhost:9000",
"access_key": "minioadmin",
"secret_key": "minioadmin",
"bucket": "weknora",
"use_ssl": false
}
}'
```
**响应**:
```json
{
"data": {
"ok": true,
"message": "连接成功",
"bucket_created": false
},
"success": true
}
```