151 lines
4.3 KiB
YAML
151 lines
4.3 KiB
YAML
# 🏭 生产环境配置
|
|
# 只包含与默认配置不同的配置项
|
|
|
|
# ===========================================
|
|
# 🌍 环境标识
|
|
# ===========================================
|
|
app:
|
|
env: production
|
|
|
|
# ===========================================
|
|
# 🌐 服务器配置
|
|
# ===========================================
|
|
server:
|
|
mode: release
|
|
|
|
# ===========================================
|
|
# 🗄️ 数据库配置
|
|
# ===========================================
|
|
# 敏感信息通过外部环境变量注入
|
|
database:
|
|
host: "tyapi-postgres-prod"
|
|
port: "5432"
|
|
user: "tyapi_user"
|
|
password: "Pg9mX4kL8nW2rT5y"
|
|
name: "tyapi"
|
|
sslmode: "disable"
|
|
timezone: "Asia/Shanghai"
|
|
max_open_conns: 25
|
|
max_idle_conns: 10
|
|
conn_max_lifetime: 300s
|
|
auto_migrate: true
|
|
redis:
|
|
host: "tyapi-redis-prod"
|
|
port: "6379"
|
|
password: ""
|
|
db: 0
|
|
# ===========================================
|
|
# 📝 日志配置
|
|
# ===========================================
|
|
logger:
|
|
level: info
|
|
format: json
|
|
output: "file"
|
|
log_dir: "/app/logs"
|
|
max_size: 100
|
|
max_backups: 5
|
|
max_age: 30
|
|
compress: true
|
|
use_daily: true
|
|
# 启用按级别分文件
|
|
enable_level_separation: true
|
|
# 各级别日志文件配置
|
|
level_configs:
|
|
debug:
|
|
max_size: 50 # 50MB
|
|
max_backups: 3
|
|
max_age: 7 # 7天
|
|
compress: true
|
|
info:
|
|
max_size: 100 # 100MB
|
|
max_backups: 5
|
|
max_age: 30 # 30天
|
|
compress: true
|
|
warn:
|
|
max_size: 100 # 100MB
|
|
max_backups: 5
|
|
max_age: 30 # 30天
|
|
compress: true
|
|
error:
|
|
max_size: 200 # 200MB
|
|
max_backups: 10
|
|
max_age: 90 # 90天
|
|
compress: true
|
|
fatal:
|
|
max_size: 100 # 100MB
|
|
max_backups: 10
|
|
max_age: 365 # 1年
|
|
compress: true
|
|
panic:
|
|
max_size: 100 # 100MB
|
|
max_backups: 10
|
|
max_age: 365 # 1年
|
|
compress: true
|
|
# 生产环境全面日志配置
|
|
comprehensive_logging:
|
|
enable_request_logging: true
|
|
enable_response_logging: true
|
|
enable_request_body_logging: false # 生产环境不记录请求体(安全考虑)
|
|
enable_error_logging: true
|
|
enable_business_logging: true
|
|
enable_performance_logging: true
|
|
max_body_size: 10240 # 10KB
|
|
exclude_paths: ["/health", "/metrics", "/favicon.ico", "/swagger"]
|
|
# ===========================================
|
|
# 🔐 JWT配置
|
|
# ===========================================
|
|
# JWT_SECRET 必须通过外部环境变量注入
|
|
|
|
# ===========================================
|
|
# 🔐 JWT配置
|
|
# ===========================================
|
|
jwt:
|
|
secret: JwT8xR4mN9vP2sL7kH3oB6yC1zA5uF0qE9tW
|
|
|
|
# ===========================================
|
|
# 📁 存储服务配置 - 七牛云
|
|
# ===========================================
|
|
storage:
|
|
access_key: "AO6u6sDWi6L9TsPfr4awC7FYP85JTjt3bodZACCM"
|
|
secret_key: "2fjxweGtSAEaUdVgDkWEmN7JbBxHBQDv1cLORb9_"
|
|
bucket: "tianyuanapi"
|
|
domain: "https://file.tianyuanapi.com"
|
|
|
|
# ===========================================
|
|
# 🔍 OCR服务配置 - 百度智能云
|
|
# ===========================================
|
|
ocr:
|
|
api_key: "aMsrBNGUJxgcgqdm3SEdcumm"
|
|
secret_key: "sWlv2h2AWA3aAt5bjXCkE6WeA5AzpAAD"
|
|
|
|
# ===========================================
|
|
# 📝 e签宝服务配置
|
|
# ===========================================
|
|
esign:
|
|
app_id: "your_app_id_here"
|
|
app_secret: "your_app_secret_here"
|
|
server_url: "https://smlt.esign.cn"
|
|
template_id: "your_template_id_here"
|
|
contract:
|
|
name: "企业认证服务协议"
|
|
expire_days: 7
|
|
retry_count: 3
|
|
auth:
|
|
org_auth_modes: ["PSN_MOBILE3"]
|
|
default_auth_mode: "PSN_MOBILE3"
|
|
psn_auth_modes: ["PSN_MOBILE3", "PSN_IDCARD"]
|
|
willingness_auth_modes: ["CODE_SMS"]
|
|
sign:
|
|
auto_finish: true
|
|
sign_field_style: 1
|
|
client_type: "ALL"
|
|
notify:
|
|
types: "1"
|
|
redirect_url: "https://www.tianyuanapi.com/certification/complete"
|
|
|
|
# ===========================================
|
|
# 🌐 域名配置
|
|
# ===========================================
|
|
domain:
|
|
api: "api.tianyuancha.com" # 生产环境API域名
|