-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy path.env.example
More file actions
86 lines (62 loc) · 2.04 KB
/
.env.example
File metadata and controls
86 lines (62 loc) · 2.04 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# NewAPI Middleware Tool - Environment Configuration
#
# 推荐使用 deploy.sh 自动生成此文件
# 手动配置时,复制此文件为 .env 并修改
# ===========================================
# NewAPI 环境 (由 deploy.sh 自动检测)
# ===========================================
# NewAPI 容器名
NEWAPI_CONTAINER=new-api
# NewAPI Docker 网络名
NEWAPI_NETWORK=
# ===========================================
# 数据库配置 (由 deploy.sh 自动检测)
# ===========================================
# Go 版本推荐使用完整 DSN 字符串 (设置了 SQL_DSN 则忽略下面的分离配置)
# MySQL: SQL_DSN=user:pass@tcp(host:3306)/dbname?charset=utf8mb4&parseTime=True
# PgSQL: SQL_DSN=host=localhost port=5432 user=postgres password=xxx dbname=one-api sslmode=disable
SQL_DSN=
# 兼容旧版分离配置
# 数据库引擎: mysql 或 postgres
DB_ENGINE=postgres
# 数据库主机 (容器名或服务名)
DB_DNS=postgres
# 数据库端口 (MySQL: 3306, PostgreSQL: 5432)
DB_PORT=5432
# 数据库名
DB_NAME=new-api
# 数据库用户
DB_USER=postgres
# 数据库密码
DB_PASSWORD=
# ===========================================
# 认证配置
# ===========================================
# 前端访问密码 (必填)
ADMIN_PASSWORD=
# 后端 API Key (必填,deploy.sh 会自动生成)
API_KEY=
# JWT 密钥 (deploy.sh 会自动生成)
JWT_SECRET=
# JWT 过期时间 (小时)
JWT_EXPIRE_HOURS=24
# ===========================================
# 服务配置
# ===========================================
# 前端端口 (默认: 1145)
FRONTEND_PORT=1145
# 时区
TIMEZONE=Asia/Shanghai
# 日志级别 (debug, info, warn, error)
LOG_LEVEL=info
# ===========================================
# 外部服务
# ===========================================
# NewAPI 内部地址 (用于API调用)
NEWAPI_BASEURL=
# ===========================================
# Redis 缓存配置
# ===========================================
# Redis 已默认启用,用于加速缓存恢复和查询性能
# Redis 密码 (无密码则留空)
REDIS_PASSWORD=