29 lines
1.2 KiB
Bash
29 lines
1.2 KiB
Bash
#!/bin/sh
|
|||
|
|
# Force cursor-agent (and its child processes) through the pod's loopback
|
||
|
|
# HTTP-CONNECT proxy bridge (devbox-proxy-bridge.js, started by /entrypoint.sh),
|
||
|
|
# which forwards to node2's SOCKS5 egress.
|
||
|
|
#
|
||
|
|
# Why: the Bun-based cursor-agent honors HTTP(S)_PROXY only for http://-scheme
|
||
|
|
# URLs and silently ignores socks5(h):// values — with the pod's socks5h env
|
||
|
|
# it would egress directly. This wrapper shadows ~/.local/bin/cursor-agent via
|
||
|
|
# PATH precedence (/usr/local/bin comes first).
|
||
|
|
#
|
||
|
|
# Local and cluster-internal destinations stay direct via NO_PROXY. If the
|
||
|
|
# bridge is down, the agent fails loudly (proxy-unreachable) instead of
|
||
|
|
# silently leaking direct traffic. No bypass flag by design.
|
||
|
|
set -eu
|
||
|
|
|
||
|
|
REAL=/home/developer/.local/bin/cursor-agent
|
||
|
|
if [ ! -x "$REAL" ]; then
|
||
|
|
echo "cursor-agent wrapper: $REAL is not installed (install cursor-agent first)" >&2
|
||
|
|
exit 127
|
||
|
|
fi
|
||
|
|
|
||
|
|
BRIDGE=http://127.0.0.1:8118
|
||
|
|
export HTTP_PROXY="$BRIDGE" HTTPS_PROXY="$BRIDGE" ALL_PROXY="$BRIDGE"
|
||
|
|
export http_proxy="$BRIDGE" https_proxy="$BRIDGE" all_proxy="$BRIDGE"
|
||
|
|
export NO_PROXY="localhost,127.0.0.1,::1,.svc,.svc.cluster.local,.svc.clusterset.local"
|
||
|
|
export no_proxy="$NO_PROXY"
|
||
|
|
|
||
|
|
exec "$REAL" "$@"
|