Files
dc-observatio/config-repo/pcp-gateway-service.yaml
T
Дмитрий Соловьев ab3a787da5 feat(gateway): сервис pcp-gateway-service + сворачивание маршрутизации фронта на него
- новый Spring Cloud Gateway (WebFlux): доменные маршруты /api/pcp-<x>/**
  со StripPrefix=2, /api/stations без среза пути, catch-all /api/** → ui-service;
  опциональная JWT-валидация на edge (gateway.security.jwt-enabled, по умолчанию off)
- config-repo: pcp-gateway-service.yaml (маршруты) + порт/адрес gateway в реестрах
  application-{local,docker-local,dev}
- build: репозитории переведены на mavenCentral (nstart-proxy закомментирован),
  включены mavenLocal/gradlePluginPortal; settings: include модуля
- pcp-tgu-ui-service: vite-proxy и nginx.conf свёрнуты на единый /api → gateway
  (вместо набора per-service правил)
- deploy: сервис gateway в docker-compose; helm-чарт pcp-gateway-service
- CI: .gitlab/ci/pcp-gateway-service.yml + проводка в .gitlab-ci.yml
2026-06-10 13:34:16 +03:00

89 lines
3.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
spring:
boot:
admin:
client:
instance:
service-base-url: ${pcp.services.gateway}
management-base-url: ${pcp.services.gateway}
cloud:
gateway:
server:
# WebFlux-вариант Spring Cloud Gateway (Boot 4 / Spring Cloud 2025.1).
webflux:
routes:
# --- Доменные сервисы. Префикс /api/pcp-<x> СРЕЗАЕТСЯ (StripPrefix=2 убирает
# 2 сегмента: api + pcp-<x>), т.е. /api/pcp-tgu/api/plans -> бэкенд /api/plans.
# Это ровно семантика прежнего vite-rewrite. Цели берём из реестра pcp.services.*.
- id: tgu
uri: ${pcp.services.tgu}
predicates:
- Path=/api/pcp-tgu/**
filters:
- StripPrefix=2
- id: ballistics
uri: ${pcp.services.ballistics}
predicates:
- Path=/api/pcp-ballistics/**
filters:
- StripPrefix=2
- id: mission
uri: ${pcp.services.mission}
predicates:
- Path=/api/pcp-mission/**
filters:
- StripPrefix=2
- id: request
uri: ${pcp.services.request}
predicates:
- Path=/api/pcp-request/**
filters:
- StripPrefix=2
- id: complex
uri: ${pcp.services.complex-mission-service}
predicates:
- Path=/api/pcp-complex/**
filters:
- StripPrefix=2
# --- Станции: путь СОХРАНЯЕМ (в vite было без rewrite) — без StripPrefix.
- id: stations
uri: ${pcp.services.stations}
predicates:
- Path=/api/stations/**
# --- Общий catch-all /api/** -> ui-service. Матчится ПОСЛЕДНИМ (order выше).
- id: ui-catch-all
uri: ${pcp.services.ui}
predicates:
- Path=/api/**
order: 1
# Валидация JWT на edge. По умолчанию ВЫКЛЮЧЕНА (anonymous, как сейчас работает фронт).
# Для закрытого контура: GATEWAY_JWT_ENABLED=true И задать issuer через env
# SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI=<realm new-start>.
# Issuer намеренно НЕ объявлен здесь: пустое значение заставило бы автоконфиг поднимать
# JwtDecoder и падать на старте.
gateway:
security:
jwt-enabled: ${GATEWAY_JWT_ENABLED:false}
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
---
spring:
config:
activate:
on-profile: local
server:
port: ${pcp.ports.gateway:7080}
---
spring:
config:
activate:
on-profile: dev
server:
port: ${pcp.ports.gateway:8080}