feat: update context

Signed-off-by: d0zingcat <iamtangli42@gmail.com>
This commit is contained in:
2026-01-15 20:53:02 +08:00
parent 03b115b83e
commit 652506352a
3 changed files with 10 additions and 2 deletions

View File

@@ -4,6 +4,12 @@
本文件的格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)
并且本项目遵循 [语义化版本 (Semantic Versioning)](https://semver.org/lang/zh-CN/spec/v2.0.0.html)。
## [1.2.6] - 2026-01-15
### 变更
- **用户 Token**:将用户的 `personalToken` 从 32 位 UUID 缩短为 8 位十六进制字符串,提升易用性。
- **数据库迁移**:完善了数据库迁移流程,在 `db:migrate:deploy` 中集成了存量用户 Token 的自动缩短逻辑,确保线上环境数据的一致性。
## [1.2.5] - 2026-01-15

View File

@@ -1,4 +1,4 @@
# Project Context for GitHub Copilot (v1.2.5)
# Project Context for GitHub Copilot (v1.2.6)
This document provides technical context, architectural decisions, and code conventions for the **Alert Message Center** project. It is intended to help AI assistants understand the codebase.
@@ -101,7 +101,7 @@ The database schema is defined in `apps/server/src/db/schema.ts`.
### Personal Inbox (Direct Messaging)
- **Strategy**: Direct delivery to a specific user.
- **Mechanism**:
1. Each user has a `personalToken`.
1. Each user has a `personalToken` (8-character hex string).
2. Sending to `POST /api/webhook/:token/dm` routes messages directly to the user associated with the token.
3. No Topic or Subscription is required.
@@ -222,6 +222,7 @@ The database schema is defined in `apps/server/src/db/schema.ts`.
- Image path: `ghcr.io/${USER}/alert-message-center`.
- Deployment Architecture: A single container runs the Bun server, which serves API requests and static frontend assets (via `hono/bun`'s `serveStatic`).
- **Database Initialization**: The Docker entrypoint automatically runs `bun run db:migrate:deploy` before starting the server to ensure the schema is up-to-date in new environments.
- **Token Migration**: The `db:migrate:deploy` script (defined in `src/db/migrate.ts`) also handles legacy user token shortening to maintain consistency with the 8-character token logic introduced in v1.2.6.
## 8. Core Documents

View File

@@ -30,3 +30,4 @@
- [x] **Automated Migrations**: Automatically initialize database schema on startup (especially in Docker).
- [x] **Frontend Resilience**: Hardened API calls to prevent crashes on empty data or env access errors.
- [x] **CI & Type Safety**: Resolved all TypeScript errors and Biome formatting issues to ensure a healthy CI pipeline.
- [x] **User Token Shortening**: Shortened `personalToken` to 8 characters and integrated automated migration into the deployment script.