Files
tyapi-server/configs/env.production.yaml

156 lines
4.6 KiB
YAML
Raw Normal View History

2025-07-02 16:17:59 +08:00
# 🏭 生产环境配置
# 只包含与默认配置不同的配置项
# ===========================================
# 🌍 环境标识
# ===========================================
app:
env: production
# ===========================================
# 🌐 服务器配置
# ===========================================
server:
mode: release
# ===========================================
# 🗄️ 数据库配置
# ===========================================
# 敏感信息通过外部环境变量注入
database:
2025-07-28 02:54:05 +08:00
host: "tyapi-postgres-prod"
port: "5432"
user: "tyapi_user"
password: "Pg9mX4kL8nW2rT5y"
2025-07-28 01:46:39 +08:00
name: "tyapi"
2025-07-28 02:54:05 +08:00
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
2025-07-02 16:17:59 +08:00
# ===========================================
# 📝 日志配置
# ===========================================
logger:
2025-07-28 15:03:18 +08:00
level: info
2025-07-02 16:17:59 +08:00
format: json
2025-07-28 13:47:58 +08:00
output: "file"
2025-07-28 14:09:06 +08:00
log_dir: "/app/logs"
2025-07-28 13:47:58 +08:00
max_size: 100
max_backups: 5
max_age: 30
compress: true
use_daily: true
2025-07-28 15:21:37 +08:00
# 启用按级别分文件
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"]
2025-07-02 16:17:59 +08:00
# ===========================================
# 🔐 JWT配置
# ===========================================
2025-07-28 16:03:49 +08:00
jwt:
secret: JwT8xR4mN9vP2sL7kH3oB6yC1zA5uF0qE9tW
2025-07-20 20:53:26 +08:00
# ===========================================
2025-07-28 16:03:49 +08:00
# 📊 监控配置
2025-07-20 20:53:26 +08:00
# ===========================================
2025-07-28 16:03:49 +08:00
monitoring:
metrics_enabled: false # 生产环境禁用Prometheus指标收集
metrics_port: "" # 清空metrics端口
tracing_enabled: false # 生产环境禁用链路追踪
tracing_endpoint: "" # 清空追踪端点
sample_rate: 0.0 # 采样率为0
2025-07-20 20:53:26 +08:00
# ===========================================
# 📁 存储服务配置 - 七牛云
# ===========================================
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"
2025-07-28 01:46:39 +08:00
# ===========================================
# 🌐 域名配置
# ===========================================
domain:
api: "api.tianyuancha.com" # 生产环境API域名