application.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. server:
  2. port: 8848
  3. spring:
  4. profiles:
  5. active: dev
  6. application:
  7. name: jetlinks-platform
  8. jackson:
  9. date-format: yyyy-MM-dd HH:mm:ss
  10. time-zone: Asia/Shanghai
  11. serialization:
  12. WRITE_DATES_AS_TIMESTAMPS: true
  13. default-property-inclusion: non_null
  14. resources:
  15. static-locations: file:./static/,/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/, classpath:/public/
  16. redis:
  17. host: 127.0.0.1
  18. port: 6379
  19. lettuce:
  20. pool:
  21. max-active: 1024
  22. timeout: 20s
  23. serializer: jdk # 设置fst时,redis key使用string序列化,value使用 fst序列化.
  24. # database: 3
  25. # max-wait: 10s
  26. r2dbc:
  27. url: r2dbc:postgresql://localhost:5432/jetlinks
  28. username: postgres
  29. password: jetlinks
  30. pool:
  31. max-size: 32
  32. reactor:
  33. debug-agent:
  34. enabled: false
  35. data:
  36. elasticsearch:
  37. client:
  38. reactive:
  39. endpoints: ${elasticsearch.client.host}:${elasticsearch.client.port}
  40. max-in-memory-size: 100MB
  41. socket-timeout: ${elasticsearch.client.socket-timeout}
  42. connection-timeout: ${elasticsearch.client.socket-timeout}
  43. easyorm:
  44. default-schema: public # 数据库默认的schema
  45. dialect: postgres #数据库方言
  46. elasticsearch:
  47. embedded:
  48. enabled: false # 为true时使用内嵌的elasticsearch,不建议在生产环境中使用
  49. data-path: ./data/elasticsearch
  50. port: 9200
  51. host: 0.0.0.0
  52. client:
  53. host: localhost
  54. port: 9200
  55. max-conn-total: 128
  56. connect-timeout: 5000
  57. socket-timeout: 5000
  58. connection-request-timeout: 8000
  59. index:
  60. default-strategy: time-by-month #默认es的索引按月进行分表, direct则为直接操作索引.
  61. settings:
  62. number-of-shards: 1 # es 分片数量
  63. number-of-replicas: 0 # 副本数量
  64. device:
  65. message:
  66. writer:
  67. time-series:
  68. enabled: true #写出设备消息数据到elasticsearch
  69. captcha:
  70. enabled: false # 开启验证码
  71. ttl: 2m #验证码过期时间,2分钟
  72. hsweb:
  73. cors:
  74. enable: true
  75. configs:
  76. - path: /**
  77. allowed-headers: "*"
  78. allowed-methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
  79. allowed-origins: ["*"]
  80. allow-credentials: true
  81. max-age: 1800
  82. dict:
  83. enum-packages: org.jetlinks
  84. file:
  85. upload:
  86. static-file-path: ./static/upload
  87. static-location: http://localhost:8848/upload
  88. webflux:
  89. response-wrapper:
  90. enabled: true #开启响应包装器(将返回值包装为ResponseMessage)
  91. excludes: # 这下包下的接口不包装
  92. - org.springdoc
  93. # auth: #默认的用户配置
  94. # users:
  95. # admin:
  96. # username: admin
  97. # password: admin
  98. # name: 超级管理员
  99. authorize:
  100. auto-parse: true
  101. permission:
  102. filter:
  103. enabled: false # 设置为true开启权限过滤,赋权时,不能赋予比自己多的权限.
  104. exclude-username: admin # admin用户不受上述限制
  105. un-auth-strategy: ignore # error表示:发生越权时,抛出403错误. ignore表示会忽略越权的赋权.
  106. cache:
  107. type: redis
  108. redis:
  109. local-cache-type: guava
  110. jetlinks:
  111. server-id: ${spring.application.name}:${server.port} #设备服务网关服务ID,不同服务请设置不同的ID
  112. logging:
  113. system:
  114. context:
  115. server: ${spring.application.name}
  116. protocol:
  117. spi:
  118. enabled: true # 为true时开启自动加载通过依赖引入的协议包
  119. logging:
  120. level:
  121. org.jetlinks: debug
  122. rule.engine: debug
  123. org.hswebframework: debug
  124. org.springframework.transaction: debug
  125. org.springframework.data.r2dbc.connectionfactory: warn
  126. io.micrometer: warn
  127. org.hswebframework.expands: error
  128. system: debug
  129. org.jetlinks.rule.engine: warn
  130. org.jetlinks.supports.event: warn
  131. org.springframework: warn
  132. org.jetlinks.community.device.message.writer: warn
  133. org.jetlinks.community.elastic.search.service: trace
  134. org.jetlinks.community.elastic.search.service.reactive: trace
  135. org.jetlinks.community.network: warn
  136. io.vertx.mqtt.impl: warn
  137. # org.springframework.data.elasticsearch.client: trace
  138. # org.elasticsearch: error
  139. org.jetlinks.pro.influx: trace
  140. org.elasticsearch: error
  141. config: classpath:logback-spring.xml
  142. vertx:
  143. max-event-loop-execute-time-unit: seconds
  144. max-event-loop-execute-time: 30
  145. max-worker-execute-time-unit: seconds
  146. max-worker-execute-time: 30
  147. prefer-native-transport: true
  148. micrometer:
  149. time-series:
  150. tags:
  151. server: ${spring.application.name}
  152. metrics:
  153. default:
  154. step: 30s
  155. management:
  156. health:
  157. elasticsearch:
  158. enabled: false # 关闭elasticsearch健康检查
  159. springdoc:
  160. swagger-ui:
  161. path: /swagger-ui.html
  162. # packages-to-scan: org.jetlinks
  163. group-configs:
  164. - group: 设备管理相关接口
  165. packages-to-scan:
  166. - org.jetlinks.community.device
  167. paths-to-exclude:
  168. - /device-instance/**
  169. - /device-product/**
  170. - /protocol/**
  171. - group: 规则引擎相关接口
  172. packages-to-scan: org.jetlinks.community.rule.engine.web
  173. paths-to-exclude: /api/**
  174. - group: 通知管理相关接口
  175. packages-to-scan: org.jetlinks.community.notify.manager.web
  176. - group: 设备接入相关接口
  177. packages-to-scan:
  178. - org.jetlinks.community.network.manager.web
  179. - org.jetlinks.community.device.web
  180. paths-to-match:
  181. - /gateway/**
  182. - /network/**
  183. - /protocol/**
  184. - group: 系统管理相关接口
  185. packages-to-scan:
  186. - org.jetlinks.community.auth
  187. - org.hswebframework.web.system.authorization.defaults.webflux
  188. - org.hswebframework.web.file
  189. - org.hswebframework.web.authorization.basic.web
  190. - org.jetlinks.community.logging.controller
  191. cache:
  192. disabled: false