Skip to content

[Upstream] fix: replace hardcoded DB passwords and session secret with placeholders#135

Open
Sagit-chu wants to merge 1 commit into
mainfrom
upstream-pr-2402
Open

[Upstream] fix: replace hardcoded DB passwords and session secret with placeholders#135
Sagit-chu wants to merge 1 commit into
mainfrom
upstream-pr-2402

Conversation

@Sagit-chu

Copy link
Copy Markdown
Owner

Synced from upstream PR: songquanpeng#2402

问题

docker-compose.yml 中提交了 4 个硬编码凭据:

# Line 15: 数据库连接密码
SQL_DSN=oneapi:123456@tcp(db:3306)/one-api

# Line 17: session 加密密钥
SESSION_SECRET=random_string

# Line 46: MySQL root 密码
MYSQL_ROOT_PASSWORD: 'OneAPI@justsong'

# Line 48: MySQL 用户密码
MYSQL_PASSWORD: '123456'

其中 SESSION_SECRET=random_string 的值正是 common/init.go:41 检测到会发出警告的示例值。DB 密码 123456OneAPI@justsong 可直接用于连接数据库。

修复

4 个硬编码值替换为 change-me 占位符,同时更新 common/init.go 中的检测逻辑。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants