From 8402646cf04ed1557bb8d4f015bd844e91e0f462 Mon Sep 17 00:00:00 2001 From: shinobi133 Date: Sat, 20 Jun 2026 18:10:50 +0100 Subject: [PATCH] fix: respect BASE_NODE_P2P_ADVERTISE_IP environment variable (#1107) Prevents public IP discovery from overriding an explicitly set BASE_NODE_P2P_ADVERTISE_IP and stops the container from exiting if discovery fails when the IP is already provided. --- consensus-entrypoint | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/consensus-entrypoint b/consensus-entrypoint index 05b89467a..6a4751e8d 100755 --- a/consensus-entrypoint +++ b/consensus-entrypoint @@ -46,13 +46,18 @@ until [ "$(curl -s --max-time 10 --connect-timeout 5 -w '%{http_code}' -o /dev/n sleep 5 done -if PUBLIC_IP=$(get_public_ip); then - echo "fetched public IP is: $PUBLIC_IP" +if [[ -z "${BASE_NODE_P2P_ADVERTISE_IP:-}" ]]; then + if PUBLIC_IP=$(get_public_ip); then + echo "fetched public IP is: $PUBLIC_IP" + export BASE_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP + else + echo "Could not retrieve public IP and BASE_NODE_P2P_ADVERTISE_IP is not set." + exit 8 + fi else - echo "Could not retrieve public IP." - exit 8 + echo "Using explicitly configured BASE_NODE_P2P_ADVERTISE_IP: $BASE_NODE_P2P_ADVERTISE_IP" fi -export BASE_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP + echo "$BASE_NODE_L2_ENGINE_AUTH_RAW" > "$BASE_NODE_L2_ENGINE_AUTH"