Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install dependencies
working-directory: ${{ matrix.path }}
run: bun install
run: bun install --frozen-lockfile

- name: Run ESLint
working-directory: ${{ matrix.path }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ yarn.lock
pnpm-lock.yaml
bun.lockb
bun.lock
!server/bun.lock
!web/bun.lock
.idea
.vscode
.cursor
Expand Down
2 changes: 1 addition & 1 deletion doc/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ iOS App 支持连接到你自部署的后端。

AI 记忆是可选能力,默认关闭。它已经可以在 `develop` 镜像中使用,并会在包含 AI 记忆的下一个稳定版发布后进入稳定镜像。管理员可以在 `管理 -> AI 相关` 配置对话模型和向量模型后启用。Rote 支持 OpenAI-compatible 供应商,包括 OpenAI、OpenRouter、Ollama / LM Studio、DeepSeek、SiliconFlow、DashScope / Qwen、Zhipu GLM、Moonshot / Kimi、Volcengine Ark、Tencent Hunyuan、Baidu Qianfan,以及自定义 OpenAI-compatible 接口。

只有已登录且邮箱已验证的用户可以使用 AI 功能。AI 对话只保存在当前浏览器会话中,不会持久化写入数据库。只有在管理员开启 AI 向量存储和自动索引后,笔记与文章才会进入向量索引。
只有已登录且已认证的用户可以使用 AI 功能。AI 对话只保存在当前浏览器会话中,不会持久化写入数据库。只有在管理员开启 AI 向量存储和自动索引后,笔记与文章才会进入向量索引。

### 详细说明

Expand Down
3 changes: 2 additions & 1 deletion doc/userguide/API-ENDPOINTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ AI 与向量存储默认关闭,需要管理员在后台配置供应商并显
| `/admin/users` | GET | 管理员 | 用户列表(分页/筛选/搜索) |
| `/admin/users/:userId` | GET | 管理员 | 用户详情 |
| `/admin/users/:userId/role` | PUT | 超级管理员 | 更新用户角色 |
| `/admin/users/:userId/verify-email` | PUT | 管理员 | 验证用户邮箱 |
| `/admin/users/:userId/certification` | PUT | 管理员 | 认证用户 |
| `/admin/users/:userId/certification` | DELETE | 管理员 | 取消用户认证 |
| `/admin/users/:userId` | DELETE | 超级管理员 | 删除用户 |
| `/admin/roles/stats` | GET | 管理员 | 角色统计 |

Expand Down
2 changes: 1 addition & 1 deletion doc/userguide/API-KEY-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ When generating or updating an API Key, you can specify which permissions it sho
"data": {
"id": "user_id",
"email": "user@example.com",
"emailVerified": true,
"certified": true,
"username": "username",
"nickname": "User Nickname",
"description": "User description",
Expand Down
8 changes: 4 additions & 4 deletions doc/userguide/ARTICLE-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- **authorId**: 作者 ID(UUID 格式)
- **createdAt**: 创建时间(ISO 8601 格式)
- **updatedAt**: 更新时间(ISO 8601 格式)
- **author**: 作者信息对象(包含 `username`、`nickname`、`avatar`、`emailVerified`)
- **author**: 作者信息对象(包含 `username`、`nickname`、`avatar`、`certified`)
- **title**: 从 Markdown 内容解析的标题(计算字段,取第一个 `#` 标题)
- **summary**: 从 Markdown 内容解析的摘要(计算字段)

Expand Down Expand Up @@ -156,7 +156,7 @@ curl -X GET 'https://your-domain.com/v2/api/articles/<ARTICLE_ID>' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
}
}
}
Expand Down Expand Up @@ -295,7 +295,7 @@ curl -X GET 'https://your-domain.com/v2/api/articles/by-note/<NOTE_ID>'
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
}
}
}
Expand Down Expand Up @@ -380,7 +380,7 @@ curl -X POST 'https://your-domain.com/v2/api/articles/refs/<NOTE_ID>' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions doc/userguide/LOCAL-AI.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Rote 支持让已登录用户在自己的电脑上运行模型。模型请求由
- 访客不能进入 AI 页面。
- 所有已登录用户都可以使用本地模型进行普通对话。
- 只有满足站点原有 AI 使用条件的用户,才能让本地模型检索自己的 Rote 数据:
- 邮箱已验证
- 用户已认证
- 管理员已启用 AI 与向量能力;
- 笔记已经完成向量索引。
- 本地模型配置与桥接器 Token 仅保存在当前浏览器设备。
Expand All @@ -22,12 +22,11 @@ llama-server \
--alias gemma-4-12b-it-local \
--host 127.0.0.1 \
--port 8080 \
--ctx-size 8192 \
--jinja \
-ngl 99
```

16GB 内存设备如果出现内存压力,可以把 `--ctx-size` 调低至 `4096`。
如果需要限制上下文或 16GB 内存设备出现内存压力,可以手动添加 `--ctx-size 4096`。

## 2. 启动本地桥接器

Expand Down
10 changes: 5 additions & 5 deletions doc/userguide/ROTE-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- **createdAt**: 创建时间(ISO 8601 格式)
- **updatedAt**: 更新时间(ISO 8601 格式)
- **attachmentIds**: 附件 ID 数组(可选,创建/更新时使用)
- **author**: 作者信息对象(包含 `username`、`nickname`、`avatar`、`emailVerified`)
- **author**: 作者信息对象(包含 `username`、`nickname`、`avatar`、`certified`)
- **attachments**: 附件数组,每个附件包含:
- `id`: 附件 ID(UUID 格式)
- `url`: 附件原始 URL
Expand Down Expand Up @@ -144,7 +144,7 @@ curl -X POST 'https://your-domain.com/v2/api/notes/' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
},
"attachments": [],
"reactions": [],
Expand Down Expand Up @@ -269,7 +269,7 @@ curl -X GET 'https://your-domain.com/v2/api/notes/<NOTE_ID>' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
},
"attachments": [
{
Expand Down Expand Up @@ -487,7 +487,7 @@ curl -X PUT 'https://your-domain.com/v2/api/notes/<NOTE_ID>' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
},
"attachments": [],
"reactions": [],
Expand Down Expand Up @@ -579,7 +579,7 @@ curl -X GET 'https://your-domain.com/v2/api/notes/random' \
"username": "demo",
"nickname": "演示用户",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
},
"attachments": [],
"reactions": [],
Expand Down
6 changes: 3 additions & 3 deletions doc/userguide/SITE-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ curl -X GET 'https://your-domain.com/v2/api/site/config-status'

---

### 探索页可见性与邮箱验证策略说明
### 探索页可见性与用户认证策略说明

探索页中公开笔记的展示,除了依赖笔记本身为 `public` 状态外,还受到以下两个配置的共同影响:

Expand All @@ -277,8 +277,8 @@ curl -X GET 'https://your-domain.com/v2/api/site/config-status'
- 当为 `false` 时,用户的公开笔记不会出现在「探索」页推荐中,但仍可以通过直接链接访问。

- **系统级安全配置**(仅管理员可在管理后台 / Admin API 中配置)
- `security.requireVerifiedEmailForExplore`: boolean
- 当为 `true` 时,只有**邮箱已验证** (`emailVerified = true`) 且 `allowExplore !== false` 的用户,其公开笔记才会被纳入探索页候选集合。
- `security.requireCertifiedUserForExplore`: boolean
- 当为 `true` 时,只有**已认证** (`certified = true`) 且 `allowExplore !== false` 的用户,其公开笔记才会被纳入探索页候选集合。
- 当为 `false` 时,只要 `allowExplore !== false`,公开笔记即可参与探索页展示。

实现层面,探索页相关接口在数据库查询阶段就会同时考虑上述两个条件进行过滤,从而保证:
Expand Down
10 changes: 5 additions & 5 deletions doc/userguide/USER-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ curl -X GET 'https://your-domain.com/v2/api/users/demo'
"cover": "https://example.com/cover.jpg",
"description": "用户简介",
"createdAt": "2024-01-01T00:00:00.000Z",
"emailVerified": true
"certified": true
}
}
```

字段说明:

- `emailVerified`: boolean - 用户邮箱是否已完成验证(供前端显示认证状态使用)
- `certified`: boolean - 用户是否已认证(供前端显示认证状态使用)

可能的错误:

Expand Down Expand Up @@ -74,7 +74,7 @@ curl -X GET 'https://your-domain.com/v2/api/users/me/profile' \
"message": "success",
"data": {
"id": "uuid",
"emailVerified": true,
"certified": true,
"email": "demo@example.com",
"username": "demo",
"nickname": "Demo",
Expand All @@ -93,7 +93,7 @@ curl -X GET 'https://your-domain.com/v2/api/users/me/profile' \

字段补充说明:

- `emailVerified`: boolean - 当前用户邮箱是否已完成验证(供前端提示与安全策略使用)
- `certified`: boolean - 当前用户是否已认证(供前端提示与安全策略使用)
- `allowExplore`: boolean - 是否允许该用户的公开笔记出现在「探索」页(见下文用户设置接口)
- `authProvider`: string - 认证提供商,可能的值:
- `'local'`: 本地账户(通过用户名密码注册/登录)
Expand Down Expand Up @@ -430,7 +430,7 @@ Content-Disposition: attachment; filename=demo-2024-01-01-12-00-00.json
"username": "demo",
"nickname": "Demo",
"avatar": "https://example.com/avatar.jpg",
"emailVerified": true
"certified": true
},
"attachments": [],
"reactions": []
Expand Down
8 changes: 4 additions & 4 deletions postman/collections/Project API.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@
"response": []
},
{
"name": "Verify User Email",
"name": "Certify User",
"id": "2102556f-ca2b-4c8c-8790-71ccf8434302",
"request": {
"method": "PUT",
Expand All @@ -2457,15 +2457,15 @@
}
],
"url": {
"raw": "{{base_url}}/v2/api/admin/users/:userId/verify-email",
"raw": "{{base_url}}/v2/api/admin/users/:userId/certification",
"host": ["{{base_url}}"],
"path": [
"v2",
"api",
"admin",
"users",
":userId",
"verify-email"
"certification"
],
"variable": [
{
Expand All @@ -2474,7 +2474,7 @@
}
]
},
"description": "Manually verify a user's email. Requires admin role."
"description": "Manually certify a user. Requires admin role."
},
"response": []
},
Expand Down
24 changes: 24 additions & 0 deletions server/attachments/errorCodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"attachmentBatchLimitExceeded": "attachment_batch_limit_exceeded",
"attachmentMediaUnsupportedPrefix": "attachment_media_unsupported:",
"attachmentValidationFailed": "attachment_validation_failed",
"attachmentValidationErrorsPrefix": "attachment_validation_errors:",
"attachmentsRequired": "attachments_required",
"capabilityAttachmentUpload": "capability_required:attachment.upload",
"capabilityVideoUpload": "capability_required:attachment.video.upload",
"compressedFileInvalidPrefix": "compressed_file_invalid:",
"fileCountExceeded": "file_count_exceeded",
"insufficientVideoUpload": "insufficient_scope:video:upload",
"livePhotoOriginalNotImage": "live_photo_original_not_image",
"livePhotoPairedVideoInvalidPrefix": "live_photo_paired_video_invalid:",
"livePhotoPairedVideoMissingPrefix": "live_photo_paired_video_missing:",
"livePhotoPairedVideoNotVideo": "live_photo_paired_video_not_video",
"livePhotoPairedVideoRequired": "live_photo_paired_video_required",
"objectKeyInvalid": "object_key_invalid",
"originalFileNotFoundPrefix": "original_file_not_found:",
"pairedVideoLivePhotoOnlyPrefix": "paired_video_live_photo_only:",
"posterFileInvalidPrefix": "poster_file_invalid:",
"storageNotConfigured": "storage_not_configured",
"uuidMismatchPrefix": "attachment_uuid_mismatch:",
"videoCompressedKeyForbiddenPrefix": "video_compressed_key_forbidden:"
}
Loading
Loading