refactor(config): 重构配置文件并添加环境变量支持
- 在 application-test.properties 文件中,将所有配置项前添加 "#" 注释符,暂时禁用这些配置
- 在 bootstrap.properties 文件中:
- 添加 profiles_active 环境变量,用于动态设置 Spring Profile - 更新 nacos server-addr配置,使用环境变量 ${nacos_server_addr},默认值为 81.70.164.178:8848
- 优化 nacos 配置相关设置,引入 namespace 概念
- 添加 nacos discovery 相关配置
- 更新 spring-boot-actuator 相关配置的注释
- 修改允许 bean 定义覆盖的配置项注释
This commit is contained in:
@@ -1,68 +1,68 @@
|
||||
########################## 统一变量配置 ##########################
|
||||
##### 数据库配置
|
||||
zlt.datasource.ip=127.0.0.1
|
||||
zlt.datasource.username=root
|
||||
zlt.datasource.password=root
|
||||
|
||||
##### redis配置
|
||||
spring.data.redis.host=192.168.2.20
|
||||
spring.data.redis.port=6379
|
||||
spring.data.redis.password=ikingtec123456
|
||||
spring.data.redis.database=8
|
||||
spring.data.redis.timeout=5000
|
||||
|
||||
|
||||
|
||||
##### elasticsearch配置
|
||||
zlt.elasticsearch.uris=119.45.169.13:9200
|
||||
zlt.elasticsearch.username=elastic
|
||||
zlt.elasticsearch.password=iot123456@
|
||||
|
||||
##### sentinel配置
|
||||
zlt.sentinel.dashboard=192.168.28.130:6999
|
||||
|
||||
##### fastDFS配置
|
||||
zlt.fdfs.web-url=192.168.28.130
|
||||
zlt.fdfs.trackerList=${zlt.fdfs.web-url}:22122
|
||||
|
||||
##### s3配置
|
||||
zlt.s3.access-key=33RdDbIlEFK0z9IJHSqx
|
||||
zlt.s3.accessKeySecret=mmfSh4gjJm8dck0KaG6fKItpIM3tenWVHS4Ygjlm
|
||||
zlt.s3.endpoint=http://81.70.164.178:9000
|
||||
zlt.s3.bucketName=gofly
|
||||
|
||||
zlt.oss.secretId=LTAI5tSNV1RvexXpMMCZhxSe
|
||||
zlt.oss.secretKey=XocJRWU8emwjjvYLTrc04l91VZMkQK
|
||||
zlt.oss.endpoint=https://oss-cn-beijing.aliyuncs.com
|
||||
zlt.oss.bucketName=goflyapp
|
||||
|
||||
#### cos配置
|
||||
zlt.cos.secretId=AKIDkMn6B3h7KJ5dIkyzpRr7C6mFUqFWbu1u
|
||||
zlt.cos.secretKey=jDThssfEZieS4S8bqsgIiAUdbXVVYgdQ
|
||||
zlt.cos.endpoint=gofly-1333114031.cos.ap-nanjing.myqcloud.com
|
||||
zlt.cos.bucketName=gofly-1333114031
|
||||
zlt.cos.region=ap-nanjing
|
||||
|
||||
##### 日志链路追踪
|
||||
zlt.trace.enable=true
|
||||
|
||||
zlt.security.tencent.appId=wx30a3c8de94a85584
|
||||
zlt.security.tencent.appSecret=e64d6e3dcfe88d0daee50e77f5a2ee69
|
||||
zlt.security.tencent.token=YPbzETU8oe3XguGgwtA4g1DqlFKvw7pT
|
||||
zlt.security.tencent.encodingAESKey=YPbzETU8oe3XguGgwtA4g1DqlFKvw7pTZiyHTxCiQxh
|
||||
zlt.security.tencent.templateId=YOUR_TEMPLATE_ID
|
||||
zlt.security.tencent.jscode2sessionUrl=https://api.weixin.qq.com/sns/jscode2session
|
||||
zlt.security.tencent.accessTokenUrl=https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${zlt.security.tencent.appId}&secret=${zlt.security.tencent.appSecret}
|
||||
|
||||
# 微信支付商户号
|
||||
zlt.wxpay.merchantId=1703796518
|
||||
# 商户证书序列号
|
||||
zlt.wxpay.merchantSerialNumber=11F4AC03C50EB582D3EDE082591D1F9A65388D51
|
||||
# 微信支付申请的应用ID
|
||||
zlt.wxpay.appId=wx30a3c8de94a85584
|
||||
# 微信支付异步通知地址(需外网可访问且与微信支付平台配置一致)
|
||||
zlt.wxpay.notifyUrl=http://your_domain/weixin/pay/notify
|
||||
# 商户API私钥路径
|
||||
zlt.wxpay.privateKeyPath=D:\\wx\\WXCertUtil\\cert\\1703796518_20250114_cert\\apiclient_key.pem
|
||||
# 商户APIV3密钥
|
||||
zlt.wxpay.apiV3Key=aIt5Vw3cYXSCSd4L5h14kIyDsoXBow7r
|
||||
########################### 统一变量配置 ##########################
|
||||
###### 数据库配置
|
||||
#zlt.datasource.ip=127.0.0.1
|
||||
#zlt.datasource.username=root
|
||||
#zlt.datasource.password=root
|
||||
#
|
||||
###### redis配置
|
||||
#spring.data.redis.host=192.168.2.20
|
||||
#spring.data.redis.port=6379
|
||||
#spring.data.redis.password=ikingtec123456
|
||||
#spring.data.redis.database=8
|
||||
#spring.data.redis.timeout=5000
|
||||
#
|
||||
#
|
||||
#
|
||||
###### elasticsearch配置
|
||||
#zlt.elasticsearch.uris=119.45.169.13:9200
|
||||
#zlt.elasticsearch.username=elastic
|
||||
#zlt.elasticsearch.password=iot123456@
|
||||
#
|
||||
###### sentinel配置
|
||||
#zlt.sentinel.dashboard=192.168.28.130:6999
|
||||
#
|
||||
###### fastDFS配置
|
||||
#zlt.fdfs.web-url=192.168.28.130
|
||||
#zlt.fdfs.trackerList=${zlt.fdfs.web-url}:22122
|
||||
#
|
||||
###### s3配置
|
||||
#zlt.s3.access-key=33RdDbIlEFK0z9IJHSqx
|
||||
#zlt.s3.accessKeySecret=mmfSh4gjJm8dck0KaG6fKItpIM3tenWVHS4Ygjlm
|
||||
#zlt.s3.endpoint=http://81.70.164.178:9000
|
||||
#zlt.s3.bucketName=gofly
|
||||
#
|
||||
#zlt.oss.secretId=LTAI5tSNV1RvexXpMMCZhxSe
|
||||
#zlt.oss.secretKey=XocJRWU8emwjjvYLTrc04l91VZMkQK
|
||||
#zlt.oss.endpoint=https://oss-cn-beijing.aliyuncs.com
|
||||
#zlt.oss.bucketName=goflyapp
|
||||
#
|
||||
##### cos配置
|
||||
#zlt.cos.secretId=AKIDkMn6B3h7KJ5dIkyzpRr7C6mFUqFWbu1u
|
||||
#zlt.cos.secretKey=jDThssfEZieS4S8bqsgIiAUdbXVVYgdQ
|
||||
#zlt.cos.endpoint=gofly-1333114031.cos.ap-nanjing.myqcloud.com
|
||||
#zlt.cos.bucketName=gofly-1333114031
|
||||
#zlt.cos.region=ap-nanjing
|
||||
#
|
||||
###### 日志链路追踪
|
||||
#zlt.trace.enable=true
|
||||
#
|
||||
#zlt.security.tencent.appId=wx30a3c8de94a85584
|
||||
#zlt.security.tencent.appSecret=e64d6e3dcfe88d0daee50e77f5a2ee69
|
||||
#zlt.security.tencent.token=YPbzETU8oe3XguGgwtA4g1DqlFKvw7pT
|
||||
#zlt.security.tencent.encodingAESKey=YPbzETU8oe3XguGgwtA4g1DqlFKvw7pTZiyHTxCiQxh
|
||||
#zlt.security.tencent.templateId=YOUR_TEMPLATE_ID
|
||||
#zlt.security.tencent.jscode2sessionUrl=https://api.weixin.qq.com/sns/jscode2session
|
||||
#zlt.security.tencent.accessTokenUrl=https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${zlt.security.tencent.appId}&secret=${zlt.security.tencent.appSecret}
|
||||
#
|
||||
## 微信支付商户号
|
||||
#zlt.wxpay.merchantId=1703796518
|
||||
## 商户证书序列号
|
||||
#zlt.wxpay.merchantSerialNumber=11F4AC03C50EB582D3EDE082591D1F9A65388D51
|
||||
## 微信支付申请的应用ID
|
||||
#zlt.wxpay.appId=wx30a3c8de94a85584
|
||||
## 微信支付异步通知地址(需外网可访问且与微信支付平台配置一致)
|
||||
#zlt.wxpay.notifyUrl=http://your_domain/weixin/pay/notify
|
||||
## 商户API私钥路径
|
||||
#zlt.wxpay.privateKeyPath=D:\\wx\\WXCertUtil\\cert\\1703796518_20250114_cert\\apiclient_key.pem
|
||||
## 商户APIV3密钥
|
||||
#zlt.wxpay.apiV3Key=aIt5Vw3cYXSCSd4L5h14kIyDsoXBow7r
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
########################## bootstrap级别通用配置 ##########################
|
||||
# 默认开发环境
|
||||
spring.profiles.active=dev
|
||||
########################## bootstrap?????? ##########################
|
||||
# ??????
|
||||
spring.profiles.active=${profiles_active:dev}
|
||||
|
||||
##### nacos(注册中心和配置中心)地址
|
||||
##### nacos(?????????)??
|
||||
#spring.cloud.nacos.server-addr=81.70.164.178:8848
|
||||
spring.cloud.nacos.server-addr=127.0.0.1:8848
|
||||
spring.cloud.nacos.server-addr=${nacos_server_addr:81.70.164.178:8848}
|
||||
spring.cloud.nacos.username=nacos
|
||||
spring.cloud.nacos.password=nacos
|
||||
#spring.cloud.nacos.password=nacosGFLY
|
||||
spring.cloud.nacos.password=nacosGFLY
|
||||
|
||||
##### nacos??
|
||||
spring.cloud.nacos.config.server-addr=${spring.cloud.nacos.server-addr}
|
||||
spring.cloud.nacos.config.file-extension=yml
|
||||
spring.cloud.nacos.config.namespace=${nacos_config_namespace:application}
|
||||
spring.cloud.nacos.config.shared-configs[0].data-id=common.yml
|
||||
spring.cloud.nacos.config.shared-configs[0].group=GLOBALE_GROUP
|
||||
spring.cloud.nacos.config.shared-configs[0].refresh=true
|
||||
|
||||
spring.cloud.nacos.config.server-addr=${spring.cloud.nacos.server-addr}
|
||||
spring.cloud.nacos.config.namespace=application
|
||||
##### nacos????
|
||||
spring.cloud.nacos.discovery.server-addr=${spring.cloud.nacos.server-addr}
|
||||
spring.cloud.nacos.discovery.namespace=${spring.cloud.nacos.config.namespace}
|
||||
|
||||
##### spring-boot-actuator配置
|
||||
##### spring-boot-actuator??
|
||||
management.endpoints.web.exposure.include=*
|
||||
management.endpoint.health.show-details=always
|
||||
|
||||
##### 允许bean覆盖
|
||||
##### ??bean??
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
|
||||
Reference in New Issue
Block a user