Skip to content

Improve macOS Apple Silicon install flow (Colima/Docker Desktop)#1

Open
piartz wants to merge 10 commits intoBugTraceAI:mainfrom
piartz:feat/macos-fire-and-forget-installer
Open

Improve macOS Apple Silicon install flow (Colima/Docker Desktop)#1
piartz wants to merge 10 commits intoBugTraceAI:mainfrom
piartz:feat/macos-fire-and-forget-installer

Conversation

@piartz
Copy link

@piartz piartz commented Mar 5, 2026

Summary

This PR improves first-time installation on macOS (Apple Silicon in particular) while preserving the existing launcher workflow.

Key goals:

  • Keep the current author flow and UX.
  • Reduce manual prerequisites and runtime friction for macOS users.
  • Support both Docker Desktop and Colima (Docker Desktop-free path).
  • Make setup closer to fire-and-forget for first-time users.

What changed

Installer bootstrap (install.sh)

  • Reworked install bootstrap to be user-target aware (SUDO_USER) instead of forcing root-only behavior.
  • Added macOS-aware dependency bootstrap path.
  • Added Homebrew detection/bootstrapping support for macOS dependency install flow.
  • Hardened macOS detection and sudo/root guard behavior.

Launcher runtime compatibility (launcher.sh)

  • Added runtime preparation helpers for macOS:
    • Docker path normalization
    • Compose detection
    • Docker daemon wait logic
    • Homebrew/package ensure helpers
    • Runtime selection/bring-up helpers for Docker Desktop and Colima
  • Simplified runtime prompt flow to go directly to runtime selection when Docker daemon is down.
  • Added Colima architecture guard for Apple Silicon:
    • Detects x86_64 Colima profile on arm64 host
    • Offers guided recreation to arm64 (aarch64) to prevent image format failures
  • Fixed stdin restoration logic for non-interactive commands (help/status/...) so /dev/tty errors do not occur in command mode.
  • Fixed password generation portability on macOS by forcing LC_ALL=C for /dev/urandom filtering.

Setup robustness improvements

  • Added provider-specific API key minimum-length validation in wizard step:
    • OpenRouter >= 32 chars
    • Z.ai >= 20 chars
  • Prevents late container crash loops due to short placeholder keys by failing fast in the wizard.

reconFTW and Kali deployment hardening

reconFTW MCP fixes applied

  1. Force linux/amd64 for reconFTW service on ARM hosts.
  2. Patch reconFTW Dockerfile base image line to FROM --platform=linux/amd64 ... on ARM.
  3. Patch reconFTW Dockerfile venv creation to fallback to virtualenv if ensurepip fails.
  4. Force SSE defaults for MCP services so health checks and transport mode match (/sse).
  5. Extend recon health timings for ARM/emulation startup.
  6. Patch recon entrypoint startup path to avoid heavy auto-bootstrap during service start:
    • auto-discover existing reconftw.sh
    • skip reconftw/install.sh by default unless RECONFTW_AUTO_INSTALL=true
  7. Explicitly inject RECONFTW_AUTO_INSTALL=false in WEB compose recon service environment.

Kali MCP fixes applied

  1. Patch Kali command block to a robust single-line bash -lc startup command (avoids multiline parsing issues).
  2. Keep package install deterministic and verify core binaries (nmap, hydra, python3) after install.

Docs (README.md)

  • Updated quick-start to reflect installer bootstrap usage.
  • Clarified macOS runtime options (Docker Desktop or Colima).
  • Added troubleshooting and runtime-choice guidance for macOS users.
  • Added explicit macOS MCP compatibility notes for reconFTW/Kali and targeted rebuild instructions.
  • Added non-macOS regression-risk notes.

Validation done locally (macOS Apple Silicon)

Executed clean install tests in isolated target directory:

  • BUGTRACEAI_DIR=/Users/mperezrodriguez/bugtraceai/_fresh_install ./launcher.sh
  • Selected full mode and exercised runtime/dependency recovery paths.
  • Confirmed API key validation catches too-short keys during wizard.
  • Confirmed WEB + CLI core services healthy.
  • Reproduced and fixed reconFTW deployment issues iteratively from real user logs:
    • amd64 manifest mismatch
    • Python venv ensurepip failure
    • startup timeout/unhealthy behavior
  • Reproduced and fixed Kali startup command parsing issue from real user logs.

Syntax checks:

  • bash -n install.sh
  • bash -n launcher.sh

Regression risk assessment

  • Low expected risk for non-macOS/Linux users:
    • most behavior is macOS/ARM-gated
    • recon/Kali changes apply only when optional MCP profiles are enabled
  • Maintenance risk exists if upstream compose/Dockerfile/entrypoint structure changes significantly; launcher patch anchors may need adjustment.

Notes

  • This PR intentionally keeps existing structure and command UX, while improving compatibility and first-run resilience for macOS users.

@Acorzo1983 Acorzo1983 marked this pull request as ready for review March 15, 2026 10:44
@Acorzo1983 Acorzo1983 requested a review from Copilot March 15, 2026 11:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the macOS (Apple Silicon) first-time install and runtime flow by enhancing installer bootstrapping, adding macOS runtime helpers (Docker Desktop/Colima), and hardening optional MCP deployments (reconFTW/Kali) to avoid common ARM-related failures.

Changes:

  • Reworked install.sh to be user-target aware and support macOS dependency bootstrapping via Homebrew.
  • Extended launcher.sh with macOS runtime preparation (PATH/compose detection/daemon wait) and Colima/Docker Desktop bring-up helpers.
  • Added reconFTW/Kali MCP “compat patch” hooks (platform pinning, venv/entrypoint patches, startup command rewrite, SSE defaulting, and longer health timeouts on ARM).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
launcher.sh Adds macOS runtime bootstrap helpers and applies MCP compatibility patches for reconFTW/Kali on ARM/macOS.
install.sh Updates one-liner bootstrap to run as the target user, install prerequisites, clone/update launcher, and hand off to the wizard.
README.md Updates quick-start and macOS guidance to reflect Docker Desktop vs Colima and new bootstrap behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +355 to +362
ensure_macos_docker_path() {
for p in "$HOME/.docker/bin" "/usr/local/bin" "/opt/homebrew/bin"; do
if [[ -x "$p/docker" ]]; then
export PATH="$p:$PATH"
fi
done
hash -r
}
return 1
fi
info "Installing Docker Desktop..."
brew install --cask docker
return 1
fi

ensure_macos_brew_packages docker docker-compose colima qemu lima-additional-guestagents
Comment on lines +232 to +245
BEGIN { in_kali=0; in_cmd=0 }
/^ kali-mcp:[[:space:]]*$/ { in_kali=1; print; next }
in_kali && /^ [^[:space:]]/ { in_kali=0 }
in_kali && /^[[:space:]]+command:[[:space:]]*>[[:space:]]*$/ {
in_cmd=1
print " command: >"
print " bash -lc \"set -e; echo '\''Waiting for network initialization...'\''; sleep 5; apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -y nmap ffuf nuclei sqlmap dirb gobuster nikto hydra john hashcat curl wget netcat-openbsd python3 python3-pip git vim; command -v nmap hydra python3 >/dev/null; echo '\''Kali MCP Server ready!'\''; tail -f /dev/null\""
next
}
in_cmd {
if (in_kali && /^[[:space:]]+(extra_hosts:|restart:|networks:|ports:|volumes:|environment:|cap_add:|security_opt:|profiles:|container_name:|image:)/) {
in_cmd=0
print
}
info "Checking system requirements..."
echo ""
TARGET_USER="${SUDO_USER:-$USER}"
TARGET_HOME="$(eval echo "~$TARGET_USER")"

chmod +x "$LAUNCHER_DIR/launcher.sh"
info "Cloning BugTraceAI Launcher into $LAUNCHER_DIR..."
mkdir -p "$(dirname "$LAUNCHER_DIR")"

fix_permissions_if_needed() {
if [[ $EUID -eq 0 ]] && [[ -n "${SUDO_USER:-}" ]]; then
chown -R "$TARGET_USER":"$TARGET_USER" "$LAUNCHER_DIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants