开源前加固认证与部署契约:加密随机 JWT、改密事务吊销、登录 CSRF,并禁止生产回落 localhost。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 02:07:34 +08:00
parent 6f054a903c
commit 3b550f2124
24 changed files with 372 additions and 355 deletions

View File

@@ -4,8 +4,8 @@
# PostgreSQL 连接串
DB_DSN=postgres://postgres:postgres@localhost:5432/jiang13?sslmode=disable
# JWT 签名密钥(生产环境务必修改)
JWT_SECRET=your-jwt-secret-change-me
# JWT 签名密钥(≥32 字符强随机;禁止 change-me 等占位,留空则自动 crypto/rand 生成)
# JWT_SECRET=
# 服务端口
HTTP_PORT=3001