Mom-Portal/scripts/bootstrap-vm-mysql.sh
KevinB-T 30894e7f27 Configure VM services and fix auth flow
- point MySQL and Whisper settings to the VM
- add VM MySQL bootstrap scripts and docs
- allow LAN Vite origins for CORS
- fix Express 5 validation assignment crash
- allow login with username or email
- prevent recursive auth refresh retries
2026-05-15 15:19:49 +05:30

20 lines
559 B
Bash

#!/usr/bin/env sh
set -eu
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
repo_root=$(dirname "$script_dir")
vm_target="${1:-${VM_SSH_TARGET:-}}"
remote_sql="/tmp/orphion-setup-vm-mysql.sql"
if [ -z "$vm_target" ]; then
echo "Usage: sh scripts/bootstrap-vm-mysql.sh <user@172.16.10.64>" >&2
echo "Or set VM_SSH_TARGET=<user@172.16.10.64>." >&2
exit 2
fi
cd "$repo_root"
scp "$script_dir/setup-vm-mysql.sql" "$vm_target:$remote_sql"
ssh -t "$vm_target" "sudo mysql < $remote_sql; status=\$?; rm -f $remote_sql; exit \$status"
npm run migrate