Skip to content

Commit 77fb6d2

Browse files
author
Kevin Wang
committed
fix(dstack-ingress): bind the evidence server to loopback
1 parent 35687f8 commit 77fb6d2

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

custom-domain/dstack-ingress/scripts/entrypoint.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,22 @@ fi
404404

405405
# Start evidence HTTP server if enabled
406406
if [ "$EVIDENCE_SERVER" = "true" ]; then
407-
mini_httpd -d /evidences -p "${EVIDENCE_PORT}" -D -l /dev/stderr &
408-
echo "Evidence server started on port ${EVIDENCE_PORT} (mini_httpd)"
407+
# Bind loopback explicitly, for two reasons.
408+
#
409+
# Correctness of the logs: left to itself mini_httpd binds [::]:port first,
410+
# and since the container has net.ipv6.bindv6only=0 that socket already
411+
# covers IPv4, so its second bind on 0.0.0.0:port fails with EADDRINUSE. It
412+
# logs "bind: Address already in use", keeps serving on the surviving
413+
# socket, and leaves a scary line in the log forever.
414+
#
415+
# Reach: the only consumer is haproxy's be_evidence backend, which connects
416+
# to 127.0.0.1:${EVIDENCE_PORT}. Listening on every interface additionally
417+
# exposed the evidence server to any other container on the compose
418+
# network at ingress:${EVIDENCE_PORT}, bypassing the proxy. Nothing
419+
# documented depends on that; evidence is meant to be read through
420+
# https://<domain>/evidences/ or the shared /evidences volume.
421+
mini_httpd -d /evidences -p "${EVIDENCE_PORT}" -h 127.0.0.1 -D -l /dev/stderr &
422+
echo "Evidence server started on 127.0.0.1:${EVIDENCE_PORT} (mini_httpd)"
409423
fi
410424

411425
# One process owns certificates from here on: first pass (tls-alpn-01, where it

0 commit comments

Comments
 (0)