feat(server): randomize the seeded admin initial password (#172)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-08-04 16:50:46 +08:00
committed by GitHub
parent e05dea536b
commit 045ac250e0
35 changed files with 302 additions and 58 deletions
+3 -2
View File
@@ -35,12 +35,13 @@ packages/server/src
- Cookie 会话:`penguin_session`(HttpOnly、SameSite=Lax),有效期 7 天,滑动续期;
- 密码以 scrypt 哈希存储;服务端只保存会话 Token 的 sha256,不落明文;
- 不开放注册:启动时种子化内置管理员 `admin` / `penguin-2026`,其余账号由管理员创建;
- 不开放注册:启动时种子化内置管理员 `admin`,初始密码随机生成(形如 `penguin-1234`)并仅在种子当次打印到服务端控制台——自动化可用 `PENGUIN_SEED_ADMIN_PASSWORD` 固定——其余账号由管理员创建;
- 仅限同源访问,未启用 CORS 中间件。
```bash
# 密码用首次启动时打印的初始密码(或改过之后的密码)。
curl -c cookies.txt -H "Content-Type: application/json" \
-d '{"userId":"admin","password":"penguin-2026"}' \
-d '{"userId":"admin","password":"penguin-1234"}' \
http://127.0.0.1:7364/api/auth/login
```