This commit is contained in:
eric
2026-05-16 19:24:30 -05:00
parent 19beec12a5
commit 75a0ca4e31
260 changed files with 51345 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# 幂等:同步配置中心默认 JSON → /opt/live/config生成 system-stack.env安装 Hub无业务模块
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
REPO="$(cd "$ROOT/.." && pwd)"
# shellcheck source=/dev/null
source "$ROOT/scripts/lib/common.sh"
ARCH="$(detect_arch)"
echo "[live-platform] install-core arch=$ARCH"
ensure_live_dirs
if [[ ! -f /opt/live/config/system.json ]]; then
cp -a "$ROOT/config/defaults/system.json" /opt/live/config/system.json
fi
if [[ ! -f /opt/live/config/network.json ]]; then
cp -a "$ROOT/config/defaults/network.json" /opt/live/config/network.json
fi
if command -v rsync >/dev/null 2>&1; then
rsync -a --ignore-existing "$ROOT/config/defaults/services/" /opt/live/config/services/
rsync -a --ignore-existing "$ROOT/config/defaults/business/" /opt/live/config/business/
else
cp -n "$ROOT/config/defaults/services/"*.json /opt/live/config/services/ 2>/dev/null || true
cp -n "$ROOT/config/defaults/business/"*.json /opt/live/config/business/ 2>/dev/null || true
fi
export LIVE_CONFIG_ROOT="${LIVE_CONFIG_ROOT:-/opt/live/config}"
python3 "$ROOT/tools/render_stack_env.py" /opt/live/generated/system-stack.env
if [[ -n "${LINK_REPO_CONFIG:-}" ]]; then
mkdir -p "$REPO/config"
ln -sf /opt/live/generated/system-stack.env "$REPO/config/system-stack.env"
fi
if [[ -x "$REPO/scripts/linux/install_hub.sh" ]]; then
bash "$REPO/scripts/linux/install_hub.sh" "$@"
else
echo "[live-platform] WARN: scripts/linux/install_hub.sh missing, skip hub packages"
fi
echo "[live-platform] install-core done. Env: /opt/live/generated/system-stack.env"