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

92 lines
2.8 KiB
YAML

# Team-API Runtime Configuration
# Server
server:
address: ":18888"
serverAgent: "team-api"
dumpRouterMap: false
gracefulShutdownTimeout: 30
# Logger
logger:
level: "all"
stdout: true
ctxKeys: ["RequestId"]
# path: "./logs" # 取消注释并设置路径即可落盘,Docker 建议用 /app/logs
# file: "{Y-m-d}.log"
# rotateSize: "100MB"
# rotateExpire: "1d"
# rotateBackupLimit: 30
# rotateBackupExpire: "30d"
# rotateBackupCompress: 9
# Database (PostgreSQL)
database:
default:
type: "pgsql"
link: "pgsql:<user>:<password>@tcp(<host>:<port>)/<database>?sslmode=disable"
timezone: "Asia/Shanghai"
debug: false
dryRun: false
maxIdle: 10
maxOpen: 100
maxLifetime: "30s"
# 审计日志独立数据库(可选)
# 启用后 aud_request_logs(大模型请求审计)写入独立库,其余审核表仍在主库。
# 建表脚本见 docs/audit-db-schema.sql,需在审计库手动执行。
# audit:
# type: "pgsql"
# link: "pgsql:user:pass@tcp(host:port)/team-api-audit?sslmode=disable"
# timezone: "Asia/Shanghai"
# maxIdle: 10
# maxOpen: 50
# maxLifetime: "5m"
# Redis
redis:
default:
address: "<host>:<port>"
db: 0
# Cache (GoFrame built-in, uses Redis as adapter)
cache:
default:
adapter: "redis"
# Billing
# 钱包物化间隔(毫秒,sys_options 键 billing_wallet_materialize_interval_ms,可选):
# Redis 权威钱包状态刷回 DB bil_wallets 的周期。Redis 权威化架构下该值决定 DB 余额展示
# 的滞后上限;过小增加 DB 写频,过大展示滞后明显。默认 5000(未配置即用默认值)。
# billing_wallet_materialize_interval_ms: 5000
# 预扣孤儿清扫说明:由 cron `prededuct_sweep`(每 2 分钟)基于 Redis 预扣明细重算
# frozen_balance 自愈,不再依赖 DB 预扣追踪表(bil_prededuct_tracks 已废弃)。
# JWT Authentication
jwt:
secret: "<change-me-to-a-random-secret>"
accessTokenExpire: "12h"
refreshTokenExpire: "7d"
issuer: "team-api"
adminMaxSessions: 5
tenantMaxSessions: 10
# Crypto (AES-256 encryption key, 32 bytes hex-encoded = 64 hex chars)
crypto:
encryptionKey: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"
# Demo mode (read-only mode, configured here — not in admin UI)
# Set enabled: true to block all write operations and show a watermark
demo:
enabled: false
message: "演示环境,数据不可修改"
# System update source override
# Default: GitHub official API (https://api.github.com/repos/qianfree/team-api).
# Override to point at a self-hosted release server / local mock release (see
# scripts/mock-release.sh) or a China mirror. Leave empty to use GitHub.
update:
api_base: ""