-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.env.example
More file actions
66 lines (59 loc) · 2.87 KB
/
.env.example
File metadata and controls
66 lines (59 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# --- 数据库(Neon.tech 或其他 PostgreSQL)---
PGHOST=ep-xxxx.ap-southeast-2.aws.neon.tech
PGPORT=5432
PGUSER=neondb_owner
PGPASSWORD=change_me
PGDATABASE=neondb
PGSSLMODE=require
# Spring Boot JDBC 连接(由上面的 PG 变量转换而来)
SPRING_DATASOURCE_URL=jdbc:postgresql://ep-xxxx.ap-southeast-2.aws.neon.tech/neondb?sslmode=require
# 首次部署时设为 always 以初始化 schema.sql,之后改为 never
SPRING_SQL_INIT_MODE=never
# --- 本地开发用 Docker PostgreSQL(无 Neon 账号的开发者使用)---
POSTGRES_DB=involution_hell
POSTGRES_USER=involution
POSTGRES_PASSWORD=change_me
# --- GitHub OAuth(登录)---
# 后端用 JustAuth 走 GitHub OAuth;启动后访问 /oauth/render/github 会跳到 GitHub 授权页。
#
# 你需要**自己**在 GitHub 注册一个 OAuth App(不要用社区共享 key,回调 URL 不会匹配):
# 1. 打开 https://github.com/settings/developers → New OAuth App
# 2. Application name:随便填,如 "involution-hell-dev (你的名字)"
# 3. Homepage URL:http://localhost:3010
# 4. **Authorization callback URL:http://localhost:3010/api/auth/callback/github**
# 这个 URL 必须与 AUTH_URL 拼出来的一致,否则 GitHub 会拒绝并报
# "redirect_uri is not associated with this application"
# 5. 创建后页面会显示 Client ID,再点 "Generate a new client secret" 得到 Secret
# 6. 把这两个值填到下面,AUTH_URL 保持 http://localhost:3010
#
# 生产环境用另一个 prod App(已注册线上域名为回调),由部署机的 .env 提供,
# 跟你本地这套完全独立,不会互相污染。
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=
AUTH_SECRET=
# --- AI 模型(用 OpenAI 兼容协议调用 GLM-4.6V-Flash 作为默认 fallback) ---
#
# 变量名沿用 OPENAI_* 是因为 Java 代码里用的是 OpenAI /chat/completions 标准协议,
# 只是 URL + Key + Model 指向了智谱开放平台。未来要切回真 OpenAI / Anthropic
# 等任何 OpenAI-compatible 服务,只换这三个值即可。
#
# 免费 key 从 https://open.bigmodel.cn/ 获取。
OPENAI_API_KEY=
OPENAI_API_URL=https://open.bigmodel.cn/api/paas/v4
OPENAI_MODEL=glm-4.6v-flash
# --- 应用基本设置 ---
SPRING_APPLICATION_NAME=backend
SERVER_PORT=8080
# 前端域名,用于 GitHub OAuth 回调重定向和 Sa-Token 会话重定向
# 本地开发:http://localhost:3010(端口与前端 dev 一致;OAuth 回调拼成
# ${AUTH_URL}/api/auth/callback/github,必须和 GitHub OAuth App 注册的回调一致)
# 生产部署:https://involutionhell.com
AUTH_URL=http://localhost:3010
# --- Actuator ---
MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health,info,metrics
MANAGEMENT_ENDPOINT_HEALTH_PROBES_ENABLED=true
# when-authorized 生产推荐;开发时可改为 always
MANAGEMENT_ENDPOINT_HEALTH_SHOW_DETAILS=when-authorized
# --- 网关(Caddy)---
CADDY_HTTP_PORT=80
CADDY_HTTPS_PORT=443