Skip to content

Commit 9878ab6

Browse files
committed
Fix CI: remove diagnostic step (port conflict), show entrypoint errors
The diagnostic step ran Squid on port 3128 for 5 seconds before the actual test container, likely causing a port conflict. Removed it. Also: - docker-entrypoint.sh: Stop hiding squid -z stderr (was 2>/dev/null) - Increase container startup wait from 3s to 5s - Increase port-open timeout from 15s to 30s https://claude.ai/code/session_01Tfy3kPd51qRgxpCFXjb2g9
1 parent a9070db commit 9878ab6

2 files changed

Lines changed: 5 additions & 44 deletions

File tree

.github/workflows/squid-build-test.yml

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -190,37 +190,13 @@ jobs:
190190
echo "--- Config ---"
191191
cat /tmp/squid-conf/squid.conf
192192
193-
- name: Diagnose Squid startup
194-
run: |
195-
echo "=== Parse test ==="
196-
docker run --rm --network host \
197-
-v /tmp/squid-conf:/etc/squid/conf.d:ro \
198-
--entrypoint squid \
199-
${{ env.SQUID_IMAGE }} \
200-
-k parse -f /etc/squid/conf.d/squid.conf 2>&1 || true
201-
echo ""
202-
echo "=== Dry-run entrypoint ==="
203-
docker run --rm --network host \
204-
-v /tmp/squid-conf:/etc/squid/conf.d:ro \
205-
-e SQUID_CONFIG_FILE=/etc/squid/conf.d/squid.conf \
206-
--entrypoint /bin/sh \
207-
${{ env.SQUID_IMAGE }} \
208-
-c '
209-
set -x
210-
cat "$SQUID_CONFIG_FILE"
211-
squid -z -N -f "$SQUID_CONFIG_FILE" 2>&1 || echo "squid -z exit: $?"
212-
ls -la /var/cache/squid/ /var/log/squid/ /var/run/squid/ 2>&1
213-
chown -R squid:squid /var/cache/squid /var/log/squid /var/run/squid 2>&1 || true
214-
timeout 5 gosu squid squid -N -X -d5 -f "$SQUID_CONFIG_FILE" 2>&1 || echo "squid exit: $?"
215-
'
216-
217193
- name: Start Squid with SOCKS5 peer
218194
run: |
219195
docker run -d --name squid-test --network host \
220196
-v /tmp/squid-conf:/etc/squid/conf.d:ro \
221197
-e SQUID_CONFIG_FILE=/etc/squid/conf.d/squid.conf \
222198
${{ env.SQUID_IMAGE }}
223-
sleep 3
199+
sleep 5
224200
echo "=== Container status ==="
225201
docker ps -a --filter name=squid-test --format '{{.Status}}'
226202
if ! docker ps --filter name=squid-test --filter status=running -q | grep -q .; then
@@ -234,7 +210,7 @@ jobs:
234210
- name: Wait for Squid to listen
235211
run: |
236212
echo "Waiting for Squid to listen on port 3128..."
237-
for i in $(seq 1 15); do
213+
for i in $(seq 1 30); do
238214
if bash -c 'echo > /dev/tcp/127.0.0.1/3128' 2>/dev/null; then
239215
echo "Squid is listening after ${i}s"
240216
exit 0
@@ -352,28 +328,13 @@ jobs:
352328
echo "--- Config ---"
353329
cat /tmp/squid-conf-auth/squid.conf
354330
355-
- name: Diagnose Squid startup
356-
run: |
357-
echo "=== Dry-run entrypoint ==="
358-
docker run --rm --network host \
359-
-v /tmp/squid-conf-auth:/etc/squid/conf.d:ro \
360-
-e SQUID_CONFIG_FILE=/etc/squid/conf.d/squid.conf \
361-
--entrypoint /bin/sh \
362-
${{ env.SQUID_IMAGE }} \
363-
-c '
364-
set -x
365-
squid -z -N -f "$SQUID_CONFIG_FILE" 2>&1 || echo "squid -z exit: $?"
366-
chown -R squid:squid /var/cache/squid /var/log/squid /var/run/squid 2>&1 || true
367-
timeout 5 gosu squid squid -N -X -d5 -f "$SQUID_CONFIG_FILE" 2>&1 || echo "squid exit: $?"
368-
'
369-
370331
- name: Start Squid with SOCKS5 auth peer
371332
run: |
372333
docker run -d --name squid-auth --network host \
373334
-v /tmp/squid-conf-auth:/etc/squid/conf.d:ro \
374335
-e SQUID_CONFIG_FILE=/etc/squid/conf.d/squid.conf \
375336
${{ env.SQUID_IMAGE }}
376-
sleep 3
337+
sleep 5
377338
echo "=== Container status ==="
378339
docker ps -a --filter name=squid-auth --format '{{.Status}}'
379340
if ! docker ps --filter name=squid-auth --filter status=running -q | grep -q .; then
@@ -386,7 +347,7 @@ jobs:
386347
387348
- name: Wait for Squid to listen
388349
run: |
389-
for i in $(seq 1 15); do
350+
for i in $(seq 1 30); do
390351
if bash -c 'echo > /dev/tcp/127.0.0.1/3128' 2>/dev/null; then
391352
echo "Squid is listening after ${i}s"
392353
exit 0

squid_patch/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SQUID_CONFIG_FILE="${SQUID_CONFIG_FILE:-/etc/squid/squid.conf}"
66
# Initialize cache directory if needed
77
if [ ! -d /var/cache/squid/00 ]; then
88
echo "Initializing Squid cache..."
9-
squid -z -N -f "${SQUID_CONFIG_FILE}" 2>/dev/null || true
9+
squid -z -N -f "${SQUID_CONFIG_FILE}" 2>&1 || echo "Warning: squid -z failed (may be OK if cache is unused)"
1010
fi
1111

1212
# Ensure proper ownership

0 commit comments

Comments
 (0)