This repository has been archived on 2026-09-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
UserBaseFront/service/docker/run-app.sh
T

20 lines
1.2 KiB
Bash
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.
#!/bin/sh
# UserBase 启动入口:配置统一由 Nacos 配置中心在 bootstrap 阶段下发(见 bootstrap.yml)
# 不再需要手动 curl 拉取;若 nacos 不可达,bootstrap 中 fail-fast=false 会自动回退到
# 镜像内烤好的 application-prod.yml 兜底默认。
set -e
echo "[run-app] starting UserBase (profile=prod, nacos=${NACOS_ADDR:-nacos.yunhaixingtong.com:8848}) ..."
# 防御性保证 CAS 校验过滤器(yh-auth 的 cas20ProxyReceivingTicketValidationFilter)所需的
# yh.sso 属性。该过滤器从 yh.sso.client-host-url 派生 serverName(去掉上下文路径),而 yh-auth 在
# Spring Cloud + Nacos 环境下对 yh.sso.* 的宽松绑定偶尔返回 null,导致过滤器 init 抛
# "serverName or service must be set"、Tomcat 上下文启动失败。
# 这里用 JVM 系统属性强制注入:environment.getProperty 必能取到,优先级高于 Nacos/common.yaml 同名项,
# 后续若 Nacos prod 正确配置 yh.sso.* 仍可覆盖,不影响 Nacos 化。
exec java ${JAVA_OPTS:--Xms512m -Xmx1024m} -Dfile.encoding=UTF-8 \
-Dyh.sso.server-url-prefix=http://sso.yunhaixingtong.com \
-Dyh.sso.client-host-url=http://www.yunhaixingtong.com/userbase \
-jar /app/userbase.jar \
--spring.profiles.active=prod