Files
BlueArchiveToolkit/deployments/.env.example
T

122 lines
3.8 KiB
Bash
Raw Permalink 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.
# BlueArchive Toolkit 环境变量配置
# 复制为 .env 并填写实际值
# ============================================================================
# 数据库配置
# ============================================================================
# 数据库类型选择:local (本地 Docker) 或 remote (远程服务器)
DB_MODE=remote
# PostgreSQL 配置
# 本地模式:使用 localhost:5432
# 远程模式:填写远程服务器的公网 IP 和端口
DB_HOST=your.remote.server.com # 远程服务器地址(或 localhost 用于本地)
DB_PORT=5432
DB_USER=bat_user
DB_PASSWORD=your_secure_password_here
DB_NAME=bluearchive_toolkit
# 数据库连接池配置
DB_MAX_CONNECTIONS=50
DB_MIN_CONNECTIONS=10
DB_CONNECTION_TIMEOUT=30 # 秒
# SSL 模式(远程连接推荐使用 require 或 verify-full
# 可选值:disable, allow, prefer, require, verify-ca, verify-full
DB_SSL_MODE=prefer
# ============================================================================
# Redis 配置
# ============================================================================
# Redis 配置
# 本地模式:使用 localhost:6379
# 远程模式:填写远程服务器的公网 IP 和端口
REDIS_HOST=your.remote.server.com # 远程服务器地址(或 localhost 用于本地)
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password_here
REDIS_DB=0
# Redis 连接池配置
REDIS_MAX_CONNECTIONS=100
REDIS_CONNECTION_TIMEOUT=5 # 秒
# ============================================================================
# API Server 配置
# ============================================================================
API_PORT=8080
API_HOST=0.0.0.0
# JWT 配置
JWT_SECRET=your_jwt_secret_key_here_change_in_production
JWT_EXPIRY=24h # Token 过期时间
# ============================================================================
# 日志配置
# ============================================================================
# 日志级别:debug, info, warn, error
LOG_LEVEL=info
# 日志格式:json 或 text
LOG_FORMAT=json
# ============================================================================
# CAS 存储配置
# ============================================================================
# CAS 存储路径(本地文件系统)
CAS_STORAGE_PATH=/var/lib/bat/cas
# CAS 垃圾回收配置
CAS_GC_ENABLED=true
CAS_GC_INTERVAL=24h # 垃圾回收间隔
# ============================================================================
# 资源同步配置
# ============================================================================
# 下载并发数
SYNC_WORKERS=4
# 重试次数
SYNC_RETRY_COUNT=3
# 限速(KB/s0 表示不限速)
SYNC_RATE_LIMIT=0
# 下载超时(秒)
SYNC_TIMEOUT=300
# ============================================================================
# 翻译服务配置
# ============================================================================
# DeepL API
DEEPL_API_KEY=your_deepl_api_key_here
DEEPL_API_URL=https://api-free.deepl.com/v2/translate
# OpenAI API
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_API_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4
# Anthropic API
ANTHROPIC_API_KEY=your_anthropic_api_key_here
ANTHROPIC_API_URL=https://api.anthropic.com
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
# ============================================================================
# 远程数据库服务器部署配置(用于在裸金属服务器上部署数据库)
# ============================================================================
# 如果你需要在远程服务器上部署数据库,使用以下配置
# 在远程服务器上运行:
# docker compose -f deployments/docker-compose.remote-db.yml up -d
REMOTE_DB_POSTGRES_USER=bat_user
REMOTE_DB_POSTGRES_PASSWORD=your_very_secure_password_here
REMOTE_DB_REDIS_PASSWORD=your_very_secure_redis_password_here