myapps:
  siteid: 
server:
  port: 9090
  tomcat:
    uri-encoding: UTF-8
    basedir: /data/obpm-demo/uploads/tmps
  servlet:
    session:
      timeout: 3600
    encoding:
      force: true
      charset: UTF-8
      enabled: true
  http:
    encoding:
      force: true
      charset: UTF-8
      enabled: true
    multipart:
      location: /data/obpm-demo/uploads/tmps

spring:
  boot:
    admin:
      client:
        url: http://localhost:8089
  servlet:
    multipart:
      maxFileSize: 10Mb
      max-request-size: 100MB
  application:
    name: obpm-gateway
  cloud:
    consul:
      discovery:
        instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${random.uuid}
        prefer-ip-address: true
        health-check-path: /actuator/health
        health-check-interval: 10s
        hostname: ${spring.application.name}
        service-name: ${spring.application.name}
        enabled: true
      host: 127.0.0.1
      port: 8500
    gateway:
      routes:
        - id: obpm-signon
          uri: lb://obpm-signon
          predicates:
            - Path=${myapps.siteid}/signon/**
        - id: obpm-runtime-rewrite
          uri: lb://saas-common-apis
          order: 1
          predicates:
            - Path=${myapps.siteid}/obpm/api/runtime/getResource.do
            - Query=path
          filters:
            - RewriteResourcePath=${myapps.siteid}/obpm/{query_path}
        - id: obpm-runtime-rewrite-sync
          uri: lb://saas-common-apis
          order: 3
          predicates:
            - Path=${myapps.siteid}/obpm/v2/sync/file/download
            - Query=f,^http.*
          filters:
            - CustomRedirectTo=302, {f}
        - id: obpm-runtime-v2-task
          uri: lb://obpm-runtime
          order: 5
          predicates:
            - Path=${myapps.siteid}/obpm/api/v2/runtime/definitions/**
          filters:
            - name: RequestRateLimiter
              args:
                key-resolver: "#{@customPrincipalNameKeyResolver}"
                #https://blog.csdn.net/lizz861109/article/details/108980677 没分钟10次, redis实现有问题, 因此先采用自定义的方式
                #https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/
                rate-limiter: "#{@myRateLimiter}"
        - id: obpm-runtime
          uri: lb://obpm-runtime
          order: 6
          predicates:
            - Path=${myapps.siteid}/obpm/**
        - id: obpm-kms
          uri: lb://obpm-kms
          predicates:
            - Path=${myapps.siteid}/kms/**
        - id: obpm-admin
          uri: lb://obpm-admin
          predicates:
            - Path=${myapps.siteid}/admin/**
        - id: obpm-message
          uri: lb://obpm-message
          predicates:
            - Path=${myapps.siteid}/message/**
        - id: bcxin-api
          uri: lb://bcxin-api
          predicates:
            - Path=${myapps.siteid}/extend/**
        - id: obpm-designer
          uri: lb://obpm-designer
          order: 6
          predicates:
            - Path=${myapps.siteid}/designer/**
      filter:
        request-rate-limiter:
          deny-empty-key: false
      globalcors:
        cors-configurations:
          '[/**]':
            allowedOrigins: "*"
            allowedHeaders: "*"
            allowedMethods: "*"
      httpclient:
        connect-timeout: 360000
        response-timeout: 360s
    loadbalancer:
      configurations: request-based-sticky-session
      sticky-session:
        addServiceInstanceCookie: true
  redis:
    host: 49.4.21.141
    port: 6328
    password: redis20240628
    lettuce: # redis连接池配置
      pool:
        max-active: -1 #连接池最大连接数(使用负值表示没有限制) 默认为30
        max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) 默认为-1
        max-idle: 8 # 连接池中的最大空闲连接 默认为8
        min-idle: 0 # 连接池中的最小空闲连接 默认为 0

logging:
  root: debug
  level:
    org.springframework.security: DEBUG
ribbon:
  ReadTimeout: 20000
  ConnectTimeout: 20000
management:
  endpoints:
    web:
      exposure:
        include: '*'
  endpoint:
    health:
      show-details: ALWAYS