Skip to content

Commit 4d7a653

Browse files
committed
docs: update README and README-cn for v2.0.0 security features
- Document auto-generated secrets, forced password change, rate limiting, one-time tokens, CORS restriction, Helmet headers, sessionStorage - Add ENCRYPTION_SECRET and CORS_ORIGIN to config tables - Note WAL mode in architecture description
1 parent 73ca71a commit 4d7a653

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

README-cn.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,16 @@
101101
- 24 小时历史条形图,按颜色标识健康状态
102102
- 自动刷新仪表盘,包含汇总统计
103103

104-
### 认证
104+
### 认证与安全
105105

106106
- 基于 JWT 的登录,凭证可配置
107+
- 自动生成持久化密钥(JWT、加密密钥、Salt)— 无硬编码默认值
108+
- 首次使用默认密码登录后强制修改密码
109+
- 登录速率限制(5 分钟内最多 5 次尝试)
110+
- Helmet 安全头及内容安全策略(CSP)
111+
- SSE/下载 URL 使用一次性令牌(不再在 URL 中暴露 JWT)
112+
- 会话级令牌存储(`sessionStorage`,关闭标签页即清除)
113+
- CORS 限制为配置的来源(默认仅同源)
107114
- 受保护的 API 路由和前端路由
108115
- 会话过期自动跳转登录页
109116

@@ -163,9 +170,11 @@ cd ../frontend && npm install && npm run dev
163170
| --- | --- | --- |
164171
| `PORT` | `3001` | 服务端口 |
165172
| `AUTH_USERNAME` | `admin` | 登录用户名 |
166-
| `AUTH_PASSWORD` | `changeme` | 登录密码 |
167-
| `JWT_SECRET` | `your-secret-key-here` | JWT 签名密钥(部署前务必修改|
173+
| `AUTH_PASSWORD` | `changeme` | 登录密码(首次登录需强制修改) |
174+
| `JWT_SECRET` | 自动生成 | JWT 签名密钥(留空则自动生成|
168175
| `JWT_EXPIRES_IN` | `24h` | JWT 令牌过期时间 |
176+
| `ENCRYPTION_SECRET` | 自动生成 | API 密钥加密密钥(留空则自动生成) |
177+
| `CORS_ORIGIN` | 仅同源 | 允许的 CORS 来源(如 `https://your-domain.com`|
169178

170179
### 接入真实服务商
171180

@@ -210,7 +219,7 @@ cd ../frontend && npm install && npm run dev
210219
└─────────────────────────┘
211220
```
212221

213-
整个技术栈以**单个 Node.js 进程**运行 — 无需 Redis、无需 Postgres、无外部依赖。前端由 Vite 构建,作为静态文件由 Express 提供服务。SQLite 将所有基准测试、工作流、监控历史和服务商配置存储在一个文件中,备份和迁移极其简单。
222+
整个技术栈以**单个 Node.js 进程**运行 — 无需 Redis、无需 Postgres、无外部依赖。前端由 Vite 构建,作为静态文件由 Express 提供服务。SQLite(WAL 模式)将所有基准测试、工作流、监控历史和服务商配置存储在一个文件中,备份和迁移极其简单。
214223

215224
|| 技术栈 |
216225
| --- | --- |

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,16 @@ Running LLMs in production means juggling multiple providers, each with differen
101101
- 24h history bar with color-coded health status
102102
- Auto-refresh dashboard with summary stats
103103

104-
### Authentication
104+
### Authentication & Security
105105

106106
- JWT-based login with configurable credentials
107+
- Auto-generated persistent secrets (JWT, encryption key, salt) — no hardcoded defaults
108+
- Forced password change on first login with default credentials
109+
- Login rate limiting (5 attempts per 5 minutes)
110+
- Helmet security headers with Content Security Policy
111+
- One-time tokens for SSE/download URLs (no JWT in query strings)
112+
- Session-bound token storage (`sessionStorage`, cleared on tab close)
113+
- CORS restricted to configured origin (same-origin by default)
107114
- Protected API routes and frontend routing
108115
- Auto-redirect to login page on session expiry
109116

@@ -163,9 +170,11 @@ All configuration is managed via a single `.env` file in the project root:
163170
| --- | --- | --- |
164171
| `PORT` | `3001` | Server port |
165172
| `AUTH_USERNAME` | `admin` | Login username |
166-
| `AUTH_PASSWORD` | `changeme` | Login password |
167-
| `JWT_SECRET` | `your-secret-key-here` | JWT signing secret (change before deploying) |
173+
| `AUTH_PASSWORD` | `changeme` | Login password (must change on first login) |
174+
| `JWT_SECRET` | auto-generated | JWT signing secret (leave empty to auto-generate) |
168175
| `JWT_EXPIRES_IN` | `24h` | JWT token expiry |
176+
| `ENCRYPTION_SECRET` | auto-generated | API key encryption secret (leave empty to auto-generate) |
177+
| `CORS_ORIGIN` | same-origin only | Allowed CORS origin (e.g. `https://your-domain.com`) |
169178

170179
### Connect Real Providers
171180

@@ -210,7 +219,7 @@ All configuration is managed via a single `.env` file in the project root:
210219
└─────────────────────────┘
211220
```
212221

213-
The entire stack runs as a **single Node.js process** — no Redis, no Postgres, no external dependencies. The frontend is built by Vite and served as static files by Express. SQLite stores all benchmarks, workflows, monitor history, and provider config in one file, making backup and migration trivial.
222+
The entire stack runs as a **single Node.js process** — no Redis, no Postgres, no external dependencies. The frontend is built by Vite and served as static files by Express. SQLite (WAL mode) stores all benchmarks, workflows, monitor history, and provider config in one file, making backup and migration trivial.
214223

215224
| Layer | Stack |
216225
| --------- | -------------------------------------------- |

0 commit comments

Comments
 (0)