Refactor configuration and key management
- Removed key management configuration from .env.example and related code. - Updated Makefile to load environment variables for HOST and PORT. - Modified main.go to handle request logging with a wait group for graceful shutdown. - Simplified dashboard statistics handler to focus on key counts and request metrics. - Removed key manager implementation and related interfaces. - Updated proxy server to use atomic counters for round-robin key selection. - Cleaned up unused types and configurations in types.go. - Added package-lock.json for frontend dependencies.
This commit is contained in:
17
.env.example
17
.env.example
@@ -11,21 +11,6 @@ PORT=3000
|
||||
# 服务器主机地址
|
||||
HOST=0.0.0.0
|
||||
|
||||
# ===========================================
|
||||
# 密钥管理配置
|
||||
# ===========================================
|
||||
# 密钥文件路径
|
||||
KEYS_FILE=keys.txt
|
||||
|
||||
# 起始密钥索引
|
||||
START_INDEX=0
|
||||
|
||||
# 黑名单阈值(错误多少次后拉黑密钥)
|
||||
BLACKLIST_THRESHOLD=1
|
||||
|
||||
# 最大重试次数(换key重试)
|
||||
MAX_RETRIES=3
|
||||
|
||||
# ===========================================
|
||||
# OpenAI 兼容 API 配置
|
||||
# ===========================================
|
||||
@@ -63,7 +48,7 @@ LOG_ENABLE_REQUEST=true
|
||||
# 认证配置
|
||||
# ===========================================
|
||||
# 项目认证密钥(可选,如果设置则启用认证)
|
||||
# AUTH_KEY=your-secret-key
|
||||
AUTH_KEY=sk-123456
|
||||
|
||||
# ===========================================
|
||||
# CORS 配置
|
||||
|
Reference in New Issue
Block a user