application.properties 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # ============================================
  2. # Lingyue Starter - 单体应用统一配置
  3. # ============================================
  4. # 引入公共配置(标记为可选,避免文件不存在时启动失败)
  5. spring.config.import=optional:classpath:application-common.properties,optional:classpath:application-infra.properties
  6. # 服务端口
  7. server.port=8000
  8. server.servlet.context-path=/
  9. server.tomcat.uri-encoding=UTF-8
  10. server.tomcat.accept-count=1000
  11. server.tomcat.threads.max=800
  12. server.tomcat.threads.min-spare=10
  13. # 应用名称
  14. spring.application.name=lingyue-zhibao
  15. app.name=灵越智报
  16. app.version=2.0.0
  17. app.copyrightYear=2024
  18. # 允许 Bean 定义覆盖(单体应用可能有重复的 Bean)
  19. spring.main.allow-bean-definition-overriding=true
  20. # 文件上传配置
  21. spring.servlet.multipart.max-file-size=20MB
  22. spring.servlet.multipart.max-request-size=100MB
  23. app.uploadBaseDir=/tmp/lingyue-zhibao
  24. # 国际化配置
  25. spring.messages.basename=i18n/messages
  26. # 热部署配置
  27. spring.devtools.restart.enabled=true
  28. # MVC配置
  29. spring.mvc.pathmatch.matching-strategy=ant-path-matcher
  30. # 激活的配置文件
  31. spring.profiles.active=dev
  32. # MyBatis Plus配置(覆盖公共配置)
  33. mybatis-plus.type-aliases-package=com.lingyue.**.entity
  34. mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml
  35. # JWT配置
  36. jwt.secret=${JWT_SECRET:lingyue-zhibao-secret-key-2024-please-change-in-production}
  37. jwt.expiration=604800000
  38. jwt.refresh-expiration=2592000000
  39. # Token配置
  40. token.header=Authorization
  41. token.secret=${JWT_SECRET:lingyue-zhibao-secret-key-2024-please-change-in-production}
  42. token.expireTime=604800
  43. # 用户配置
  44. user.password.maxRetryCount=5
  45. user.password.lockTime=10
  46. # SpringDoc OpenAPI配置(如遇到问题可临时禁用)
  47. springdoc.api-docs.enabled=false
  48. springdoc.swagger-ui.enabled=false
  49. # springdoc.api-docs.path=/api-docs
  50. # springdoc.swagger-ui.path=/swagger-ui.html
  51. # WebSocket配置
  52. websocket.enabled=true
  53. websocket.path=/ws
  54. websocket.allowedOrigins=*
  55. # PaddleOCR配置
  56. paddleocr.server-url=${PADDLEOCR_SERVER_URL:http://localhost:8866}
  57. paddleocr.timeout=30000
  58. # DeepSeek API配置
  59. deepseek.api.url=https://api.deepseek.com
  60. deepseek.api.key=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  61. deepseek.api.model=deepseek-chat
  62. deepseek.api.timeout=60000
  63. # ============================================
  64. # RAG 向量化配置
  65. # ============================================
  66. # Ollama 配置
  67. ollama.url=${OLLAMA_URL:http://localhost:11434}
  68. ollama.embedding.model=${OLLAMA_EMBEDDING_MODEL:nomic-embed-text}
  69. ollama.timeout=60000
  70. # RAG 分块配置
  71. rag.chunk.size=500
  72. rag.chunk.overlap=50
  73. # RAG 检索配置
  74. rag.search.top-k=3
  75. # RAG 自动索引配置
  76. rag.auto-index.enabled=true
  77. # XSS防护配置
  78. xss.enabled=true
  79. xss.excludes=/auth/register,/auth/login
  80. xss.urlPatterns=/documents/*,/parse/*,/ai/*,/graphs/*
  81. # 日志配置(覆盖公共配置)
  82. logging.level.root=INFO
  83. logging.level.com.lingyue=INFO
  84. logging.level.org.springframework=WARN
  85. logging.level.org.springframework.web=INFO
  86. # Nacos配置(单体应用禁用服务发现)
  87. spring.cloud.nacos.discovery.enabled=false
  88. # 禁用 Feign 和 SpringDoc 自动配置(单体应用不需要)
  89. spring.cloud.openfeign.enabled=false
  90. spring.autoconfigure.exclude=\
  91. org.springframework.cloud.openfeign.FeignAutoConfiguration,\
  92. org.springdoc.core.configuration.SpringDocConfiguration,\
  93. org.springdoc.webmvc.ui.SwaggerConfig
  94. # ============================================
  95. # 数据库配置(使用标准 HikariCP)
  96. # ============================================
  97. spring.datasource.driver-class-name=org.postgresql.Driver
  98. spring.datasource.url=jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:lingyue_zhibao}
  99. spring.datasource.username=${DB_USERNAME:lingyue}
  100. spring.datasource.password=${DB_PASSWORD:123123}
  101. # HikariCP 连接池配置
  102. spring.datasource.hikari.minimum-idle=5
  103. spring.datasource.hikari.maximum-pool-size=20
  104. spring.datasource.hikari.idle-timeout=30000
  105. spring.datasource.hikari.max-lifetime=1800000
  106. spring.datasource.hikari.connection-timeout=30000
  107. # ============================================
  108. # Redis 配置
  109. # ============================================
  110. spring.data.redis.host=${REDIS_HOST:localhost}
  111. spring.data.redis.port=${REDIS_PORT:6379}
  112. spring.data.redis.password=${REDIS_PASSWORD:}
  113. # ============================================
  114. # RabbitMQ 配置
  115. # ============================================
  116. spring.rabbitmq.host=${RABBITMQ_HOST:localhost}
  117. spring.rabbitmq.port=${RABBITMQ_PORT:5672}
  118. spring.rabbitmq.username=${RABBITMQ_USERNAME:admin}
  119. spring.rabbitmq.password=${RABBITMQ_PASSWORD:admin123}