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>
56 lines
1.5 KiB
Bash
56 lines
1.5 KiB
Bash
#!/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
|