application.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. server:
  2. # undertow 配置
  3. undertow:
  4. # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
  5. max-http-post-size: -1
  6. # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
  7. # 每块buffer的空间大小,越小的空间被利用越充分
  8. buffer-size: 512
  9. # 是否分配的直接内存
  10. direct-buffers: true
  11. threads:
  12. # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
  13. io: 8
  14. # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
  15. worker: 256
  16. dubbo:
  17. application:
  18. logger: slf4j
  19. protocol:
  20. # 使用dubbo协议通信
  21. name: dubbo
  22. # dubbo 协议端口(-1表示自增端口,从20880开始)
  23. port: -1
  24. # 挂载到 Spring Cloud 注册中心
  25. registry:
  26. address: nacos://${spring.cloud.nacos.server-addr}
  27. group: DUBBO_GROUP
  28. consumer:
  29. check: false
  30. scan:
  31. base-packages: com.ruoyi
  32. cloud:
  33. # 规避警告 无其他作用 后续升级3.X删除
  34. subscribed-services: ${dubbo.application.name}
  35. spring:
  36. main:
  37. allow-bean-definition-overriding: true
  38. #jackson配置
  39. jackson:
  40. # 日期格式化
  41. date-format: yyyy-MM-dd HH:mm:ss
  42. serialization:
  43. # 格式化输出
  44. indent_output: false
  45. # 忽略无法转换的对象
  46. fail_on_empty_beans: false
  47. deserialization:
  48. # 允许对象忽略json中不存在的属性
  49. fail_on_unknown_properties: false
  50. cloud:
  51. # 网关配置
  52. gateway:
  53. discovery:
  54. locator:
  55. lowerCaseServiceId: true
  56. enabled: true
  57. routes:
  58. # 认证中心
  59. - id: ruoyi-auth
  60. uri: lb://ruoyi-auth
  61. predicates:
  62. - Path=/auth/**
  63. filters:
  64. # 验证码处理
  65. - CacheRequestFilter
  66. - ValidateCodeFilter
  67. - StripPrefix=1
  68. # 代码生成
  69. - id: ruoyi-gen
  70. uri: lb://ruoyi-gen
  71. predicates:
  72. - Path=/code/**
  73. filters:
  74. - StripPrefix=1
  75. # 定时任务
  76. - id: ruoyi-job
  77. uri: lb://ruoyi-job
  78. predicates:
  79. - Path=/schedule/**
  80. filters:
  81. - StripPrefix=1
  82. # 系统模块
  83. - id: ruoyi-system
  84. uri: lb://ruoyi-system
  85. predicates:
  86. - Path=/system/**
  87. filters:
  88. - StripPrefix=1
  89. # 文件服务
  90. - id: ruoyi-file
  91. uri: lb://ruoyi-file
  92. predicates:
  93. - Path=/file/**
  94. filters:
  95. - StripPrefix=1
  96. # 安全配置
  97. security:
  98. # 验证码
  99. captcha:
  100. # 是否开启验证码
  101. enabled: true
  102. # 验证码类型 math 数组计算 char 字符验证
  103. type: MATH
  104. # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
  105. category: CIRCLE
  106. # 数字验证码位数
  107. numberLength: 1
  108. # 字符验证码长度
  109. charLength: 4
  110. # 防止XSS攻击
  111. xss:
  112. enabled: true
  113. excludeUrls:
  114. - /system/notice
  115. # 不校验白名单
  116. ignore:
  117. whites:
  118. - /auth/logout
  119. - /auth/login
  120. - /auth/register
  121. - /*/v2/api-docs
  122. - /csrf
  123. # feign 配置
  124. feign:
  125. sentinel:
  126. enabled: true
  127. okhttp:
  128. enabled: true
  129. httpclient:
  130. enabled: false
  131. client:
  132. config:
  133. default:
  134. connectTimeout: 10000
  135. readTimeout: 10000
  136. compression:
  137. request:
  138. enabled: true
  139. response:
  140. enabled: true
  141. # 暴露监控端点
  142. management:
  143. endpoints:
  144. web:
  145. exposure:
  146. include: '*'
  147. endpoint:
  148. logfile:
  149. external-file: ./logs/${spring.application.name}/console.log
  150. # 日志配置
  151. logging:
  152. level:
  153. org.springframework: warn
  154. org.apache.dubbo: warn
  155. com.alibaba.nacos: warn
  156. config: classpath:logback.xml
  157. # redisson 缓存配置
  158. redisson:
  159. cacheGroup:
  160. # 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
  161. - groupId: redissonCacheMap
  162. # 组过期时间(脚本监控)
  163. ttl: 60000
  164. # 组最大空闲时间(脚本监控)
  165. maxIdleTime: 60000
  166. # 组最大长度
  167. maxSize: 0
  168. # 分布式锁 lock4j 全局配置
  169. lock4j:
  170. # 获取分布式锁超时时间,默认为 3000 毫秒
  171. acquire-timeout: 3000
  172. # 分布式锁的超时时间,默认为 30 毫秒
  173. expire: 30000
  174. # mybatis配置
  175. mybatis:
  176. # 搜索指定包别名
  177. typeAliasesPackage: com.ruoyi.**.domain
  178. # 配置mapper的扫描,找到所有的mapper.xml映射文件
  179. mapperLocations: classpath:mapper/**/*.xml
  180. # swagger配置
  181. swagger:
  182. license: Powered By ruoyi
  183. licenseUrl: https://ruoyi.vip