Skip to content

Commit 0ed312f

Browse files
Mossakaclaude
andcommitted
fix: pass SQUID_PROXY_HOST/PORT to init container for DNS resolution
setup-iptables.sh reads SQUID_PROXY_HOST (not AWF_SQUID_HOST), but the init container only passed AWF_SQUID_HOST. Since the init container uses network_mode: service:agent, it may not have DNS resolution for compose service names, causing getent hosts to fail and the script to exit before writing the ready signal. Use the direct IP address to avoid DNS issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6bc5d54 commit 0ed312f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/docker-manager.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,11 @@ export function generateDockerCompose(
10651065
],
10661066
environment: {
10671067
// Pass through environment variables needed by setup-iptables.sh
1068-
AWF_SQUID_HOST: environment.AWF_SQUID_HOST || `${networkConfig.squidIp}`,
1069-
AWF_SQUID_PORT: String(SQUID_PORT),
1068+
// IMPORTANT: setup-iptables.sh reads SQUID_PROXY_HOST/PORT (not AWF_ prefixed).
1069+
// Use the direct IP address since the init container (network_mode: service:agent)
1070+
// may not have DNS resolution for compose service names.
1071+
SQUID_PROXY_HOST: `${networkConfig.squidIp}`,
1072+
SQUID_PROXY_PORT: String(SQUID_PORT),
10701073
AWF_DNS_SERVERS: environment.AWF_DNS_SERVERS || '',
10711074
AWF_BLOCKED_PORTS: environment.AWF_BLOCKED_PORTS || '',
10721075
AWF_ENABLE_HOST_ACCESS: environment.AWF_ENABLE_HOST_ACCESS || '',

0 commit comments

Comments
 (0)