commit 6256de741557ba1568c4c2489a18ce370a4c0256 Author: OverCooked Date: Wed Sep 2 14:58:03 2026 +0000 release: publish customer installer diff --git a/README.md b/README.md new file mode 100644 index 0000000..786fd73 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# OverCooked Customer Installer + +Public customer deployment script only. No Auth source, credentials, keys, or production configuration are included. + +## Install + +Download this script and set the Auth URL, Auth public key map, and customer server IP: + + curl -fsSL https://git.leee.xin/OverCooked/OverCooked-Installer/raw/branch/main/install.sh -o install.sh + sudo env OVERCOOKED_AUTH_URL=https://auth.example.invalid OVERCOOKED_AUTH_PUBLIC_KEYS='{"auth-1":"PUBLIC_KEY"}' OVERCOOKED_SERVER_IP=203.0.113.10 ./install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..dc52240 --- /dev/null +++ b/install.sh @@ -0,0 +1,115 @@ +#!/bin/sh +set -eu + +# Public customer bootstrap. Auth is an external service; no Auth image or +# private source is downloaded by this script. +REGISTRY="${OVERCOOKED_REGISTRY:-git.leee.xin/overcooked}" +VERSION="${OVERCOOKED_VERSION:-20260902}" +ROOT="${OVERCOOKED_ROOT:-/opt/overcooked}" +SERVER_IP="${OVERCOOKED_SERVER_IP:-}" +ACTIVATION_CODE="${OVERCOOKED_ACTIVATION_CODE:-}" +AUTH_URL="${OVERCOOKED_AUTH_URL:-}" +AUTH_PUBLIC_KEYS="${OVERCOOKED_AUTH_PUBLIC_KEYS:-}" + +die() { echo "overcooked-install: $*" >&2; exit 1; } +[ "$(id -u)" = 0 ] || die "请使用 sudo/root 执行" +command -v docker >/dev/null 2>&1 || die "未找到 Docker Engine" +docker compose version >/dev/null 2>&1 || die "未找到 Docker Compose v2" +command -v git >/dev/null 2>&1 || die "未找到 git" +[ -n "$SERVER_IP" ] || SERVER_IP=$(hostname -I 2>/dev/null | awk '{print $1}') +[ -n "$SERVER_IP" ] || die "无法识别服务器 IP,请设置 OVERCOOKED_SERVER_IP" +case "$SERVER_IP" in *[!0-9.]*|*[!0-9]*) die "仅支持 IPv4 地址:$SERVER_IP";; esac +[ -n "$AUTH_URL" ] || die "请设置 OVERCOOKED_AUTH_URL(Auth 服务地址)" +[ -n "$AUTH_PUBLIC_KEYS" ] || die "请设置 OVERCOOKED_AUTH_PUBLIC_KEYS(Auth 公钥 JSON)" +[ -n "$ACTIVATION_CODE" ] || printf '请输入授权码: '; [ -n "$ACTIVATION_CODE" ] || read -r ACTIVATION_CODE +[ -n "$ACTIVATION_CODE" ] || die "授权码不能为空" + +install -d -m 700 "$ROOT" +for repo in OverCooked-S Overcooked-E; do + if [ ! -d "$ROOT/$repo/.git" ]; then + git clone --depth 1 "https://git.leee.xin/OverCooked/$repo.git" "$ROOT/$repo" + else + git -C "$ROOT/$repo" fetch --depth 1 origin && git -C "$ROOT/$repo" reset --hard FETCH_HEAD + fi +done +install -d -m 700 "$ROOT/config" +command -v openssl >/dev/null 2>&1 || die "未找到 openssl" +secret() { openssl rand -hex 32; } +s_db=$(secret); s_valkey=$(secret); internal=$(secret); access=$(secret); setup=$(secret) +e_db=$(secret); ticket=$(secret); lease=$(secret); storage=$(secret); plugin=$(secret) +cat >"$ROOT/production.env" <"$ROOT/config/e-server.production.yaml" <"$ROOT/config/e-public.override.yml" <<'EOF' +services: + e-server: + ports: + - "0.0.0.0:8096:8096" +EOF +docker login "${REGISTRY%%/*}" +docker network inspect overcooked-control >/dev/null 2>&1 || docker network create overcooked-control >/dev/null +docker compose -p overcooked-e --env-file "$ROOT/production.env" -f "$ROOT/Overcooked-E/deploy/compose/production.yml" run --rm e-server migrate +docker compose -p overcooked-e --env-file "$ROOT/production.env" -f "$ROOT/Overcooked-E/deploy/compose/production.yml" -f "$ROOT/Overcooked-E/deploy/compose/control-plane-network.yml" -f "$ROOT/config/e-public.override.yml" up -d --no-build +docker compose -p overcooked-s --env-file "$ROOT/production.env" -f "$ROOT/OverCooked-S/deploy/s/docker-compose.production.yml" up -d --no-build +echo "配置已写入 $ROOT/production.env" +echo "现在启动 S/E;首次启动后打开 http://$SERVER_IP:18083/setup 输入授权码和页面显示的 Setup Token。" +echo "镜像来源:$REGISTRY(不包含 Auth 镜像)"