douyinWEB/scripts/install.sh
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 22:42:40 -05:00

56 lines
1.5 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.

#!/usr/bin/env bash
# Interactive entry — pick deploy shape, then run the matching bootstrap.
#
# Usage (on the target Linux host as root):
# curl -fsSL … | bash # or:
# bash scripts/install.sh
#
# Non-interactive:
# INSTALL_SHAPE=vps DOMAIN=… ADMIN_USER=… ADMIN_PASS=… GIT_URL=… \
# bash scripts/install.sh
#
# Or copy scripts/install.env.example → /etc/douyinweb.install.env then:
# bash scripts/install.sh
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck disable=SC1091
source "$ROOT/scripts/lib/install_common.sh"
require_root
load_install_env_files
print_banner
if [[ -z "${INSTALL_SHAPE:-}" ]]; then
cat <<'EOF'
选择部署形态:
1) vps — 应用 + HTTPS 同机(海外 VPS,现有 Nginx/宝塔加站)
2) physical — 应用在家里 Ubuntu/PVE;TLS 在另一台 VPS(WireGuard)
3) edge — 只在海外 VPS 写 Caddy 站点(配合 physical)
EOF
ask INSTALL_SHAPE_NUM "输入 1 / 2 / 3" "1"
case "$INSTALL_SHAPE_NUM" in
2) INSTALL_SHAPE=physical ;;
3) INSTALL_SHAPE=edge ;;
*) INSTALL_SHAPE=vps ;;
esac
fi
export INSTALL_SHAPE
case "$INSTALL_SHAPE" in
vps)
exec bash "$ROOT/scripts/bootstrap_vps.sh"
;;
physical)
exec bash "$ROOT/scripts/bootstrap_physical.sh"
;;
edge)
exec bash "$ROOT/scripts/bootstrap_physical_edge.sh"
;;
*)
echo "ERROR: unknown INSTALL_SHAPE=$INSTALL_SHAPE (use vps|physical|edge)" >&2
exit 1
;;
esac