AirGate/.env.example
seaislee1209 3213d6d98a feat: complete AirGate core features + full audit fixes
Quota allocation system:
- Replace monthly budget with one-time quota allocation (prepaid model)
- Support both adding (+) and deducting (-) quota with underflow protection
- Stepped alerts at configurable percentages (e.g., 50%/80%/90%)
- Auto-disable when quota exhausted (100%), alert state resets on new allocation
- Quota allocation history with operator audit trail

IAM management:
- Create new IAM sub-accounts directly from AirGate (auto-generates API keys)
- SecretKey shown once in dialog with copy-to-clipboard
- Attach/detach IAM policies via UI (ArkFullAccess, TOSFullAccess, etc.)
- Sync existing users from Volcengine
- Project list pulled from Volcengine API for dropdown selection

Security & auth:
- API Key authentication for external systems (AirDrama integration)
- SECRET_KEY enforced in production (raises error if missing with DEBUG=False)
- APIKeyUser with proper pk/is_staff attributes for DRF compatibility

Infrastructure:
- Docker + docker-compose for backend and frontend
- Nginx reverse proxy for frontend with /api/ forwarding
- Entrypoint with auto-migrate and default admin creation
- SQLite data persisted via Docker volume at /app/data/

Bug fixes from audit:
- Fix frontend referencing non-existent fields (current_month_spending, effective_budget, budget_usage_percent)
- Fix scheduler using naive datetime.now() → timezone.now()
- Fix scheduler reading interval from settings instead of GlobalConfig DB
- Fix docker-compose SQLite volume mounting as directory
- Fix CORS origin with explicit port 80
- Remove dead config (VOLC_ACCESS_KEY/SK, MONITOR_INTERVAL from settings)
- Remove unused imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:08:33 +08:00

32 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ===========================================
# AirGate 环境变量配置模板
# 复制此文件为 .env 并填入真实值
# ===========================================
# Django 基础配置
DJANGO_SECRET_KEY=change-me-to-a-random-string
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
# 数据库(本地开发不需要配置,默认用 SQLite
# USE_MYSQL=false
# DB_HOST=
# DB_PORT=3306
# DB_NAME=airgate
# DB_USER=
# DB_PASSWORD=
# 数据加密密钥(用于加密存储火山主账号 AK/SK
# 生成方式: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
AIRGATE_ENCRYPTION_KEY=
# 飞书机器人 Webhook选填也可在管理界面「系统设置」中配置
# FEISHU_WEBHOOK_URL=
# AirGate API Key供外部系统如 AirDrama 调用本系统 API 时使用)
# 不设置则 API Key 认证不生效,仅 JWT 认证可用
# AIRGATE_API_KEY=
# 注意:火山主账号 AK/SK 不要写在这里!
# 启动后在浏览器「系统设置 → 添加主账号」中填入,会加密存入数据库。