docs: 修正 .env.example 默认值并补全 PGADMIN_PASSWORD#29
Open
F1sh2712 wants to merge 1 commit intoInvolutionHell:mainfrom
Open
docs: 修正 .env.example 默认值并补全 PGADMIN_PASSWORD#29F1sh2712 wants to merge 1 commit intoInvolutionHell:mainfrom
F1sh2712 wants to merge 1 commit intoInvolutionHell:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
修正
.env.example让cp .env.example .env后默认开箱即用,并补全缺失的PGADMIN_PASSWORD变量。Why
当前
.env.example存在两个让新贡献者卡住的问题:问题 1:默认配置指向不存在的 Neon 占位符
数据库段默认是:
PGHOST=ep-xxxx.ap-southeast-2.aws.neon.tech
PGUSER=neondb_owner
SPRING_DATASOURCE_URL=jdbc:postgresql://ep-xxxx.ap-southeast-2.aws.neon.tech/neondb?sslmode=require
新人
cp .env.example .env后启动后端会因为 DNS 解析失败(ep-xxxx是占位符)而无法连接数据库。问题 2:缺失 PGADMIN_PASSWORD 变量
docker-compose.yml中PGADMIN_PASSWORD用${PGADMIN_PASSWORD:?...}强制要求设置:但
.env.example完全没有这个变量。即使用户不启动 pgadmin 服务,docker compose ps/docker compose up等命令在解析 yml 时也会校验所有强制变量,直接报错:required variable PGADMIN_PASSWORD is missing a value
Closes #25
How
数据库段重排
localhost/involution/involution_hell/disable)作为默认值SPRING_SQL_INIT_MODE默认改为always(首次启动需要执行 schema.sql 建表)补全 pgAdmin 配置
新增 pgAdmin 段,包含
PGADMIN_EMAIL和必填的PGADMIN_PASSWORD,并在注释里说明"即使不启动 pgadmin 也必须设置"。保留的部分
POSTGRES_DB/POSTGRES_USER/POSTGRES_PASSWORD段保留,docker-compose 创建容器时使用(POSTGRES_PASSWORD同样是强制变量)Testing
本地实测验证流程:
cp .env.example .env(完全不修改任何字段)docker compose up -d postgres(容器进入 healthy 状态)curl -X POST http://127.0.0.1:8080/auth/login -d '{"username":"admin","password":"Admin@123456"}'返回:
{ "success": true, "message": "登录成功", "data": { "tokenName": "satoken", "tokenValue": "...", "user": {...} } }整条链路完全跑通,无需任何手动修改 .env。