fix: stabilize device debugging and cloud deploy
This commit is contained in:
@@ -6,5 +6,18 @@ remote_dir="${BOSS_REMOTE_DIR:-/home/ubuntu/boss}"
|
||||
export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
|
||||
export AG_SERVER_SKILL="${AG_SERVER_SKILL:-$CODEX_HOME/skills/ai-glasses-server-debug}"
|
||||
export AG_SERVER="${AG_SERVER:-$AG_SERVER_SKILL/scripts/server_ssh.sh}"
|
||||
KEYCHAIN_SERVICE="${AI_GLASSES_KEYCHAIN_SERVICE:-ai-glasses-debug-ssh}"
|
||||
|
||||
"$AG_SERVER" exec "set -euo pipefail; cd $(printf '%q' "$remote_dir"); if sudo docker ps --format '{{.Names}}' | grep -qx 'boss-control-plane'; then sudo docker compose -f compose.cloud.yaml -p boss ps; echo '---'; curl -fsS http://127.0.0.1:43210/boss/api/health; else BOSS_BASE_PATH=/boss ./scripts/server_status.sh; fi"
|
||||
resolve_server_password() {
|
||||
if [[ -n "${AI_GLASSES_SERVER_PASS:-}" ]]; then
|
||||
printf '%s' "${AI_GLASSES_SERVER_PASS}"
|
||||
return 0
|
||||
fi
|
||||
if command -v security >/dev/null 2>&1; then
|
||||
security find-generic-password -a "${AI_GLASSES_SERVER_USER:-ubuntu}" -s "${KEYCHAIN_SERVICE}" -w 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
server_pass="$(resolve_server_password)"
|
||||
|
||||
"$AG_SERVER" exec "set -euo pipefail; SUDO_PASS=$(printf '%q' "$server_pass"); run_sudo(){ if [[ -n \"\$SUDO_PASS\" ]]; then printf '%s\n' \"\$SUDO_PASS\" | sudo -S \"\$@\"; else sudo \"\$@\"; fi; }; cd $(printf '%q' "$remote_dir"); if run_sudo docker ps --format '{{.Names}}' | grep -qx 'boss-control-plane'; then run_sudo docker compose -f compose.cloud.yaml -p boss ps; echo '---'; curl -fsS http://127.0.0.1:43210/boss/api/health; else BOSS_BASE_PATH=/boss ./scripts/server_status.sh; fi"
|
||||
|
||||
Reference in New Issue
Block a user