Skip to content

Commit b387976

Browse files
lpcoxCopilot
andcommitted
fix: remove CA cert poll loop, update stale flag comments
The CA cert is now a bind mount (not generated at runtime by mcpg), so it's immediately available at container start. Replace the 30s polling loop with a single existence check for faster startup. Also update stale comments referencing --enable-cli-proxy to --difc-proxy-host in setup-iptables.sh and gh-cli-proxy-wrapper.sh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 755c2a7 commit b387976

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

containers/agent/gh-cli-proxy-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# /usr/local/bin/gh-cli-proxy-wrapper
33
# Forwards gh CLI invocations to the CLI proxy sidecar over HTTP.
44
# This wrapper is installed at /usr/local/bin/gh in the agent container
5-
# when --enable-cli-proxy is active, so it takes precedence over any
5+
# when --difc-proxy-host is active, so it takes precedence over any
66
# host-mounted gh binary at /host/usr/bin/gh.
77
#
88
# Dependencies: curl, jq (both available in the agent container)

containers/agent/setup-iptables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if [ -n "$AWF_API_PROXY_IP" ]; then
174174
fi
175175

176176
# Allow traffic to CLI proxy sidecar (when enabled)
177-
# AWF_CLI_PROXY_IP is set by docker-manager.ts when --enable-cli-proxy is used
177+
# AWF_CLI_PROXY_IP is set by docker-manager.ts when --difc-proxy-host is used
178178
if [ -n "$AWF_CLI_PROXY_IP" ]; then
179179
echo "[iptables] Allow traffic to CLI proxy sidecar (${AWF_CLI_PROXY_IP})..."
180180
iptables -t nat -A OUTPUT -d "$AWF_CLI_PROXY_IP" -j RETURN

containers/cli-proxy/entrypoint.sh

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,16 @@ echo "[cli-proxy] Starting TCP tunnel: localhost:${DIFC_PORT} → ${DIFC_HOST}:$
2424
node /app/tcp-tunnel.js "${DIFC_PORT}" "${DIFC_HOST}" "${DIFC_PORT}" &
2525
TUNNEL_PID=$!
2626

27-
# Wait for CA cert to appear (mounted from host by docker-manager.ts)
28-
echo "[cli-proxy] Waiting for DIFC proxy TLS certificate..."
29-
i=0
30-
while [ $i -lt 30 ]; do
31-
if [ -f /tmp/proxy-tls/ca.crt ]; then
32-
echo "[cli-proxy] TLS certificate available"
33-
break
34-
fi
35-
sleep 1
36-
i=$((i + 1))
37-
done
38-
27+
# Verify CA cert is available (bind-mounted from host by docker-manager.ts).
28+
# Unlike the old architecture where mcpg generated the cert at runtime, the
29+
# external DIFC proxy has already created the cert before AWF starts, so the
30+
# bind mount makes it immediately available — no polling needed.
3931
if [ ! -f /tmp/proxy-tls/ca.crt ]; then
40-
echo "[cli-proxy] ERROR: DIFC proxy TLS certificate not found within 30s"
41-
echo "[cli-proxy] Ensure --difc-proxy-ca-cert points to a valid CA cert file"
32+
echo "[cli-proxy] ERROR: DIFC proxy TLS certificate not found at /tmp/proxy-tls/ca.crt"
33+
echo "[cli-proxy] Ensure --difc-proxy-ca-cert points to a valid CA cert file on the host"
4234
exit 1
4335
fi
36+
echo "[cli-proxy] TLS certificate available"
4437

4538
# Configure gh CLI to route through the DIFC proxy via the TCP tunnel
4639
# Uses localhost because the tunnel makes the DIFC proxy appear on localhost,

0 commit comments

Comments
 (0)