增加Dev环境Nacos配置发布流程

This commit is contained in:
2026-08-26 15:35:52 +08:00
parent 24018c42f2
commit 63d133d7c9
14 changed files with 776 additions and 3 deletions
+3 -2
View File
@@ -4,9 +4,9 @@ import { join, relative, sep } from 'node:path';
const repositoryRoot = process.cwd();
const target = requiredNacosTarget('NACOS_ENVIRONMENT');
const configRoot = join(repositoryRoot, 'nacos', 'namespaces', 'prod');
const group = 'DEFAULT_GROUP';
const configFiles = await collectYamlFiles(target.environment === 'sit' ? join(repositoryRoot, 'nacos', 'namespaces', 'sit') : configRoot);
const configRoot = join(repositoryRoot, 'nacos', 'namespaces', target.environment);
const configFiles = await collectYamlFiles(configRoot);
if (configFiles.length === 0) {
throw new Error(`nacos/namespaces/${target.environment} 下没有可发布的 YAML 配置`);
@@ -53,6 +53,7 @@ function normalizeNacosBaseUrl(value) {
function requiredNacosTarget(name) {
const value = requiredEnvironment(name);
const destinations = {
dev: [{ name: 'dev', environment: 'dev', prefix: 'NACOS_DEV', verificationNodeCount: 1 }],
sit: [{ name: 'sit', environment: 'sit', prefix: 'NACOS_SIT', verificationNodeCount: 1 }],
'prod-center1': [{ name: 'prod-center1', environment: 'prod', prefix: 'NACOS_PROD', verificationNodeCount: 2 }],
'prod-center2': [{ name: 'prod-center2', environment: 'prod', prefix: 'NACOS_DR', verificationNodeCount: 1 }],
+4
View File
@@ -8,6 +8,7 @@ on:
required: true
type: choice
options:
- dev
- sit
- prod-center1
- prod-center2
@@ -37,4 +38,7 @@ jobs:
NACOS_SIT_URLS: ${{ secrets.NACOS_SIT_URLS }}
NACOS_SIT_USERNAME: ${{ secrets.NACOS_SIT_USERNAME }}
NACOS_SIT_PASSWORD: ${{ secrets.NACOS_SIT_PASSWORD }}
NACOS_DEV_URLS: ${{ secrets.NACOS_DEV_URLS }}
NACOS_DEV_USERNAME: ${{ secrets.NACOS_DEV_USERNAME }}
NACOS_DEV_PASSWORD: ${{ secrets.NACOS_DEV_PASSWORD }}
run: node .gitea/scripts/publish-nacos.mjs
@@ -0,0 +1,42 @@
# 开发环境 Nacos 配置发布说明
更新时间:2026-08-26
## 配置目录与命名空间
开发配置位于 `nacos/namespaces/dev/`,包含两个 namespace:
- `jayucloud-artlist`:设计师端
- `jayucloud-salon`:店务端
每个 namespace 的 `DEFAULT_GROUP` 下固定发布 `core.yaml`、`gateway.yaml`、`infra.yaml`、`secret.yaml` 和 `logging.yaml` 五个 Data ID。
## Dev 中间件
| 中间件 | 地址 |
| --- | --- |
| Nacos | `192.168.5.15:8848` |
| MySQL | `192.168.5.15:3306` |
| Redis | `192.168.5.15:6379` |
| RabbitMQ | `192.168.5.15:5672` |
| MinIO | `http://192.168.5.15:9000` |
设计师端使用数据库 `jayucloud_artlist`,店务端使用数据库 `jayucloud_salon`。MinIO、七牛云和阿里云 OSS 的默认 Bucket 均为 `jayucloud-dev`;访问密钥、密码和其他敏感参数只通过部署环境注入。
## Gitea Secrets
工作流需要配置以下 Dev Secrets:
- `NACOS_DEV_URLS`:`http://192.168.5.15:8848/nacos`
- `NACOS_DEV_USERNAME`:Dev Nacos 发布账号
- `NACOS_DEV_PASSWORD`:Dev Nacos 发布账号密码
账号密码不得写入仓库、YAML、工作流日志或说明文档。
## 发布与校验
在 Gitea Actions 手工运行 `.gitea/workflows/publish-nacos.yml`,将 `environment` 选择为 `dev`。脚本只读取 `nacos/namespaces/dev/`,写入第一个 Dev Nacos 地址,并从该单节点回读每个 Data ID,按 SHA-256 摘要校验内容一致后才标记成功。
发布日志只显示环境、namespace、group 和 dataId,不输出配置正文、密码或 token。未配置 `NACOS_DEV_*` 时,脚本会在发起网络请求前明确失败。
本说明只覆盖 Dev 配置准备与发布流程,不执行生产 Nacos 发布。
@@ -29,13 +29,14 @@ Core 和 Gateway 必须显式设置 `NACOS_SERVER_ADDR`、`NACOS_NAMESPACE`、`N
## Gitea Actions 发布
工作流 `.gitea/workflows/publish-nacos.yml` 必须手工选择发布目标:`sit`、`prod-center1`、`prod-center2` 或 `prod-both`。脚本只读取所选环境目录;`prod-both` 先发布并校验中心1,再发布并校验中心2。
工作流 `.gitea/workflows/publish-nacos.yml` 必须手工选择发布目标:`dev`、`sit`、`prod-center1`、`prod-center2` 或 `prod-both`。脚本只读取所选环境目录;`dev` 使用单节点回读校验,`prod-both` 先发布并校验中心1,再发布并校验中心2。
Gitea 仓库 Secrets 必须配置:
- `NACOS_PROD_URLS`、`NACOS_PROD_USERNAME`、`NACOS_PROD_PASSWORD`
- `NACOS_DR_URLS`、`NACOS_DR_USERNAME`、`NACOS_DR_PASSWORD`
- `NACOS_SIT_URLS`、`NACOS_SIT_USERNAME`、`NACOS_SIT_PASSWORD`
- `NACOS_DEV_URLS`、`NACOS_DEV_USERNAME`、`NACOS_DEV_PASSWORD`
SIT 使用一个 Nacos 地址并在该节点回读校验;中心1至少提供两个地址并在两个节点回读校验;中心2提供一个灾备地址并单节点回读校验。Secrets 不得出现在 YAML、Git 提交、工作流日志或说明文档中。
@@ -0,0 +1,138 @@
spring:
datasource:
url: jdbc:mysql://192.168.5.15:3306/jayucloud_artlist?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
jackson:
time-zone: Asia/Shanghai
date-format: yyyy-MM-dd HH:mm:ss
logging:
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
server:
servlet:
encoding:
charset: UTF-8
force: true
enabled: true
timezone: Asia/Shanghai
mybatis:
configuration:
map-underscore-to-camel-case: true
fingertip-designer:
brand:
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Artlist}
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
security:
jwt:
issuer: jayucloud-artlist
access-token-expiration-seconds: 7200
remember-me-access-token-expiration-seconds: 604800
refresh-token-expiration-seconds: 604800
clock-skew-seconds: 30
signature:
enabled: true
window-seconds: 300
nonce-retention-seconds: 600
rate-limit:
login:
limit: 10
window-seconds: 60
send-code:
limit: 5
window-seconds: 60
reset-password:
limit: 5
window-seconds: 600
authenticated-write:
limit: 80
window-seconds: 60
order-create:
limit: 10
window-seconds: 60
cache:
local-max-size: 2048
product-detail:
local-ttl-seconds: 120
redis-ttl-seconds: 900
product-list:
local-ttl-seconds: 60
redis-ttl-seconds: 300
product-search:
local-ttl-seconds: 60
redis-ttl-seconds: 300
shop:
local-ttl-seconds: 180
redis-ttl-seconds: 900
tag:
local-ttl-seconds: 300
redis-ttl-seconds: 1200
object-storage-file:
local-ttl-seconds: 300
redis-ttl-seconds: 1800
dashboard:
local-ttl-seconds: 30
redis-ttl-seconds: 90
slow-request:
enabled: true
threshold-ms: 300
log-response-header-request-id: true
http-client:
connect-timeout-ms: 3000
read-timeout-ms: 5000
connection-request-timeout-ms: 1000
max-total-connections: 200
max-connections-per-route: 50
object-storage:
provider-order:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
replica-required-providers:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
primary-provider: MINIO
backup-provider: QINIU_KODO,ALIYUN_OSS
signed-url-expire-minutes: 60
backup-queue-name: jayucloud-artlist.file.object-storage.backup.queue
backup-exchange-name: jayucloud-artlist.file.object-storage.backup.exchange
backup-routing-key: jayucloud-artlist.file.object-storage.backup
backup-retry-batch-limit: 500
backup-retry-cron: "0 0 2 * * ?"
qiniu:
kodo:
access-key: ${QINIU_KODO_ACCESS_KEY:}
secret-key: ${QINIU_KODO_SECRET_KEY:}
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
zone: ${QINIU_KODO_ZONE:z2}
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
signed-url-expire-minutes: ${QINIU_KODO_SIGNED_URL_EXPIRE_MINUTES:60}
minio:
enabled: ${MINIO_ENABLED:false}
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
access-key: ${MINIO_ACCESS_KEY:}
secret-key: ${MINIO_SECRET_KEY:}
private-bucket: ${MINIO_PRIVATE_BUCKET:true}
signed-url-expire-minutes: ${MINIO_SIGNED_URL_EXPIRE_MINUTES:60}
aliyun:
oss:
enabled: ${ALIYUN_OSS_ENABLED:false}
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
region: ${ALIYUN_OSS_REGION:cn-chengdu}
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:}
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:}
signed-url-expire-minutes: ${ALIYUN_OSS_SIGNED_URL_EXPIRE_MINUTES:60}
@@ -0,0 +1,132 @@
spring:
cloud:
gateway:
routes:
# 前台API路由
- id: product-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/product/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: product-like-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/product-like/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: shop-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/shop/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: user-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/user/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: comment-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/comment/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: balance-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/balance/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: tag-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/tag/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: file-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/file/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: permission-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/permission/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: coupon-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/coupon/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: cart-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/cart/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: order-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/order/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: wishlist-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/wishlist/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: nail-artist-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/nail-artist/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: legal-agreement-route
uri: lb://jc-artlist-core
predicates:
- Path=/api/legal-agreement/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
# 前台API兜底路由,避免 Core 新增模块后 Gateway 未同步导致 404
- id: frontend-fallback-route
order: 100
uri: lb://jc-artlist-core
predicates:
- Path=/api/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
fingertip-designer:
security:
jwt:
issuer: fingertip-designer
clock-skew-seconds: 30
gateway:
whitelist:
- /api/user/login
- /api/user/register
- /api/user/check/**
- /api/user/refresh-token
- /api/user/send-verification-code
- /api/user/phone-login
- /api/user/wechat-mini/**
- /api/user/reset-password-by-phone
- /api/nail-artist/profile/**
- /api/nail-artist/*/availability
- /api/nail-artist/*/reviews
- /api/shop/list
- /api/shop/list/simple
- /api/legal-agreement/current
- /api/legal-agreement/current/**
- /api/health/**
- /api/error
slow-request:
enabled: true
threshold-ms: 300
log-response-header-request-id: true
@@ -0,0 +1,56 @@
spring:
redis:
host: ${REDIS_HOST:192.168.5.15}
port: ${REDIS_PORT:6379}
username: ${REDIS_USERNAME:xiaowang}
password: ${REDIS_PASSWORD}
database: ${REDIS_DATABASE:0}
rabbitmq:
addresses: ${RABBITMQ_ADDRESSES:192.168.5.15:5672}
virtual-host: ${RABBITMQ_VHOST}
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
publisher-confirm-type: correlated
publisher-returns: true
listener:
simple:
acknowledge-mode: manual
auto-startup: true
database:
business:
jdbc-url: ${BUSINESS_JDBC_URL}
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}
object-storage:
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
provider-order:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
minio:
enabled: ${MINIO_ENABLED:true}
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
access-key: ${MINIO_ACCESS_KEY}
secret-key: ${MINIO_SECRET_KEY}
qiniu:
kodo:
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
access-key: ${QINIU_KODO_ACCESS_KEY}
secret-key: ${QINIU_KODO_SECRET_KEY}
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
zone: ${QINIU_KODO_ZONE:z2}
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
aliyun:
oss:
enabled: ${ALIYUN_OSS_ENABLED:true}
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
region: ${ALIYUN_OSS_REGION:cn-chengdu}
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID}
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET}
@@ -0,0 +1,4 @@
logging:
level:
root: INFO
com.xiaowang.fingertipdesigner: INFO
@@ -0,0 +1,17 @@
security:
nacos:
username: ${NACOS_USERNAME}
password: ${NACOS_PASSWORD}
database:
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}
redis:
password: ${REDIS_PASSWORD}
rabbitmq:
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
spring:
datasource:
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}
@@ -0,0 +1,138 @@
spring:
datasource:
url: jdbc:mysql://192.168.5.15:3306/jayucloud_salon?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
jackson:
time-zone: Asia/Shanghai
date-format: yyyy-MM-dd HH:mm:ss
logging:
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
server:
servlet:
encoding:
charset: UTF-8
force: true
enabled: true
timezone: Asia/Shanghai
mybatis:
configuration:
map-underscore-to-camel-case: true
fingertip-designer:
brand:
message-template-name: ${PLATFORM_MESSAGE_TEMPLATE_NAME:JayuCloud-Salon}
manager-register-shop-description: ${PLATFORM_MANAGER_REGISTER_SHOP_DESCRIPTION:甲屿店务注册店铺}
security:
jwt:
issuer: jayucloud-salon
access-token-expiration-seconds: 7200
remember-me-access-token-expiration-seconds: 604800
refresh-token-expiration-seconds: 604800
clock-skew-seconds: 30
signature:
enabled: true
window-seconds: 300
nonce-retention-seconds: 600
rate-limit:
login:
limit: 10
window-seconds: 60
send-code:
limit: 5
window-seconds: 60
reset-password:
limit: 5
window-seconds: 600
authenticated-write:
limit: 80
window-seconds: 60
order-create:
limit: 10
window-seconds: 60
cache:
local-max-size: 2048
product-detail:
local-ttl-seconds: 120
redis-ttl-seconds: 900
product-list:
local-ttl-seconds: 60
redis-ttl-seconds: 300
product-search:
local-ttl-seconds: 60
redis-ttl-seconds: 300
shop:
local-ttl-seconds: 180
redis-ttl-seconds: 900
tag:
local-ttl-seconds: 300
redis-ttl-seconds: 1200
object-storage-file:
local-ttl-seconds: 300
redis-ttl-seconds: 1800
dashboard:
local-ttl-seconds: 30
redis-ttl-seconds: 90
slow-request:
enabled: true
threshold-ms: 300
log-response-header-request-id: true
http-client:
connect-timeout-ms: 3000
read-timeout-ms: 5000
connection-request-timeout-ms: 1000
max-total-connections: 200
max-connections-per-route: 50
object-storage:
provider-order:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
replica-required-providers:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
primary-provider: MINIO
backup-provider: QINIU_KODO,ALIYUN_OSS
signed-url-expire-minutes: 60
backup-queue-name: jayucloud-salon.file.object-storage.backup.queue
backup-exchange-name: jayucloud-salon.file.object-storage.backup.exchange
backup-routing-key: jayucloud-salon.file.object-storage.backup
backup-retry-batch-limit: 500
backup-retry-cron: "0 0 2 * * ?"
qiniu:
kodo:
access-key: ${QINIU_KODO_ACCESS_KEY:}
secret-key: ${QINIU_KODO_SECRET_KEY:}
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
zone: ${QINIU_KODO_ZONE:z2}
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
signed-url-expire-minutes: ${QINIU_KODO_SIGNED_URL_EXPIRE_MINUTES:60}
minio:
enabled: ${MINIO_ENABLED:false}
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
access-key: ${MINIO_ACCESS_KEY:}
secret-key: ${MINIO_SECRET_KEY:}
private-bucket: ${MINIO_PRIVATE_BUCKET:true}
signed-url-expire-minutes: ${MINIO_SIGNED_URL_EXPIRE_MINUTES:60}
aliyun:
oss:
enabled: ${ALIYUN_OSS_ENABLED:false}
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
region: ${ALIYUN_OSS_REGION:cn-chengdu}
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:}
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:}
signed-url-expire-minutes: ${ALIYUN_OSS_SIGNED_URL_EXPIRE_MINUTES:60}
@@ -0,0 +1,163 @@
spring:
cloud:
gateway:
routes:
# 前台API路由
- id: product-route
uri: lb://jc-salon-core
predicates:
- Path=/api/product/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: product-like-route
uri: lb://jc-salon-core
predicates:
- Path=/api/product-like/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: shop-route
uri: lb://jc-salon-core
predicates:
- Path=/api/shop/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: user-route
uri: lb://jc-salon-core
predicates:
- Path=/api/user/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: comment-route
uri: lb://jc-salon-core
predicates:
- Path=/api/comment/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: balance-route
uri: lb://jc-salon-core
predicates:
- Path=/api/balance/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: tag-route
uri: lb://jc-salon-core
predicates:
- Path=/api/tag/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: file-route
uri: lb://jc-salon-core
predicates:
- Path=/api/file/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: permission-route
uri: lb://jc-salon-core
predicates:
- Path=/api/permission/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: coupon-route
uri: lb://jc-salon-core
predicates:
- Path=/api/coupon/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: cart-route
uri: lb://jc-salon-core
predicates:
- Path=/api/cart/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: order-route
uri: lb://jc-salon-core
predicates:
- Path=/api/order/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: wishlist-route
uri: lb://jc-salon-core
predicates:
- Path=/api/wishlist/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: nail-artist-route
uri: lb://jc-salon-core
predicates:
- Path=/api/nail-artist/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
- id: legal-agreement-route
uri: lb://jc-salon-core
predicates:
- Path=/api/legal-agreement/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
# 后台管理API路由(/api/admin/** 格式)
- id: admin-api-route
order: -10
uri: lb://jc-salon-core
predicates:
- Path=/api/admin/**
filters:
- RewritePath=/api/admin/(?<remaining>.*), /admin/${remaining}
# 后台管理API路由(/admin/api/** 格式)
- id: admin-route
order: -9
uri: lb://jc-salon-core
predicates:
- Path=/admin/api/**
filters:
- RewritePath=/admin/api/(?<remaining>.*), /admin/${remaining}
- id: admin-auth-compat-route
order: -8
uri: lb://jc-salon-core
predicates:
- Path=/admin/auth/**
# 前台API兜底路由,避免 Core 新增模块后 Gateway 未同步导致 404
- id: frontend-fallback-route
order: 100
uri: lb://jc-salon-core
predicates:
- Path=/api/**
filters:
- RewritePath=/api/(?<remaining>.*), /${remaining}
fingertip-designer:
security:
jwt:
issuer: fingertip-designer
clock-skew-seconds: 30
gateway:
whitelist:
- /api/user/login
- /api/user/register
- /api/user/check/**
- /api/user/refresh-token
- /api/user/send-verification-code
- /api/user/phone-login
- /api/user/wechat-mini/**
- /api/user/reset-password-by-phone
- /api/nail-artist/profile/**
- /api/nail-artist/*/availability
- /api/nail-artist/*/reviews
- /api/shop/list
- /api/shop/list/simple
- /api/legal-agreement/current
- /api/legal-agreement/current/**
- /api/health/**
- /api/error
- /api/admin/auth/login
- /api/admin/auth/login-shops/**
- /api/admin/auth/refresh
- /api/admin/auth/register
- /admin/auth/login
- /admin/auth/login-shops/**
- /admin/auth/refresh
- /admin/api/auth/login
- /admin/api/auth/login-shops/**
- /admin/api/auth/refresh
slow-request:
enabled: true
threshold-ms: 300
log-response-header-request-id: true
@@ -0,0 +1,56 @@
spring:
redis:
host: ${REDIS_HOST:192.168.5.15}
port: ${REDIS_PORT:6379}
username: ${REDIS_USERNAME:xiaowang}
password: ${REDIS_PASSWORD}
database: ${REDIS_DATABASE:0}
rabbitmq:
addresses: ${RABBITMQ_ADDRESSES:192.168.5.15:5672}
virtual-host: ${RABBITMQ_VHOST}
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
publisher-confirm-type: correlated
publisher-returns: true
listener:
simple:
acknowledge-mode: manual
auto-startup: true
database:
business:
jdbc-url: ${BUSINESS_JDBC_URL}
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}
object-storage:
primary-provider: ${OBJECT_STORAGE_PRIMARY_PROVIDER:MINIO}
provider-order:
- MINIO
- QINIU_KODO
- ALIYUN_OSS
minio:
enabled: ${MINIO_ENABLED:true}
endpoint: ${MINIO_ENDPOINT:http://192.168.5.15:9000}
bucket-name: ${MINIO_BUCKET_NAME:jayucloud-dev}
access-key: ${MINIO_ACCESS_KEY}
secret-key: ${MINIO_SECRET_KEY}
qiniu:
kodo:
bucket-name: ${QINIU_KODO_BUCKET_NAME:jayucloud-dev}
access-key: ${QINIU_KODO_ACCESS_KEY}
secret-key: ${QINIU_KODO_SECRET_KEY}
domain: ${QINIU_KODO_DOMAIN:https://img.yunail.art}
zone: ${QINIU_KODO_ZONE:z2}
private-bucket: ${QINIU_KODO_PRIVATE_BUCKET:true}
aliyun:
oss:
enabled: ${ALIYUN_OSS_ENABLED:true}
endpoint: ${ALIYUN_OSS_ENDPOINT:https://oss-cn-chengdu.aliyuncs.com}
region: ${ALIYUN_OSS_REGION:cn-chengdu}
bucket-name: ${ALIYUN_OSS_BUCKET_NAME:jayucloud-dev}
access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID}
access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET}
@@ -0,0 +1,4 @@
logging:
level:
root: INFO
com.xiaowang.fingertipdesigner: INFO
@@ -0,0 +1,17 @@
security:
nacos:
username: ${NACOS_USERNAME}
password: ${NACOS_PASSWORD}
database:
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}
redis:
password: ${REDIS_PASSWORD}
rabbitmq:
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
spring:
datasource:
username: ${BUSINESS_DB_USERNAME}
password: ${BUSINESS_DB_PASSWORD}