Skip to content

Commit a31703d

Browse files
CopilotPDowney
andcommitted
Improve IP detection error message and fix undefined DOMAIN variable in configure_redis
Co-authored-by: PDowney <[email protected]> Agent-Logs-Url: https://github.com/EngineScript/EngineScript/sessions/f77b175b-21d9-4bf1-893f-59d120f85b1f
1 parent ce933ce commit a31703d

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

scripts/functions/shared/enginescript-shared-vhost.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,19 @@ configure_cloudflare_settings() {
250250

251251
# Validate backup IP
252252
if ! [[ "$SERVER_IP" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
253-
echo "ERROR: Could not obtain valid IP address from any source"
254-
echo "Received: ${SERVER_IP}"
253+
echo "ERROR: Could not obtain valid IP address from any source."
254+
echo "Received response: ${SERVER_IP}"
255+
echo ""
256+
echo "Troubleshooting suggestions:"
257+
echo " 1) Verify this server has internet connectivity:"
258+
echo " - ping -c 3 8.8.8.8"
259+
echo " - curl -I https://www.google.com"
260+
echo " 2) Ensure outbound HTTPS (TCP port 443) is allowed in any firewall/security group."
261+
echo " 3) Check DNS resolution for the IP services:"
262+
echo " - dig +short ipinfo.io"
263+
echo " - dig +short icanhazip.com"
264+
echo " 4) If using a proxy or restrictive network, allow access to ipinfo.io and icanhazip.com."
265+
echo " 5) After fixing connectivity, re-run this installation script."
255266
exit 1
256267
fi
257268
fi
@@ -666,7 +677,7 @@ configure_redis() {
666677
fi
667678

668679
# Set Redis Prefix
669-
REDISPREFIX="es_$(printf '%s' "${DOMAIN}" | sha1sum | cut -c1-12)"
680+
REDISPREFIX="es_$(printf '%s' "${SITE_URL}" | sha1sum | cut -c1-12)"
670681
sed -i "s|SEDREDISPREFIX|${REDISPREFIX}|g" "${WP_CONFIG_PATH}"
671682
}
672683

0 commit comments

Comments
 (0)