Files
tongxunruanjian/scripts/deploy-public.sh
T
a71f6a0ce1 fix(deploy): 公网 overlay 用 !override 覆盖内部端口绑定
Compose 合并后内部端口只绑 127.0.0.1,避免与基础 0.0.0.0 叠加导致起不来。
顺带给 JPUSH_PUSH_INTENT 加引号,并拒绝空 SERVER_IP。

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-08-30 21:55:33 +08:00

46 lines
1.6 KiB
Bash
Executable File
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.
#!/usr/bin/env bash
# 香港测试机公网部署入口(jxd.jinniu.ink)。由总工执行;施工员本卡不跑本脚本,也不 SSH 改现网。
# 用法: ./scripts/deploy-public.sh
# 回滚: ./scripts/rollback-public.sh
set -euo pipefail
cd "$(dirname "$0")/.."
if [ ! -f .env ]; then
echo "没有 .env。先从 .env.example 复制,再按 deploy/public/.env.public.example 补公网项。" >&2
exit 1
fi
# LiveKit --node-ip 依赖 SERVER_IP;空值时信令通、媒体宣告错误。
# 不 source .envJPUSH_PUSH_INTENT 含分号);只抽取这一项。
if [ -z "${SERVER_IP:-}" ]; then
SERVER_IP="$(awk -F= '/^SERVER_IP=/{v=$2} END{print v}' .env | tr -d '[:space:]"')"
fi
if [ -z "${SERVER_IP}" ]; then
echo "SERVER_IP 为空,拒绝启动。请在 .env 填写本机公网 IP(LiveKit 媒体候选用)。" >&2
exit 1
fi
# 注入 Master Secret(失败则停,避免空密钥启动)
# shellcheck disable=SC1091
source ./scripts/load-jpush-secret.sh
if [ -z "${JPUSH_MASTER_SECRET:-}" ]; then
echo "Master Secret 未注入,拒绝启动" >&2
exit 1
fi
mkdir -p deploy/public/acme components/redis/config components/mnt/data components/mongodb components/etcd components/kafka
touch components/redis/config/redis.conf
docker compose \
-f docker-compose.yaml \
-f deploy/public/docker-compose.public.yaml \
pull
docker compose \
-f docker-compose.yaml \
-f deploy/public/docker-compose.public.yaml \
up -d
echo "已提交 compose 启动。检查: docker compose -f docker-compose.yaml -f deploy/public/docker-compose.public.yaml ps"
echo "证书未就绪时先用 nginx.bootstrap.conf 申请证书,见 deploy/public/README.md"