Bug Fix: Docker init script now validates DISPATCHARR_PORT is an integer before using it, preventing sed errors when Kubernetes sets it to a service URL like tcp://10.98.37.10:80. Falls back to default port 9191 when invalid (Fixes #737)

This commit is contained in:
SergeantPanda 2025-12-19 17:00:30 -06:00
parent 944736612b
commit f0a9a3fc15
2 changed files with 5 additions and 0 deletions

View file

@ -30,6 +30,10 @@ if [ "$(id -u)" = "0" ] && [ -d "/app" ]; then
fi
fi
# Configure nginx port
if ! [[ "$DISPATCHARR_PORT" =~ ^[0-9]+$ ]]; then
echo "⚠️ Warning: DISPATCHARR_PORT is not a valid integer, using default port 9191"
DISPATCHARR_PORT=9191
fi
sed -i "s/NGINX_PORT/${DISPATCHARR_PORT}/g" /etc/nginx/sites-enabled/default
# Configure nginx based on IPv6 availability