diff --git a/scripts/fleet/README.md b/scripts/fleet/README.md new file mode 100644 index 0000000..b262a11 --- /dev/null +++ b/scripts/fleet/README.md @@ -0,0 +1,13 @@ +# Fleet staging — 9 accounts, 2 hosts, one container per account (prod 0700 Mon) + +Morning sequence (Charles wires TSGCOO first, then iterate/explore/test): +1. ROOT on each host: scripts/fleet/root-create-accounts.sh streaming|offstage +2. Stage bundle to each account: make release in harness repo, tar repo+binary + as fleet-stage.tgz, scp/copy to ~/mopac/ of each account. +3. AS each account: bash scripts/fleet/bootstrap-account.sh (edit ~/mopac/env + 0600 first: keys from Bitwarden; long-term only BW access stays on disk). +4. Verify: docker compose -p mopac- ps; Redmine claims show + "claimed by @" (harness 530 landing tonight). + +Prereqs landing tonight: 529/528 turn pool, 530 Redmine-claim dispatch +(race-tested), lanes: gitea/rest/discourse/imap clients. diff --git a/scripts/fleet/bootstrap-account.sh b/scripts/fleet/bootstrap-account.sh new file mode 100755 index 0000000..46501bd --- /dev/null +++ b/scripts/fleet/bootstrap-account.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# bootstrap-account.sh — run AS the target account on its host AFTER +# root-create-accounts.sh. Idempotent. Everything lands in ~/mopac. +# Env: MOPAC_STAGE (dir containing fleet-stage.tgz) — default: copied in. +set -eu +MOPAC="$HOME/mopac" +mkdir -p "$MOPAC" +cd "$MOPAC" + +if [ ! -d harness ]; then + tar xzf fleet-stage.tgz # harness repo incl. bin/harness-linux-amd64 +fi +cd harness + +# Per-account identity + secrets. ONLY Bitwarden access material belongs on +# disk long-term (SPEC); tonight's boot uses env refs staged 0600 — migrate +# to keyproxy (497) when Charles wires BW tomorrow. +if [ ! -f "$MOPAC/env" ]; then + cat > "$MOPAC/env" <&2; exit 1 ;; +esac +DOCKER_GID="$(stat -c %g /var/run/docker.sock)" +for u in $USERS; do + if id "$u" >/dev/null 2>&1; then + echo "exists: $u" + else + useradd -m -s /bin/bash -G docker "$u" + echo "created: $u (docker group $DOCKER_GID)" + fi + usermod -aG docker "$u" 2>/dev/null || true +done +echo "NOTE: reachableceo already exists — group membership updated only." +echo "Next (as each account or via sudo -u): ~/mopac/bootstrap-account.sh" diff --git a/scripts/semaphore.sh b/scripts/semaphore.sh index 993ab25..2a9ff99 100755 --- a/scripts/semaphore.sh +++ b/scripts/semaphore.sh @@ -17,7 +17,7 @@ set -uo pipefail METRICS=${METRICS:-/home/_crossfeed/metrics} ACTIVE="$METRICS/active" -MAX=${MAX_CONCURRENT:-2} # headroom of 1 below z.ai cap for interactive PMO use +MAX=${MAX_CONCURRENT:-3} # headroom of 1 below z.ai cap for interactive PMO use STALE_SECS=${STALE_SECS:-1800} mkdir -p "$ACTIVE" 2>/dev/null || true