From 652506352ab5348a0d570d6acacbc45203396cca Mon Sep 17 00:00:00 2001 From: d0zingcat Date: Thu, 15 Jan 2026 20:53:02 +0800 Subject: [PATCH] feat: update context Signed-off-by: d0zingcat --- CHANGELOG.md | 6 ++++++ docs/copilot-context.md | 5 +++-- todo.md | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d420869..e194f08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/copilot-context.md b/docs/copilot-context.md index c2a1df9..0e8c65c 100644 --- a/docs/copilot-context.md +++ b/docs/copilot-context.md @@ -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 diff --git a/todo.md b/todo.md index 186b70f..85eec4f 100644 --- a/todo.md +++ b/todo.md @@ -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.