|
1 | | -# TG 监控告警系统 - 环境配置 |
2 | | -# 复制此文件为 .env 并填入实际值 |
| 1 | +# tg-monitor-v2 environment template |
| 2 | +# Copy to .env and fill real values. Never commit .env. |
3 | 3 |
|
4 | | -# ==================== 数据库配置 ==================== |
5 | | -DATABASE_TYPE=mysql |
6 | | -MYSQL_HOST=localhost |
7 | | -MYSQL_PORT=3306 |
8 | | -MYSQL_USER=root |
9 | | -MYSQL_PASSWORD=your_mysql_password |
10 | | -MYSQL_DATABASE=tg_monitor |
11 | | - |
12 | | -# ==================== Telegram API ==================== |
13 | | -# 访问 https://my.telegram.org/apps 获取 |
14 | | -TELEGRAM_API_ID=your_api_id |
15 | | -TELEGRAM_API_HASH=your_api_hash |
16 | | - |
17 | | -# ==================== 服务器配置 ==================== |
| 4 | +# Server |
18 | 5 | HOST=0.0.0.0 |
19 | 6 | PORT=8000 |
20 | 7 | DEBUG=false |
21 | 8 | LOG_LEVEL=INFO |
| 9 | +TIMEZONE=Asia/Shanghai |
22 | 10 |
|
23 | | -# ==================== 安全配置 ==================== |
24 | | -# 生产环境请修改此密钥 |
25 | | -SECRET_KEY=please-change-this-in-production |
26 | | -# Token 有效期(分钟) |
| 11 | +# MySQL |
| 12 | +MYSQL_HOST=localhost |
| 13 | +MYSQL_PORT=3306 |
| 14 | +MYSQL_USER=tgmonitor |
| 15 | +MYSQL_PASSWORD=change_me |
| 16 | +MYSQL_DATABASE=tg_monitor |
| 17 | + |
| 18 | +# Telegram API |
| 19 | +# Create an app at https://my.telegram.org/apps |
| 20 | +TELEGRAM_API_ID=123456 |
| 21 | +TELEGRAM_API_HASH=change_me |
| 22 | + |
| 23 | +# Security |
| 24 | +# Generate with: python3 -c "import secrets; print(secrets.token_urlsafe(48))" |
| 25 | +JWT_SECRET_KEY=change_me_to_a_long_random_value |
27 | 26 | ACCESS_TOKEN_EXPIRE_MINUTES=240 |
28 | 27 |
|
29 | | -# ==================== CORS 配置 ==================== |
30 | | -# 生产环境请设置具体域名,如:https://yourdomain.com |
31 | | -# CORS_ORIGINS=https://yourdomain.com,https://app.yourdomain.com |
| 28 | +# CORS |
| 29 | +# Production example: CORS_ORIGINS=https://monitor.example.com |
32 | 30 | CORS_ORIGINS=* |
33 | 31 |
|
34 | | -# ==================== WebSocket 令牌(可选)==================== |
35 | | -# 设置后 WebSocket 连接需要此令牌 |
36 | | -# WS_TOKEN=your_ws_token |
| 32 | +# WebSocket auth, optional |
| 33 | +# WS_TOKEN=change_me |
37 | 34 |
|
38 | | -# ==================== 代理配置(可选)==================== |
| 35 | +# Proxy, optional |
39 | 36 | # HTTP_PROXY=http://127.0.0.1:7890 |
40 | 37 | # HTTPS_PROXY=http://127.0.0.1:7890 |
41 | 38 | # SOCKS5_PROXY=socks5://127.0.0.1:7891 |
42 | 39 |
|
43 | | -# ==================== 通知配置(可选)==================== |
44 | | -# SMTP_HOST=smtp.gmail.com |
| 40 | +# SMTP notification, optional |
| 41 | +# SMTP_HOST=smtp.example.com |
45 | 42 | # SMTP_PORT=587 |
46 | | -# SMTP_USER=your_email@gmail.com |
47 | | -# SMTP_PASSWORD=your_app_password |
48 | | -# SMTP_FROM=your_email@gmail.com |
| 43 | +# SMTP_USER=notice@example.com |
| 44 | +# SMTP_PASSWORD=change_me |
| 45 | +# SMTP_FROM=notice@example.com |
| 46 | + |
| 47 | +# Frontend, optional |
| 48 | +# Leave empty for same-origin /api/v1 access. |
| 49 | +# VITE_API_BASE_URL=http://localhost:8000 |
0 commit comments