-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
81 lines (69 loc) · 2.7 KB
/
.env.example
File metadata and controls
81 lines (69 loc) · 2.7 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
# =============================================
# Leverage Backend Neo - Environment Variables
# =============================================
# Copy this file to .env and fill in the values
# ---- App ----
PORT=3000
NODE_ENV=development
# Skip initialization module on startup (set true in dev to skip seeding)
SKIP_INIT=false
# ---- Database (MariaDB/MySQL) ----
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=leverage
DB_USERNAME=leverage
DB_PASSWORD=your_password_here
# 连接池大小(生产环境建议 20-50,开发环境建议 5-10)
DB_POOL_SIZE=20
# 全局查询超时(ms),超过此时间 TypeORM 会记录警告日志
DB_QUERY_TIMEOUT=10000
# ---- Redis ----
REDIS_HOST=localhost
REDIS_PORT=6379
# ---- JWT ----
# Use strong random secrets in production! e.g. openssl rand -hex 32
JWT_ACCESS_SECRET=change_me_access_secret
JWT_REFRESH_SECRET=change_me_refresh_secret
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# ---- Server Public URL ----
# Used as the callback base URL for heng judge results
# 生产环境填写服务器公网地址,例如 https://oj.example.com
BASE_URL=http://localhost:3000
# ---- CORS ----
# 生产环境填写前端域名,例如 https://oj.example.com
# 留空则默认允许所有来源(开发环境适用)
CORS_ORIGIN=https://your-domain.com
# ---- Heng Judge Service ----
HENG_BASE_URL=http://localhost:5000
HENG_AK=your_access_key
HENG_SK=your_secret_key
# Set true only in development with self-signed certs
HENG_ALLOW_INSECURE_TLS=false
# ---- Submission Rate Limit ----
MAX_SUBMISSION_PER_MINUTE=10
# ---- Botzone External Judge Provider ----
# Set BOTZONE_ENABLED=true to route all new submissions to botzone-neo instead of heng.
# When enabled, BOTZONE_BASE_URL and BOTZONE_API_KEY are required.
BOTZONE_ENABLED=false
BOTZONE_BASE_URL=http://botzone-neo.example.com
# API key for authenticating requests to botzone-neo
BOTZONE_API_KEY=your_botzone_api_key
# Secret token botzone-neo must send in the Authorization header on callbacks.
# Generate with: openssl rand -hex 32
BOTZONE_CALLBACK_TOKEN=change_me_botzone_callback_token
# Default problem ID on botzone-neo (can be overridden per problem in future)
BOTZONE_DEFAULT_PROBLEM_ID=
# Fallback polling interval in milliseconds (default 30000 = 30s)
BOTZONE_POLL_INTERVAL_MS=30000
# ---- Init (first startup) ----
# Default SA account credentials. Only used when no SA user exists.
INIT_SA_USERNAME=admin
INIT_SA_PASSWORD=Admin@123456
# ---- 生产环境会在启动时自动执行 migrations ----
# 手动生成:pnpm migration:generate src/migrations/MigrationName
# 手动执行:pnpm migration:run
# 回滚:pnpm migration:revert
# 查看状态:pnpm migration:show
# ---- Docker Compose only ----
DB_ROOT_PASSWORD=rootpass