# Next_Edu 环境变量示例
# 复制此文件为 .env.local 并填写实际值

# ===== 基础配置 =====
DATABASE_URL="mysql://user:password@localhost:3306/next_edu"
NODE_ENV="development"
NEXTAUTH_SECRET="your-nextauth-secret"
NEXTAUTH_URL="http://localhost:8015"
NEXT_PUBLIC_APP_URL="http://localhost:8015"

# ===== AI 配置(可选) =====
AI_API_KEY=""
AI_BASE_URL=""
AI_MODEL=""

# ===== 灾备配置 =====
# 异地备份后端类型: s3|oss|nfs|none
BACKUP_OFFSITE_BACKEND=none
# 远程存储路径
# - s3:  s3://bucket-name/backups/
# - oss: oss://bucket-name/backups/
# - nfs: /mnt/nfs/backups/
BACKUP_OFFSITE_REMOTE=
# 存储桶名称(仅 s3/oss)
BACKUP_OFFSITE_BUCKET=
# 访问密钥
BACKUP_OFFSITE_ACCESS_KEY=
# 秘密密钥
BACKUP_OFFSITE_SECRET_KEY=
# 区域(默认 us-east-1)
BACKUP_OFFSITE_REGION=us-east-1
# 远程备份保留天数(默认 90)
BACKUP_OFFSITE_RETENTION_DAYS=90

# ===== 灾备演练配置 =====
# 演练测试数据库名(默认 next_edu_dr_drill)
DR_DRILL_TEST_DB=next_edu_dr_drill
# 演练报告目录(默认 docs/dr/reports)
DR_DRILL_REPORT_DIR=docs/dr/reports

# ===== 健康检查配置 =====
# 应用健康检查 URL(默认 http://localhost:8015)
HEALTH_CHECK_URL=http://localhost:8015
# 磁盘空间阈值百分比(默认 90)
HEALTH_CHECK_DISK_THRESHOLD=90
# 备份最大年龄(小时,默认 24)
HEALTH_CHECK_BACKUP_MAX_AGE=24

# ===== 故障切换配置 =====
# 备库连接 URL(故障切换时使用)
DATABASE_URL_STANDBY=
# 应用容器名(默认 nextjs-app)
FAILOVER_APP_NAME=nextjs-app
# 应用 URL(默认 http://localhost:8015)
FAILOVER_APP_URL=http://localhost:8015
# 配置文件路径(默认 .env.local)
FAILOVER_CONFIG_FILE=.env.local
# 切换日志路径(默认 docs/dr/logs/failover.log)
FAILOVER_LOG_FILE=docs/dr/logs/failover.log

# ===== 备份配置 =====
# 备份目录(默认 ./backups)
BACKUP_DIR=./backups
# 本地备份保留天数(默认 30)
RETENTION_DAYS=30
# 备份校验最小文件大小(字节,默认 1024)
BACKUP_VERIFY_MIN_SIZE=1024
