Spring Boot 配置文件:CMSS DeepWatch Identity 应用程序

这是一个 Spring Boot 应用程序的配置文件,包含应用程序的一些配置参数,例如端口号、数据源、日志级别、安全配置等等。其中,一些比较重要的配置参数如下:

服务器配置

  • server.port: 应用程序的监听端口号,设置为 9999
  • server.servlet.context-path: 应用程序的上下文路径,设置为 /identity
  • server.compression.enabled: 是否启用压缩,设置为 true
  • server.tomcat.accesslog.enabled: 是否启用 Tomcat 访问日志,设置为 true

Spring 配置

  • spring.profiles.active: 应用程序的激活环境,设置为 dev86
  • spring.application.name: 应用程序的名称,设置为 CMSS::DeepWatch::Identity
  • spring.jmx.enabled: 是否启用 JMX,设置为 false
  • spring.datasource.url: 数据库连接 URL,连接到本地 MySQL 数据库 identity
  • spring.datasource.username: 数据库用户名,设置为 root
  • spring.datasource.password: 数据库密码,设置为 123456
  • spring.datasource.type: 数据源类型,设置为 com.zaxxer.hikari.HikariDataSource,使用 HikariCP 连接池。
  • spring.datasource.driverClassName: 数据库驱动类名,设置为 com.mysql.jdbc.Driver
  • spring.datasource.hikari.connection-timeout: 连接超时时间,设置为 30000 毫秒。
  • spring.datasource.hikari.idle-timeout: 空闲连接超时时间,设置为 60000 毫秒。
  • spring.datasource.hikari.max-lifetime: 连接最大存活时间,设置为 300000 毫秒。
  • spring.datasource.hikari.connection-test-query: 连接测试查询语句,设置为 SELECT 1
  • spring.datasource.hikari.driver-class-name: 数据库驱动类名,设置为 com.mysql.jdbc.Driver
  • spring.datasource.ext.health.enabled: 是否启用数据源健康检查,设置为 true
  • spring.datasource.ext.health.fetchMyBatisPlusTableInfo: 是否获取 MyBatis Plus 表信息,设置为 true
  • spring.redis.timeout: Redis 操作超时时间,设置为 3s
  • spring.redis.cluster.nodes: Redis 集群节点地址,设置为 100.71.8.94:7001,100.71.8.94:7000,100.71.8.95:7001,100.71.8.95:7000,100.71.8.50:7001,100.71.8.50:7000
  • spring.redis.cluster.max-redirects: Redis 集群重定向最大次数,设置为 3
  • spring.redis.cluster-ext.enabled: 是否启用 Redis 集群扩展功能,设置为 true
  • spring.redis.jedis.pool.maxIdle: Redis 连接池最大空闲连接数,设置为 128
  • spring.redis.jedis.pool.minIdle: Redis 连接池最小空闲连接数,设置为 0
  • spring.redis.jedis.pool.maxActive: Redis 连接池最大活动连接数,设置为 128
  • spring.redis.jedis.pool.maxWait: Redis 连接池最大等待时间,设置为 60000ms
  • spring.redis.database: Redis 数据库编号,设置为 0

安全配置

  • security.oauth2.client.client-id: OAuth2 客户端 ID,设置为 CLIENT
  • security.oauth2.client.client-secret: OAuth2 客户端密钥,设置为 SECRET
  • security.oauth2.client.authorized-grant-types: OAuth2 授权类型,设置为 authorization_code,refresh_token,password
  • security.oauth2.client.access-token-validity-seconds: 访问令牌有效期,设置为 18000 秒。
  • security.oauth2.resource.token-info-uri: OAuth2 令牌信息 URI,设置为 http://localhost:19999/authz/oauth/check_token

日志配置

  • logging.level.com.chinamobile.deepwatch.identity: 日志级别,设置为 debug
  • logging.level.org.springframework.security: 日志级别,设置为 trace

应用配置

  • configs.com.cmss.dw.common.operate-log.enabled: 是否启用操作日志,设置为 false
  • configs.com.cmss.dw.common.security.ignored: 安全配置忽略的路径,设置为 /mgmt/**,/kaptcha/render,/authc/login,/authc/sms/*
  • configs.com.cmss.dw.common.security.crypto.enabled: 是否启用加密,设置为 true
  • configs.com.cmss.dw.common.security.crypto.rsa.publicKey: RSA 公钥。
  • configs.com.cmss.dw.common.security.crypto.rsa.privateKey: RSA 私钥。
  • configs.com.cmss.dw.identity.kaptcha.enabled: 是否启用验证码,设置为 false
  • configs.com.cmss.dw.identity.mysql.version.enabled: 是否启用 MySQL 版本检测,设置为 true
  • configs.com.cmss.dw.identity.oauth2-aux.token-uri: OAuth2 令牌获取 URI,设置为 http://localhost:19999/authz/oauth/token
  • configs.com.cmss.dw.identity.oauth2-aux.token-revoke-uri: OAuth2 令牌撤销 URI,设置为 http://localhost:19999/authz/oauth/revoke_token
  • configs.com.cmss.dw.identity.permission.stmt.enabled: 是否启用权限语句,设置为 true
  • configs.com.cmss.dw.identity.aux.smsCodeRetry: 短信验证码重试次数,设置为 5
  • configs.com.cmss.dw.identity.aux.nxConfig.timeUnit: NX 配置时间单位,设置为 MINUTES
  • configs.com.cmss.dw.identity.aux.nxConfig.timeout: NX 配置超时时间,设置为 5

其他配置

  • debug: false: 表示该配置文件仅用于本地开发环境,不适用于生产环境。
  • spring.cloud.config.enabled=false: 表示不启用 Spring Cloud Config 服务。

该配置文件配置了 CMSS DeepWatch Identity 应用程序的各种参数,包括服务器、Spring、安全、日志和应用程序自定义配置。这些配置参数控制着应用程序的行为和功能,并根据应用程序的具体需求进行调整。

Spring Boot 配置文件:CMSS DeepWatch Identity 应用程序

原文地址: https://www.cveoy.top/t/topic/ohyR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录