application.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. server:
  2. port: 8080
  3. servlet:
  4. context-path: /
  5. spring:
  6. application:
  7. name: ir-backend
  8. # 多应用部署时关闭依赖 JMX 的 MBean 冲突(东方通常见问题)
  9. jmx:
  10. enabled: false
  11. jackson:
  12. date-format: yyyy-MM-dd HH:mm:ss
  13. time-zone: GMT+8
  14. # 自定义:数据源配置(通过 type 切换:sqlite / mysql …)
  15. ir:
  16. datasource:
  17. type: sqlite
  18. sqlite:
  19. # 数据库文件路径,相对工作目录(也可写绝对路径)
  20. path: data/ir.db
  21. mysql:
  22. url: jdbc:mysql://localhost:3306/ir?useUnicode=true&characterEncoding=utf8&useSSL=false
  23. username: root
  24. password: root
  25. # 鉴权配置(用户注册/登录,JWT 无状态鉴权)
  26. auth:
  27. jwt:
  28. # HMAC 密钥,至少 32 字节;生产务必通过环境变量注入,勿写死
  29. secret: touyan-default-secret-please-change-in-production-256bit
  30. # Token 有效期(秒),默认 2 小时
  31. expiration-seconds: 7200
  32. header: Authorization
  33. prefix: "Bearer "
  34. # 无需登录即可访问的路径
  35. skip-paths:
  36. - /api/auth/login
  37. - /api/auth/register
  38. - /api/datasource/info
  39. logging:
  40. level:
  41. com.nylc.touyan: info