From ab6e08dd13175fda82fdd1b2c49b2ff2ffa24282 Mon Sep 17 00:00:00 2001 From: serinko <97586125+serinko@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:27:38 +0100 Subject: [PATCH] fix logic of landing-page lookup --- .../nym-node-setup/setup-nginx-proxy-wss.sh | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/nym-node-setup/setup-nginx-proxy-wss.sh b/scripts/nym-node-setup/setup-nginx-proxy-wss.sh index 4b0fae6bda..b72cf6ed24 100644 --- a/scripts/nym-node-setup/setup-nginx-proxy-wss.sh +++ b/scripts/nym-node-setup/setup-nginx-proxy-wss.sh @@ -48,17 +48,25 @@ rm -f "${HTTP_CONF}" || true rm -f "${HTTPS_CONF}" || true rm -f "${WSS_CONF}" || true -################################################################################ -# step 2: landing page -################################################################################ +############################################################################### +# step 2: create landing page +############################################################################### mkdir -p "${WEBROOT}" -if ! curl -fsSL \ - https://raw.githubusercontent.com/nymtech/nym/develop/scripts/nym-node-setup/landing-page.html \ - -o "${WEBROOT}/index.html"; then +# script directory where Python CLI stores fetched scripts +SCRIPT_DIR="$(dirname "${ENV_FILE:-./env.sh}")" +LOCAL_FETCHED_PAGE="${SCRIPT_DIR}/landing-page.html" - cat > "${WEBROOT}/index.html" <<'EOF' +if [[ -s "${LOCAL_FETCHED_PAGE}" ]]; then + cp "${LOCAL_FETCHED_PAGE}" "${WEBROOT}/index.html" +else + if curl -fsSL \ + https://raw.githubusercontent.com/nymtech/nym/develop/scripts/nym-node-setup/landing-page.html \ + -o "${WEBROOT}/index.html"; then + : + else + cat > "${WEBROOT}/index.html" < nym node @@ -69,11 +77,13 @@ if ! curl -fsSL \ EOF - + fi fi echo "landing page at ${WEBROOT}/index.html" +echo "landing page at ${WEBROOT}/index.html" + ################################################################################ # step 3: HTTP :80 config ################################################################################