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
21 changes: 21 additions & 0 deletions .github/scripts/d1-migration-manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ export const D1_MIGRATIONS = [
file: "worker/migrations/2026-09-11-user-blocks.sql",
artifacts: ["table:user_blocks", "index:idx_user_blocks_blocked"],
},
{
id: "2026-09-12-r2-reference-invariants",
file: "worker/migrations/2026-09-12-r2-reference-invariants.sql",
artifacts: [
"trigger:prevent_general_member_removal",
"trigger:prevent_pending_message_attachment_insert",
"trigger:prevent_pending_message_attachment_update",
"trigger:prevent_pending_user_avatar_insert",
"trigger:prevent_pending_user_avatar_update",
"trigger:prevent_pending_channel_avatar_insert",
"trigger:prevent_pending_channel_avatar_update",
"trigger:prevent_pending_site_icon_insert",
"trigger:prevent_pending_site_icon_update",
],
rerunnable: true,
},
{
id: "2026-09-12-user-bio",
file: "worker/migrations/2026-09-12-user-bio.sql",
artifacts: ["column:users.bio"],
},
];

// b3f6855 曾发布、0c13e8f 已撤回的迁移:仅识别历史 ledger,不要求新安装创建废弃表,也不删除旧数据。
Expand Down
28 changes: 28 additions & 0 deletions .github/scripts/prepare-vditor-assets.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { copyFile, mkdir, readFile, rm } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
const packageRoot = resolve(repositoryRoot, "node_modules/vditor");
const targetRoot = resolve(repositoryRoot, "frontend/public/vendor/vditor");
const packageMetadata = JSON.parse(await readFile(resolve(packageRoot, "package.json"), "utf8"));
const runtimeFiles = [
"dist/css/content-theme/light.css",
"dist/js/icons/ant.js",
"dist/js/i18n/en_US.js",
"dist/js/i18n/zh_CN.js",
"dist/js/lute/lute.min.js",
];

// 只发布聊天编辑器真正会请求的运行时,避免把公式、图表和全量高亮包带进站点。
await rm(targetRoot, { recursive: true, force: true });
for (const relativePath of runtimeFiles) {
const targetPath = resolve(targetRoot, relativePath);
await mkdir(dirname(targetPath), { recursive: true });
await copyFile(resolve(packageRoot, relativePath), targetPath);
}
await mkdir(targetRoot, { recursive: true });
await copyFile(resolve(packageRoot, "LICENSE"), resolve(targetRoot, "LICENSE"));
await readFile(resolve(targetRoot, "dist/js/lute/lute.min.js"));

console.log(`Prepared Vditor ${packageMetadata.version} runtime assets.`);
1 change: 1 addition & 0 deletions .github/workflows/deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- "worker/**"
- "frontend/**"
- "shared/**"
- "test/**"
- ".github/scripts/**"
- ".github/workflows/deploy-worker.yml"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AGENTS.md
Agent.md
frontend/dist/
frontend/demo-dist/
frontend/public/vendor/vditor/
.playwright-cli/
.tmp/
worker/src/generated/
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

EdgeChat 从 `2.1.2` 起正式采用语义化版本。更早的版本号依据已经完成的主要里程碑补记,用于说明项目演进,不对应历史 Git 标签。

## 2.5.0 - 2026-09-12

- 网页群聊与私聊正文统一支持安全 Markdown,保留结构化提及、HTTP(S) 自动链接、纯文本摘要和 Markdown 原文复制。
- 消息输入栏可原位展开 Vditor WYSIWYG 编辑器;完整编辑器、专用样式与自托管运行时仅在首次点击后加载,并继续复用原草稿、附件、回复和发送链路。
- 原始 HTML、远程图片和动态媒体预览在编辑阶段即安全降级,不新增后端接口、数据库迁移或云资源;本次按需求仅完成本地实现与验证,未部署。

## 2.4.0 - 2026-09-12

- 新增站内可见的纯文本个人简介与可复用用户资料卡,支持 Web 设置编辑、消息/成员/私信头像入口和移动浏览器底部面板。
- 资料按需读取,外部身份独立展示;复用既有私信与拉黑链路,完善部分更新、请求竞态和弹层焦点管理。
- 升级须先执行 `2026-09-12-user-bio` D1 迁移;GitHub Actions 自动迁移和维护自检清单已接入,无新增云资源。

## 2.3.0 - 2026-09-12

- 新增网页端分层消息通知:前台其他会话使用 Telegram Web 风格右下角 Toast,前台当前会话仅在提及或回复时提示,后台或最小化继续使用系统通知。

## 2.2.1 - 2026-09-11

- 修复刷新后私信顶栏丢失拉黑状态、需要重复点击才能解除拉黑的问题。
Expand Down
1 change: 1 addition & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Admins can bind any group in EdgeChat to a Telegram group. Once bound, messages
- Real-time messaging, paginated history, Telegram-style voice messages, and file messages
- Block or unblock contacts from the direct-message header; direct messages pause in both directions while blocked
- The web client supports Telegram-style replies, quoted-message navigation, and reply-aware direct-attention alerts
- The foreground web client shows Telegram Web-style bottom-right alerts for other conversations; the current conversation only alerts for mentions or replies, while background tabs continue to use browser system notifications
- Web and Android recording, waveform seeking, playback speed controls, and two-way Telegram voice/audio sync
- File uploads and avatar management
- Scheduled hard deletion of expired messages
Expand Down
1 change: 1 addition & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ EdgeChat は Cloudflare 上にデプロイするチーム向けチャットシ
- リアルタイムメッセージ、履歴のページング、Telegram 風ボイスメッセージ、ファイルメッセージ
- ダイレクトメッセージのヘッダーから相手をブロック/解除でき、ブロック中は双方の送信を停止
- Web では Telegram 風の返信、引用元へのジャンプ、返信を含む「メンション」優先通知に対応
- Web が前面にある場合、別の会話からのメッセージは Telegram Web 風の右下通知で表示し、現在の会話はメンションまたは返信時のみ通知する。バックグラウンドではブラウザのシステム通知を引き続き使用
- Web / Android の録音、波形シーク、倍速再生、Telegram voice/audio の双方向同期
- ファイルアップロードとアバター管理
- 期限切れメッセージの定期ハード削除に対応
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ EdgeChat 是一个部署在 Cloudflare 上的团队聊天系统:账号体系
- 实时消息、历史消息分页、Telegram 风格语音消息与文件消息
- 可在私信顶部拉黑或解除拉黑联系人,拉黑期间双方均无法继续发送私信
- 网页支持 Telegram 风格消息回复、引用跳转,以及将回复纳入「有人@我」优先提醒
- 网页前台收到其他会话消息时显示 Telegram Web 风格右下角通知;当前会话仅为 @提及或回复提示,网页后台继续使用浏览器系统通知
- 网页和 Android 均支持录音、波形进度、倍速播放;Telegram voice/audio 可双向同步
- 文件上传与头像管理
- 支持定时硬删除过期消息
Expand Down
68 changes: 66 additions & 2 deletions docs/api/edgechat-v1.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,71 @@ paths:
/me/profile:
patch:
operationId: updateProfile
description: |
Updates only explicitly supplied fields of the authenticated user.
Omitted bio/displayName/avatarKey fields keep their existing values.
bio is plain text: normalize CRLF/CR to LF, trim surrounding whitespace,
then validate at most 200 Unicode code points. Empty or whitespace-only
bio clears it. Non-string or over-limit bio is rejected without truncation.
avatarKey null clears the avatar. A client-supplied target user ID is ignored.
The same business logic is available at PATCH /api/me/profile.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [displayName]
properties:
displayName: { type: string }
bio:
type: string
description: Optional site-visible bio, at most 200 Unicode code points after normalization.
avatarKey: { type: [string, "null"] }
clearAvatar: { type: boolean }
responses:
"200":
description: Updated session
content:
application/json:
schema:
type: object
properties:
session: { $ref: "#/components/schemas/Session" }
"400":
description: Invalid profile input
"401":
description: Authentication required
/users/{userId}/profile:
get:
operationId: getUserProfile
description: |
Reads the current public profile of one local account. Requires authentication;
all signed-in site users have the same visibility as the user directory.
Deleted, disabled and nonexistent accounts all return the same unavailable response.
External identities (including numeric Telegram IDs) must not use this endpoint.
Bio is site-visible plain text, not end-to-end encrypted, and is not included in
message, reply, member, DM or bootstrap user summaries.
Also available at GET /api/users/{userId}/profile through the shared v1 proxy.
parameters:
- name: userId
in: path
required: true
schema: { type: integer, minimum: 1, maximum: 9007199254740991 }
responses:
"200":
description: Explicit public-field whitelist
content:
application/json:
schema:
type: object
required: [profile]
properties:
profile: { $ref: "#/components/schemas/UserProfile" }
"400":
description: Invalid local user ID
"401":
description: Authentication required
"404":
description: User profile unavailable
/rooms/{kind}/{roomId}/messages:
get:
operationId: listRoomMessages
Expand Down Expand Up @@ -523,6 +574,9 @@ components:
username: { type: string }
displayName: { type: string }
avatarUrl: { type: string }
bio:
type: string
description: Present on Web login, profile update and session restore; omitted by older/device session producers.
isAdmin: { type: boolean }
sessionVersion: { type: integer }
deviceSessionId: { type: string }
Expand All @@ -534,6 +588,16 @@ components:
username: { type: string }
displayName: { type: string }
avatarUrl: { type: string }
UserProfile:
type: object
additionalProperties: false
required: [id, username, displayName, avatarUrl, bio]
properties:
id: { type: integer, minimum: 1, maximum: 9007199254740991 }
username: { type: string }
displayName: { type: string }
avatarUrl: { type: string }
bio: { type: string, maxLength: 200, default: "" }
Channel:
type: object
required: [id, name, kind]
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export default {
getUsers() {
return request('/users');
},
getUserProfile(userId, options = {}) {
return request(`/users/${encodeURIComponent(userId)}/profile`, options);
},
bootstrap() {
return request('/bootstrap');
},
Expand Down
Loading
Loading