254 lines
9.9 KiB
YAML
254 lines
9.9 KiB
YAML
server:
|
|
port: ${GATEWAY_PORT:9000}
|
|
|
|
spring:
|
|
profiles:
|
|
active: ${SPRING_PROFILES_ACTIVE:test}
|
|
group:
|
|
dev: cn
|
|
test: cn
|
|
application:
|
|
name: gateway
|
|
autoconfigure:
|
|
exclude:
|
|
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
|
|
config:
|
|
import:
|
|
- nacos:baiyue-common.yml?group=${NACOS_GROUP:BAIYUE}&refreshEnabled=true
|
|
- nacos:${spring.application.name}.yml?group=${NACOS_GROUP:BAIYUE}&refreshEnabled=true
|
|
data:
|
|
redis:
|
|
host: ${REDIS_HOST}
|
|
port: ${REDIS_PORT:6379}
|
|
password: ${REDIS_PASSWORD:}
|
|
database: ${REDIS_DATABASE:0}
|
|
timeout: ${REDIS_TIMEOUT:3s}
|
|
cloud:
|
|
nacos:
|
|
server-addr: ${NACOS_SERVER_ADDR}
|
|
username: ${NACOS_USERNAME}
|
|
password: ${NACOS_PASSWORD}
|
|
discovery:
|
|
enabled: ${NACOS_DISCOVERY_ENABLED:true}
|
|
register-enabled: ${NACOS_REGISTER_ENABLED:true}
|
|
group: ${NACOS_GROUP:BAIYUE}
|
|
namespace: ${NACOS_NAMESPACE}
|
|
config:
|
|
namespace: ${NACOS_NAMESPACE}
|
|
gateway:
|
|
discovery:
|
|
locator:
|
|
# 使用显式路由,避免将注册中心中的内部服务自动暴露到公网。
|
|
enabled: false
|
|
lower-case-service-id: true
|
|
routes:
|
|
- id: lastleg-service
|
|
uri: lb://lastleg-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/last-leg/**,/api/platform/v1/last-leg/**,/api/pda/v1/last-leg/**
|
|
- id: warehouse-overseas-service
|
|
uri: lb://warehouse-overseas-service
|
|
predicates:
|
|
- Path=/api/platform/v1/overseas-warehouse-resources/**
|
|
- id: auth-service
|
|
uri: lb://auth-service
|
|
predicates:
|
|
- Path=/api/auth/**
|
|
- id: warehouse-customer-overseas-fees
|
|
uri: lb://warehouse-service
|
|
predicates:
|
|
- Path=/api/platform/v1/iam/tenants/{tenantId}/overseas-storage-fees,/api/platform/v1/iam/tenants/{tenantId}/overseas-storage-fees/**
|
|
- id: iam-service
|
|
uri: lb://iam-service
|
|
predicates:
|
|
- Path=/api/platform/v1/iam/**,/api/merchant/v1/iam/**,/api/platform/v1/notifications/**,/api/platform/v1/notification-templates/**,/api/platform/v1/notification-tasks/**,/api/merchant/v1/notifications/**
|
|
- id: audit-service
|
|
uri: lb://audit-service
|
|
predicates:
|
|
- Path=/api/platform/v1/audit/**
|
|
- id: order-service
|
|
uri: lb://order-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/orders/**,/api/platform/v1/orders/**
|
|
- id: warehouse-service
|
|
uri: lb://warehouse-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/warehouses/**,/api/merchant/v1/partners/**,/api/platform/v1/warehouses/**,/api/platform/v1/warehouse-admin/**,/api/platform/v1/partners/**,/api/platform/v1/express-companies/**,/api/platform/v1/pallets/**,/api/platform/v1/locations/**,/api/platform/v1/overseas-storage-fees/**,/api/platform/v1/suppliers/**,/api/platform/v1/domestic-containers/**,/api/platform/v1/iam/tenants/{tenantId}/overseas-storage-fees,/api/platform/v1/iam/tenants/{tenantId}/overseas-storage-fees/**
|
|
- id: file-service
|
|
uri: lb://file-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/files/**,/api/platform/v1/files/**,/api/pda-updates/**
|
|
- id: print-service
|
|
uri: lb://print-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/print/**,/api/platform/v1/print/**
|
|
- id: firstleg-service
|
|
uri: lb://firstleg-service
|
|
predicates:
|
|
- Path=/api/merchant/v1/first-leg/**,/api/merchant/v1/customs/**,/api/platform/v1/first-leg/**,/api/platform/v1/customs/**,/api/platform/v1/port-schedules/**,/api/platform/v1/carrier-schedule-queries/**,/api/platform/v1/container-shipping-nodes/**,/api/platform/v1/containers/**,/api/platform/v1/terminal-drayages/**,/api/platform/v1/customers/{customerId}/container-transit-summary,/api/platform/v1/ocean-bookings/**,/api/platform/v1/truck-appointments/**,/api/platform/v1/fba-pricing/**,/api/platform/v1/inbounds/**,/api/platform/v1/fee-items/**,/api/platform/v1/loading-plans/**,/api/platform/v1/sailings/**,/api/platform/v1/sailing-channels/**,/api/platform/v1/sailing-templates/**,/api/platform/v1/sailing-assignments/**,/api/platform/v1/sailing-forecasts/**,/api/platform/v1/firstleg/mojia-sku-sync/**,/api/platform/inbounds/**,/openapi/v1/inbound-measurements/**
|
|
- id: finance-service
|
|
uri: lb://finance-service
|
|
predicates:
|
|
- Path=/api/platform/finance/v1/**,/api/client/finance/v1/**
|
|
# Swagger 文档聚合路由。
|
|
- id: lastleg-openapi
|
|
uri: lb://lastleg-service
|
|
predicates:
|
|
- Path=/lastleg-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: warehouse-overseas-openapi
|
|
uri: lb://warehouse-overseas-service
|
|
predicates:
|
|
- Path=/warehouse-overseas-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: auth-openapi
|
|
uri: lb://auth-service
|
|
predicates:
|
|
- Path=/auth-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: iam-openapi
|
|
uri: lb://iam-service
|
|
predicates:
|
|
- Path=/iam-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: order-openapi
|
|
uri: lb://order-service
|
|
predicates:
|
|
- Path=/order-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: firstleg-openapi
|
|
uri: lb://firstleg-service
|
|
predicates:
|
|
- Path=/firstleg-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: warehouse-openapi
|
|
uri: lb://warehouse-service
|
|
predicates:
|
|
- Path=/warehouse-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: file-openapi
|
|
uri: lb://file-service
|
|
predicates:
|
|
- Path=/file-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: print-openapi
|
|
uri: lb://print-service
|
|
predicates:
|
|
- Path=/print-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: audit-openapi
|
|
uri: lb://audit-service
|
|
predicates:
|
|
- Path=/audit-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: integration-openapi
|
|
uri: lb://integration-service
|
|
predicates:
|
|
- Path=/integration-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
- id: finance-openapi
|
|
uri: lb://finance-service
|
|
predicates:
|
|
- Path=/finance-service/v3/api-docs/**
|
|
filters:
|
|
- StripPrefix=1
|
|
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: GET,POST,PUT,PATCH,DELETE,OPTIONS
|
|
allowed-headers: Authorization,Content-Type,Accept,X-Requested-With,X-Request-Id,Idempotency-Key,X-App-Key,X-Timestamp,X-Nonce,X-Signature
|
|
exposed-headers: X-Request-Id,X-Trace-Id,Location,Content-Disposition
|
|
allow-credentials: ${CORS_ALLOW_CREDENTIALS:false}
|
|
max-age: ${CORS_MAX_AGE:3600}
|
|
security:
|
|
jwk-set-uri: ${JWT_JWKS_URI:http://127.0.0.1:9100/api/auth/.well-known/jwks.json}
|
|
session-validation-uri: ${SESSION_VALIDATION_URI:http://127.0.0.1:9100/internal/auth/accounts/sessions/validate}
|
|
issuer: ${JWT_ISSUER:auth-service}
|
|
audience: ${JWT_AUDIENCE:lastleg-api}
|
|
token-key-prefix: ${REDIS_TOKEN_KEY_PREFIX:baiyue:auth}
|
|
permit-paths:
|
|
- /api/pda-updates/**
|
|
- /api/auth/login
|
|
- /api/auth/register
|
|
- /api/auth/refresh
|
|
- /api/auth/impersonations/exchange
|
|
- /openapi/v1/inbound-measurements/**
|
|
- /actuator/health
|
|
- /swagger-ui/**
|
|
- /swagger-ui.html
|
|
- /webjars/**
|
|
- /v3/api-docs/**
|
|
- /auth-service/v3/api-docs/**
|
|
- /iam-service/v3/api-docs/**
|
|
- /order-service/v3/api-docs/**
|
|
- /warehouse-service/v3/api-docs/**
|
|
- /file-service/v3/api-docs/**
|
|
- /print-service/v3/api-docs/**
|
|
- /firstleg-service/v3/api-docs/**
|
|
- /audit-service/v3/api-docs/**
|
|
- /integration-service/v3/api-docs/**
|
|
- /finance-service/v3/api-docs/**
|
|
- /lastleg-service/v3/api-docs/**
|
|
- /warehouse-overseas-service/v3/api-docs/**
|
|
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,prometheus
|
|
endpoint:
|
|
health:
|
|
probes:
|
|
enabled: true
|
|
|
|
springdoc:
|
|
api-docs.enabled: ${SWAGGER_ENABLED:false}
|
|
swagger-ui:
|
|
enabled: ${SWAGGER_ENABLED:false}
|
|
urls:
|
|
- name: auth-platform
|
|
url: /auth-service/v3/api-docs/platform
|
|
- name: iam-platform
|
|
url: /iam-service/v3/api-docs/platform
|
|
- name: iam-merchant
|
|
url: /iam-service/v3/api-docs/merchant
|
|
- name: order-platform
|
|
url: /order-service/v3/api-docs/platform
|
|
- name: order-merchant
|
|
url: /order-service/v3/api-docs/merchant
|
|
- name: warehouse-merchant
|
|
url: /warehouse-service/v3/api-docs/merchant
|
|
- name: warehouse-platform
|
|
url: /warehouse-service/v3/api-docs/platform
|
|
- name: file-platform
|
|
url: /file-service/v3/api-docs/platform
|
|
- name: file-merchant
|
|
url: /file-service/v3/api-docs/merchant
|
|
- name: print-platform
|
|
url: /print-service/v3/api-docs/platform
|
|
- name: firstleg-platform
|
|
url: /firstleg-service/v3/api-docs/platform
|
|
- name: firstleg-measurement-openapi
|
|
url: /firstleg-service/v3/api-docs/measurement-openapi
|
|
- name: audit
|
|
url: /audit-service/v3/api-docs
|
|
- name: integration
|
|
url: /integration-service/v3/api-docs
|
|
- name: finance
|
|
url: /finance-service/v3/api-docs
|
|
- name: lastleg
|
|
url: /lastleg-service/v3/api-docs
|
|
- name: warehouse-overseas
|
|
url: /warehouse-overseas-service/v3/api-docs
|