Trust forwarded IPs from the host proxy

This commit is contained in:
2026-08-25 01:53:11 +00:00
parent 7f85db6689
commit f5aab65ff4
3 changed files with 17 additions and 0 deletions
+9
View File
@@ -2,6 +2,15 @@
# Start a compiled program.
set -eu
if [ "${TRUST_HOST_PROXY:-0}" = "1" ]; then
proxy_ip="$(getent ahostsv4 host.docker.internal | sed -n '1{s/[[:space:]].*//;p;}')"
if [ -z "$proxy_ip" ]; then
echo "Cannot resolve the trusted Docker host gateway." >&2
exit 1
fi
export FORWARDED_ALLOW_IPS="127.0.0.1,$proxy_ip"
fi
if [ "${1:-}" = "drivershub" ]; then
shift
exec /app/drivershub "$@"