kd.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. #服务器配置
  2. server:
  3. undertow:
  4. threads:
  5. # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
  6. io: 16
  7. # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
  8. worker: 400
  9. # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
  10. buffer-size: 1024
  11. # 是否分配的直接内存
  12. direct-buffers: true
  13. #spring配置
  14. spring:
  15. cloud:
  16. nacos:
  17. discovery:
  18. # 禁用云命名空间解析,防止和云平台环境变量冲突
  19. isUseCloudNamespaceParsing: false
  20. config:
  21. # 禁用云命名空间解析,防止和云平台环境变量冲突
  22. isUseCloudNamespaceParsing: false
  23. sentinel:
  24. eager: true
  25. devtools:
  26. restart:
  27. log-condition-evaluation-delta: false
  28. livereload:
  29. port: 23333
  30. #feign配置
  31. feign:
  32. sentinel:
  33. enabled: true
  34. okhttp:
  35. enabled: true
  36. httpclient:
  37. enabled: false
  38. #对外暴露端口
  39. management:
  40. endpoints:
  41. web:
  42. exposure:
  43. include: "*"
  44. endpoint:
  45. health:
  46. show-details: always
  47. #springdoc-openapi配置
  48. springdoc:
  49. default-flat-param-object: true
  50. #knife4j配置
  51. knife4j:
  52. #基础认证
  53. basic:
  54. enable: false
  55. username: blade
  56. password: blade
  57. #增强配置
  58. setting:
  59. enableSwaggerModels: true
  60. enableDocumentManage: true
  61. enableHost: false
  62. enableHostText: http://localhost
  63. enableRequestCache: true
  64. enableFilterMultipartApis: false
  65. enableFilterMultipartApiMethodType: POST
  66. language: zh_cn
  67. enableFooter: false
  68. enableFooterCustom: true
  69. footerCustomContent: Copyright © 2025 Kd All Rights Reserved
  70. #swagger公共信息
  71. swagger:
  72. title: 接口文档系统
  73. description: 接口文档系统
  74. version: 4.5.0.RELEASE
  75. license: Powered By Kd
  76. license-url: https://www.baidu.com
  77. terms-of-service-url: https://www.baidu.com
  78. contact:
  79. name: sky
  80. email: 111@qq.com
  81. url: https://www.baidu.com
  82. kd:
  83. #oauth2配置
  84. oauth2:
  85. #启用 oauth2
  86. enabled: true
  87. #使用 @org.sky.test.Sm2KeyGenerator 获取,用于国密sm2验签,需和前端保持一致
  88. public-key: ${KD_OAUTH2_PUBLIC_KEY}
  89. #使用 @org.sky.test.Sm2KeyGenerator 获取,用于国密sm2解密,前端无需配置
  90. private-key: ${KD_OAUTH2_PRIVATE_KEY}
  91. #token配置
  92. token:
  93. #是否有状态
  94. state: false
  95. #是否单用户登录
  96. single: false
  97. #单用户登录范围
  98. single-level: all
  99. #token签名 使用kd-auth服务 @org.sky.test.SignKeyGenerator 获取
  100. sign-key: ${KD_TOKEN_SIGN_KEY}
  101. #token加密 使用kd-auth服务 @org.sky.test.CryptoKeyGenerator 获取
  102. crypto-key: ${KD_TOKEN_CRYPTO_KEY}
  103. #接口配置
  104. api:
  105. #报文加密配置
  106. crypto:
  107. #启用报文加密配置
  108. enabled: false
  109. #使用kd-auth服务 @org.sky.test.CryptoKeyGenerator 获取,需和前端保持一致
  110. aes-key: ${KD_API_CRYPTO_AES_KEY}
  111. #使用kd-auth服务 @org.sky.test.CryptoKeyGenerator 获取,需和前端保持一致
  112. des-key: ${KD_API_CRYPTO_DES_KEY}
  113. #jackson配置
  114. jackson:
  115. #null自动转空值
  116. null-to-empty: true
  117. #大数字自动转字符串
  118. big-num-to-string: true
  119. #支持text文本请求,与报文加密同时开启
  120. support-text-plain: false
  121. #redis序列化方式
  122. redis:
  123. serializer-type: protostuff
  124. #日志配置
  125. log:
  126. request:
  127. #开启控制台请求日志
  128. enabled: true
  129. #控制台请求日志忽略
  130. skip-url:
  131. - /notice/list
  132. - /wechat/**
  133. #开启错误日志入库
  134. error-log: true
  135. #xss配置
  136. xss:
  137. enabled: true
  138. skip-url:
  139. - /wechat
  140. - /qq
  141. #安全框架配置
  142. secure:
  143. #严格模式
  144. #缺失令牌字段则取消授权
  145. strict-token: true
  146. #缺失请求头则取消授权
  147. strict-header: true
  148. #接口放行
  149. skip-url:
  150. - /test/**
  151. #授权认证配置
  152. auth:
  153. - method: ALL
  154. pattern: /chat/wechat/**
  155. expression: "hasAuth()"
  156. - method: ALL
  157. pattern: /chat/qq/**
  158. expression: "hasStrictToken()"
  159. - method: ALL
  160. pattern: /chat/ding/**
  161. expression: "hasStrictHeader()"
  162. - method: ALL
  163. pattern: /dashboard/notice
  164. expression: "hasMenu('notice')"
  165. - method: POST
  166. pattern: /dashboard/upload
  167. expression: "hasTimeAuth(9, 17)"
  168. - method: POST
  169. pattern: /dashboard/submit
  170. expression: "hasAnyRole('administrator', 'admin', 'user')"
  171. #基础认证配置
  172. basic:
  173. - method: ALL
  174. pattern: /dashboard/info
  175. username: "blade"
  176. password: "blade"
  177. #动态签名认证配置
  178. sign:
  179. - method: ALL
  180. pattern: /dashboard/sign
  181. crypto: "sha1"
  182. #多终端认证配置
  183. client:
  184. - client-id: sword
  185. path-patterns:
  186. - /sword/**
  187. - client-id: saber
  188. path-patterns:
  189. - /saber/**
  190. #多租户配置
  191. tenant:
  192. #多租户增强
  193. enhance: true
  194. #多租户授权保护
  195. license: false
  196. #动态数据源功能
  197. dynamic-datasource: false
  198. #动态数据源全局扫描
  199. dynamic-global: false
  200. #多租户字段名
  201. column: tenant_id
  202. #排除多租户逻辑
  203. exclude-tables:
  204. - kd_user
  205. #分库分表配置
  206. sharding:
  207. enabled: false