server:
  port: 8083
  servlet:
    context-path: /
  undertow:
    max-http-post-size: -1
    buffer-size: 512
    direct-buffers: true
    threads:
      io: 8
      worker: 256

captcha:
  enable: false
  type: MATH
  category: CIRCLE
  numberLength: 1
  charLength: 4

# 用户密码配置
user:
  password:
    maxRetryCount: 5
    lockTime: 10

spring:
  application:
    name: hzhub-system
  autoconfigure:
    exclude:
      - org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration
  threads:
    virtual:
      enabled: false
  task:
    execution:
      thread-name-prefix: async-
      mode: force
  messages:
    basename: i18n/messages
  servlet:
    multipart:
      max-file-size: 10MB
      max-request-size: 20MB
  mvc:
    static-path-pattern: /static/**
    format:
      date-time: yyyy-MM-dd HH:mm:ss
  jackson:
    time-zone: Asia/Shanghai
    date-format: yyyy-MM-dd HH:mm:ss
    serialization:
      indent_output: false
      fail_on_empty_beans: false
    deserialization:
      fail_on_unknown_properties: false
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    dynamic:
      p6spy: ${DB_P6SPY:false}
      primary: master
      strict: true
      datasource:
        master:
          type: ${spring.datasource.type}
          driverClassName: com.mysql.cj.jdbc.Driver
          url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hzhub}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
          username: ${DB_USERNAME:root}
          password: ${DB_PASSWORD:hzhub123}
      hikari:
        maxPoolSize: 20
        minIdle: 10
        connectionTimeout: 30000
        validationTimeout: 5000
        idleTimeout: 600000
        maxLifetime: 1800000
        keepaliveTime: 30000

  data:
    redis:
      host: ${REDIS_HOST:localhost}
      port: ${REDIS_PORT:6379}
      database: 0
      # password: ${REDIS_PASSWORD:}  # 需要密码时取消注释
      timeout: 10s
      ssl.enabled: false

# redisson 配置
redisson:
  keyPrefix:
  threads: 4
  nettyThreads: 8
  singleServerConfig:
    clientName: hzhub-system
    connectionMinimumIdleSize: 8
    connectionPoolSize: 32
    idleConnectionTimeout: 10000
    timeout: 3000
    subscriptionConnectionPoolSize: 50

# Sa-Token 配置（与 hzhub-ai/gateway 共享 JWT secret，必须 >= 32 字节）
sa-token:
  token-name: Authorization
  is-concurrent: true
  is-share: false
  jwt-secret-key: ${JWT_SECRET:Om1fovSeKIA1oLIoHdDPMF-trbqbrPQoDS3H4u1xoRY}

# security 配置
security:
  excludes:
    - /*.html
    - /**/*.html
    - /**/*.css
    - /**/*.js
    - /favicon.ico
    - /error
    - /*/api-docs
    - /*/api-docs/**

# 多租户配置
tenant:
  enable: true
  excludes:
    - sys_menu
    - sys_tenant
    - sys_tenant_package
    - sys_tenant_company
    - sys_role_dept
    - sys_role_menu
    - sys_user_post
    - sys_user_role
    - sys_client
    - sys_oss_config
    - flow_spel
    - crm_sync_log
    - crm_sync_alert

# MyBatis-Plus 配置
mybatis-plus:
  enableLogicDelete: true
  mapperPackage: org.hzhub.**.mapper
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  typeAliasesPackage: org.hzhub.**.domain
  global-config:
    dbConfig:
      idType: ASSIGN_ID

# 数据加密
mybatis-encryptor:
  enable: false
  algorithm: BASE64
  encode: BASE64

# api接口加密
api-decrypt:
  enabled: false
  headerFlag: encrypt-key
  publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnNwrj4hi/y3CCJu868ghCG5dUj8wZK++RNlTLcXoMmdZWEQ/u02RgD5LyLAXGjLOjbMtC+/J9qofpSGTKSx/MCAwEAAQ==
  privateKey: MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=

# 接口文档
springdoc:
  api-docs:
    enabled: true
  info:
    title: 'HZHub-System系统服务_接口文档'
    description: '系统管理服务：用户/角色/权限/部门/租户/OSS/监控'
    version: '版本号: ${project.version}'
    contact:
      name: HZHub Team
      url: https://gitee.com/ageerle/hzhub
  group-configs:
    - group: 系统管理
      packages-to-scan: org.hzhub.system
    - group: 认证服务
      packages-to-scan: org.hzhub.system.controller
    - group: 工作流
      packages-to-scan: org.hzhub.workflow
    - group: 代码生成
      packages-to-scan: org.hzhub.generator

# XSS
xss:
  enabled: true
  excludeUrls:
    - /system/notice

# 分布式锁
lock4j:
  acquire-timeout: 3000
  expire: 30000

# Actuator
management:
  endpoints:
    web:
      exposure:
        include: health,prometheus,env,info
  endpoint:
    health:
      show-details: ALWAYS
  metrics:
    tags:
      application: ${spring.application.name}

# SSE 推送
sse:
  enabled: true
  path: /resource/sse

# WebSocket
websocket:
  enabled: false
  path: /resource/websocket
  allowedOrigins: '*'

# 日志
logging:
  level:
    org.hzhub: info
    org.springframework: warn
    org.mybatis.spring.mapper: error

# 上传文件地址
sys:
  upload:
    path: ${UPLOAD_PATH:/tmp/uploads}

# Spring Boot Admin 客户端配置
spring.boot.admin:
  client:
    url: ${ADMIN_URL:http://localhost:9090/admin}
    username: ${ADMIN_USER:ruoyi}
    password: ${ADMIN_PASSWORD:123456}
    instance:
      service-host-type: IP
      metadata:
        username: ${spring.boot.admin.client.username}
        userpassword: ${spring.boot.admin.client.password}

# warm-flow 工作流配置
warm-flow:
  enabled: true
  ui: true
  top-text-show: true
  node-tooltip: true
  token-name: ${sa-token.token-name},clientid

# 代码生成配置
gen:
  author: hzhub
  packageName: org.hzhub
  autoRemovePre: true
  tablePrefix: sys_

# 企业微信配置（corpid/corpsecret 等租户级配置已迁移至数据库 wecom_tenant_config 表）
wecom:
  api-base-url: https://qyapi.weixin.qq.com

# ERP服务配置
erp:
  base-url: ${ERP_BASE_URL:http://localhost:8082}
