Files
team-api/manifest/docker/config.example.yaml
T

82 lines
2.6 KiB
YAML
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.
# =============================================================================
# Team-API 运行时配置(Docker Compose 部署示例)
# =============================================================================
# 使用方法:
# cp config.example.yaml config.yaml
# 然后修改下方标注 "请修改" 的配置项
#
# 注意:数据库和 Redis 的密码需要与 docker-compose.yaml 中的设置保持一致
# =============================================================================
# 服务配置
server:
address: ":18888"
openapiPath: "/api.json"
swaggerPath: "/swagger"
serverAgent: "team-api"
dumpRouterMap: false
accessLogEnabled: true
errorLogEnabled: true
gracefulShutdownTimeout: 30
# 日志配置
logger:
level: "all"
stdout: true
ctxKeys: ["RequestId"]
path: "/app/logs" # Docker 部署时写入挂载卷,留空则只输出到 stdout
file: "{Y-m-d}.log" # 按日期分文件
rotateSize: "100MB" # 单文件超 100MB 触发轮转
rotateExpire: "1d" # 每天轮转一次(取先到者)
rotateBackupLimit: 30 # 最多保留 30 个备份
rotateBackupExpire: "30d" # 备份文件超 30 天自动删除
rotateBackupCompress: 9 # 备份文件 gzip 压缩(0=不压缩,9=最大压缩)
# 数据库配置(PostgreSQL)
# 连接地址中的 postgres 是 docker-compose 中的服务名
database:
default:
type: "pgsql"
link: "pgsql:team_api:team_api_secret@tcp(postgres:5432)/team_api?sslmode=disable"
timezone: "Asia/Shanghai"
debug: false
dryRun: false
maxIdle: 10
maxOpen: 100
maxLifetime: "30s"
# Redis 配置
# 连接地址中的 redis 是 docker-compose 中的服务名
redis:
default:
address: "redis:6379"
pass: "redis_secret"
db: 0
# 缓存配置
cache:
default:
adapter: "redis"
# JWT 认证配置
jwt:
secret: "team-api-jwt-secret-key-please-change-me" # 请修改为随机强密钥
accessTokenExpire: "12h"
refreshTokenExpire: "7d"
issuer: "team-api"
adminMaxSessions: 5
tenantMaxSessions: 10
# 加密配置(AES-256 密钥,32 字节 hex 编码 = 64 个十六进制字符)
# 用于加密存储 API Key 原值、渠道密钥等敏感字段
# 生成命令:openssl rand -hex 32
crypto:
encryptionKey: "请修改:运行 openssl rand -hex 32 生成 64 位十六进制密钥" # 请修改
# 演示模式(通过配置文件控制,不在管理后台设置)
# 开启后所有写操作被拦截,仅允许只读访问,并在控制台显示水印
demo:
enabled: false
message: "演示环境,数据不可修改"