#!/usr/bin/env bash # Container entrypoint. Two modes: # - default ("supervisor"): launch the desktop + Ghidra + MCP bridge # - anything else: exec the given command (used by `docker compose run` for # headless analysis, interactive shells, etc.) set -euo pipefail # Ensure the Ghidra project / output trees exist and are writable by our user. mkdir -p /data/work /data/output /home/chip/.vnc # (Re)create the VNC password file from $VNC_PASSWORD (default: chiprev). VNC_PASSWORD="${VNC_PASSWORD:-chiprev}" if [ ! -f /home/chip/.vnc/passwd ]; then x11vnc -storepasswd "${VNC_PASSWORD}" /home/chip/.vnc/passwd >/dev/null 2>&1 fi if [ "${1:-}" = "supervisor" ] || [ "$#" -eq 0 ]; then exec /usr/bin/supervisord -c /opt/conf/supervisord.conf fi # Pass-through: headless analyze, shell, one-off tools, etc. exec "$@"