本仓 2026-08-12 从 ssw main (192.168.1.18:13300/ssw/ssw-mvp) 的 dacli/ subpath 抽取,作为独立仓托管到 gitea:3000/ssw/dacli.git。 - 工作树为 ssw main dacli subpath 最新版 (110 commit, 08-12) - 历史未带 ssw main 整体历史(避免大仓污染) - 此为新仓基线 commit,未来以本仓历史为主
41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# proxy-up.sh — 启动本机 nginx 反代 (dacli proxy up)
|
|
#
|
|
# 前置: brew install nginx (Intel Mac 路径 /usr/local/, ARM Mac 路径 /opt/homebrew/)
|
|
#
|
|
set -euo pipefail
|
|
|
|
# 检测 brew nginx 路径
|
|
if command -v nginx >/dev/null; then
|
|
: # nginx 已在 PATH
|
|
elif [[ -x /usr/local/bin/nginx ]]; then
|
|
export PATH="/usr/local/bin:$PATH"
|
|
elif [[ -x /opt/homebrew/bin/nginx ]]; then
|
|
export PATH="/opt/homebrew/bin:$PATH"
|
|
else
|
|
echo "nginx not found. Install: brew install nginx" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# 解析 brew prefix (兼容 Intel/ARM)
|
|
BREW_PREFIX="$(brew --prefix 2>/dev/null || echo /usr/local)"
|
|
SERVERS_DIR="${BREW_PREFIX}/etc/nginx/servers"
|
|
SSW_CONF_SRC="$(cd "$(dirname "$0")/.." && pwd)/config/nginx/ssw.conf"
|
|
|
|
mkdir -p "$SERVERS_DIR"
|
|
ln -sf "$SSW_CONF_SRC" "$SERVERS_DIR/ssw.conf"
|
|
|
|
if ! sudo nginx -t; then
|
|
echo "nginx config test failed" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if pgrep -x nginx >/dev/null; then
|
|
sudo nginx -s reload
|
|
else
|
|
sudo nginx
|
|
fi
|
|
|
|
echo "nginx up: http://nginx/"
|
|
echo "verify: curl -fsS http://nginx/api/system/DbLink/List" |