2026-09-21 10:31:36 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
# Container entrypoint: run cursor-agent bootstrap, then start the proxy.
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
2026-10-23 10:11:39 +00:00
|
|
|
# Enforce the sandbox cli-config (force-rewrites runtime/PVC drift back to
|
|
|
|
|
# the deny-all policy on every boot) and verify the cursor-agent binary.
|
2026-09-21 10:31:36 +03:00
|
|
|
/app/scripts/bootstrap-cursor.sh
|
|
|
|
|
|
2026-10-23 10:11:39 +00:00
|
|
|
# Ensure the sandboxed agent HOME exists and is writable by uid 65533
|
|
|
|
|
# (the agent children run with a dedicated uid when supported). Best-effort:
|
|
|
|
|
# in Kubernetes the emptyDir is fsGroup-chowned; in local docker the image's
|
|
|
|
|
# ownership applies only if the directory was not replaced by a volume.
|
|
|
|
|
if [[ -n "${CURSOR_AGENT_HOME:-}" ]]; then
|
|
|
|
|
mkdir -p "${CURSOR_AGENT_HOME}" 2>/dev/null || true
|
|
|
|
|
chmod 777 "${CURSOR_AGENT_HOME}" 2>/dev/null || true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Session workdirs and MCP sockets live in /tmp (readOnlyRootFilesystem
|
|
|
|
|
# deployments mount an emptyDir there). Same best-effort widening for the
|
|
|
|
|
# agent child processes.
|
|
|
|
|
chmod 1777 /tmp 2>/dev/null || true
|
|
|
|
|
|
2026-11-06 08:32:36 +00:00
|
|
|
# The HTTP server. A warm pool keeps bootstrapped ACP processes ready;
|
|
|
|
|
# each request still opens session/new with request-specific MCP tools.
|
2026-09-21 10:31:36 +03:00
|
|
|
exec node /app/src/server.mjs
|