暂存提交
This commit is contained in:
@@ -26,7 +26,9 @@ spring:
|
|||||||
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
||||||
group: ${NACOS_GROUP:BAIYUE}
|
group: ${NACOS_GROUP:BAIYUE}
|
||||||
namespace: ${NACOS_NAMESPACE:public}
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
config.namespace: ${NACOS_NAMESPACE:public}
|
config:
|
||||||
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
|
encode: UTF-8
|
||||||
baiyue.security:
|
baiyue.security:
|
||||||
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}
|
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}
|
||||||
internal-service-token: ${INTERNAL_SERVICE_TOKEN:change-me-to-an-internal-token-at-least-32-bytes-long}
|
internal-service-token: ${INTERNAL_SERVICE_TOKEN:change-me-to-an-internal-token-at-least-32-bytes-long}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# 头程本地公共配置。生产环境不得直接使用本文件中的本地默认密钥。
|
|
||||||
baiyue:
|
baiyue:
|
||||||
deployment:
|
deployment:
|
||||||
region-code: ${REGION_CODE:CN}
|
region-code: ${REGION_CODE:CN}
|
||||||
@@ -32,6 +31,9 @@ spring:
|
|||||||
client.config.default:
|
client.config.default:
|
||||||
connect-timeout: 3000
|
connect-timeout: 3000
|
||||||
read-timeout: 5000
|
read-timeout: 5000
|
||||||
|
logging:
|
||||||
|
file:
|
||||||
|
path: ${LOG_PATH:./logs}
|
||||||
server.shutdown: graceful
|
server.shutdown: graceful
|
||||||
management:
|
management:
|
||||||
endpoints.web.exposure.include: health,info,prometheus
|
endpoints.web.exposure.include: health,info,prometheus
|
||||||
@@ -42,7 +44,6 @@ mybatis-plus:
|
|||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
call-setters-on-nulls: true
|
call-setters-on-nulls: true
|
||||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
|
||||||
global-config:
|
global-config:
|
||||||
banner: false
|
banner: false
|
||||||
db-config:
|
db-config:
|
||||||
@@ -50,17 +51,6 @@ mybatis-plus:
|
|||||||
logic-delete-field: deleted
|
logic-delete-field: deleted
|
||||||
logic-delete-value: 1
|
logic-delete-value: 1
|
||||||
logic-not-delete-value: 0
|
logic-not-delete-value: 0
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com.baiyue.auth.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.iam.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.order.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.firstleg.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.warehouse.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.file.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.print.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.audit.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
com.baiyue.eventbridge.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
||||||
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
springdoc:
|
springdoc:
|
||||||
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
||||||
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
||||||
|
baiyue:
|
||||||
|
cors:
|
||||||
|
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:5174,http://127.0.0.1:5173,http://127.0.0.1:5174}
|
||||||
|
allowed-methods: ${CORS_ALLOWED_METHODS:GET,POST,PUT,PATCH,DELETE,OPTIONS}
|
||||||
|
allowed-headers: ${CORS_ALLOWED_HEADERS:*}
|
||||||
|
exposed-headers: ${CORS_EXPOSED_HEADERS:X-Request-Id,X-Trace-Id}
|
||||||
|
allow-credentials: ${CORS_ALLOW_CREDENTIALS:true}
|
||||||
|
max-age: ${CORS_MAX_AGE:3600}
|
||||||
|
|||||||
@@ -4,5 +4,4 @@ spring.datasource:
|
|||||||
username: ${ORDER_DB_USERNAME:root}
|
username: ${ORDER_DB_USERNAME:root}
|
||||||
password: ${ORDER_DB_PASSWORD:123456}
|
password: ${ORDER_DB_PASSWORD:123456}
|
||||||
baiyue.clients:
|
baiyue.clients:
|
||||||
# 默认留空并使用 Nacos 的 warehouse-service 实例;仅独立端口回归时显式设置直连 URL。
|
|
||||||
warehouse.url: ${WAREHOUSE_SERVICE_URL:}
|
warehouse.url: ${WAREHOUSE_SERVICE_URL:}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ spring:
|
|||||||
namespace: ${NACOS_NAMESPACE:public}
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
config:
|
config:
|
||||||
namespace: ${NACOS_NAMESPACE:public}
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
|
encode: UTF-8
|
||||||
baiyue:
|
baiyue:
|
||||||
clients:
|
clients:
|
||||||
auth:
|
auth:
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ spring:
|
|||||||
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
||||||
group: ${NACOS_GROUP:BAIYUE}
|
group: ${NACOS_GROUP:BAIYUE}
|
||||||
namespace: ${NACOS_NAMESPACE:public}
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
config.namespace: ${NACOS_NAMESPACE:public}
|
config:
|
||||||
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
|
encode: UTF-8
|
||||||
management.endpoints.web.exposure.include: health,info,prometheus
|
management.endpoints.web.exposure.include: health,info,prometheus
|
||||||
|
|
||||||
baiyue:
|
baiyue:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
$env:NACOS_SERVER_ADDR = '127.0.0.1:8848'
|
$env:NACOS_SERVER_ADDR = '127.0.0.1:8848'
|
||||||
$env:NACOS_NAMESPACE = 'public'
|
$env:NACOS_NAMESPACE = 'public'
|
||||||
$env:NACOS_GROUP = 'BAIYUE'
|
$env:NACOS_GROUP = 'BAIYUE'
|
||||||
|
$env:SPRING_CLOUD_NACOS_CONFIG_ENCODE = 'UTF-8'
|
||||||
$env:REDIS_HOST = '127.0.0.1'
|
$env:REDIS_HOST = '127.0.0.1'
|
||||||
$env:REDIS_PORT = '6379'
|
$env:REDIS_PORT = '6379'
|
||||||
$env:SPRING_DATA_REDIS_HOST = '127.0.0.1'
|
$env:SPRING_DATA_REDIS_HOST = '127.0.0.1'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ $publishUrl = "http://$ServerAddr/nacos/v1/cs/configs"
|
|||||||
|
|
||||||
$health = Invoke-WebRequest -UseBasicParsing -Uri $healthUrl -TimeoutSec 5
|
$health = Invoke-WebRequest -UseBasicParsing -Uri $healthUrl -TimeoutSec 5
|
||||||
if ($health.StatusCode -ne 200 -or $health.Content.Trim() -ne 'OK') {
|
if ($health.StatusCode -ne 200 -or $health.Content.Trim() -ne 'OK') {
|
||||||
throw "Local Nacos is not ready: $healthUrl"
|
throw "Nacos not ready: $healthUrl"
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = Get-ChildItem -LiteralPath $configRoot -File -Filter '*.yml' | Sort-Object Name
|
$files = Get-ChildItem -LiteralPath $configRoot -File -Filter '*.yml' | Sort-Object Name
|
||||||
@@ -32,9 +32,13 @@ foreach ($file in $files) {
|
|||||||
$body.tenant = $Namespace
|
$body.tenant = $Namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pairs = foreach ($entry in $body.GetEnumerator()) {
|
||||||
|
[uri]::EscapeDataString([string]$entry.Key) + '=' + [uri]::EscapeDataString([string]$entry.Value)
|
||||||
|
}
|
||||||
|
$form = $pairs -join '&'
|
||||||
$result = Invoke-RestMethod -Method Post -Uri $publishUrl `
|
$result = Invoke-RestMethod -Method Post -Uri $publishUrl `
|
||||||
-ContentType 'application/x-www-form-urlencoded; charset=UTF-8' `
|
-ContentType 'application/x-www-form-urlencoded; charset=UTF-8' `
|
||||||
-Body $body -TimeoutSec 10
|
-Body $form -TimeoutSec 10
|
||||||
if ([string]$result -ne 'true') {
|
if ([string]$result -ne 'true') {
|
||||||
throw "Publish failed: $($file.Name), Nacos response: $result"
|
throw "Publish failed: $($file.Name), Nacos response: $result"
|
||||||
}
|
}
|
||||||
@@ -42,4 +46,4 @@ foreach ($file in $files) {
|
|||||||
Write-Host "Published $($file.Name) -> $Namespace / $Group"
|
Write-Host "Published $($file.Name) -> $Namespace / $Group"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Local first-leg Nacos configuration published: $published items."
|
Write-Host "Published local Nacos configuration: $published items."
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ spring:
|
|||||||
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
||||||
group: ${NACOS_GROUP:BAIYUE}
|
group: ${NACOS_GROUP:BAIYUE}
|
||||||
namespace: ${NACOS_NAMESPACE:public}
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
config.namespace: ${NACOS_NAMESPACE:public}
|
config:
|
||||||
|
namespace: ${NACOS_NAMESPACE:public}
|
||||||
|
encode: UTF-8
|
||||||
baiyue:
|
baiyue:
|
||||||
security:
|
security:
|
||||||
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}
|
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}
|
||||||
|
|||||||
Reference in New Issue
Block a user