Files
s41r4j-cybot/scripts/toolbox-entrypoint.sh
T
s41r4j 0f03d49514
CI / contracts (push) Canceled after 0s
Website / deploy (push) Canceled after 0s
CI / test (macos-latest) (push) Canceled after 0s
CI / test (ubuntu-24.04) (push) Canceled after 0s
CI / test (ubuntu-24.04-arm) (push) Canceled after 0s
CI / test (windows-latest) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / operation-readiness (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
Initial commit
2026-11-01 09:14:18 +05:30

57 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
trivy_cache="${TRIVY_CACHE_DIR:-/home/cybot/.cache/trivy}"
trivy_bundled="${TRIVY_BUNDLED_CACHE_DIR:-/opt/cybot/share/trivy-cache}"
mkdir -p "$trivy_cache"
if [[ ! -f "$trivy_cache/db/metadata.json" ]]; then
if [[ -e "$trivy_cache/db" || -L "$trivy_cache/db" ]]; then
echo "Trivy runtime cache contains an incomplete db entry: $trivy_cache/db" >&2
exit 1
fi
ln -s "$trivy_bundled/db" "$trivy_cache/db"
fi
case "${1:-help}" in
help)
cat <<'EOF'
CYBOT Toolbox
cybot-toolbox help Show this help
cybot-toolbox health Check every installed binary
cybot-toolbox versions Print the pinned lock manifest
cybot-toolbox shell Open an interactive shell
cybot-toolbox cybot ... Run the CYBOT CLI
cybot-toolbox exec ... Run an internal tool (normally CYBOT does this)
Mount authorized targets read-only at /data and reports at /reports.
EOF
;;
health)
shift
exec /usr/local/bin/cybot-toolbox-health "$@"
;;
versions)
exec jq . /opt/cybot/manifest/tool-versions.lock.json
;;
shell)
exec /bin/bash
;;
cybot)
shift
exec /opt/cybot/bin/cybot "$@"
;;
exec)
shift
if [[ $# -eq 0 ]]; then
echo "exec requires a command" >&2
exit 2
fi
exec "$@"
;;
*)
echo "unknown toolbox command: $1" >&2
exit 2
;;
esac