From 8b35fc13fd9b87cb12593c189aa90729b5885f3f Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 17 Mar 2026 16:45:12 +0100 Subject: [PATCH] fix(startup): route webmention poller through nginx via INTERNAL_FETCH_URL Direct connections from the node jail to itself cause empty replies in FreeBSD jails. Route through nginx (INTERNAL_FETCH_URL=http://10.100.0.10) instead, which also provides correct Host and X-Forwarded-Proto headers. Co-Authored-By: Claude Opus 4.6 --- start.example.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/start.example.sh b/start.example.sh index feb5ad9d..ab00e3f6 100644 --- a/start.example.sh +++ b/start.example.sh @@ -60,17 +60,19 @@ done "${NODE_BIN}" node_modules/@indiekit/indiekit/bin/cli.js serve --config indiekit.config.mjs & INDIEKIT_PID="$!" -# Webmention sender — polls every 5 minutes (see @rmdes/indiekit-endpoint-webmention-sender README) +# Webmention sender — polls every N seconds (see @rmdes/indiekit-endpoint-webmention-sender README) +# Routes through INTERNAL_FETCH_URL (nginx) so the request gets correct Host header +# and X-Forwarded-Proto, avoiding empty-reply issues with direct jail connections. WEBMENTION_POLL_INTERVAL="${WEBMENTION_SENDER_POLL_INTERVAL:-300}" -INDIEKIT_LOCAL_URL="http://${INDIEKIT_BIND_HOST:-127.0.0.1}:${PORT:-3000}" -WEBMENTION_ENDPOINT="${INDIEKIT_LOCAL_URL}${WEBMENTION_SENDER_MOUNT_PATH:-/webmention-sender}" +INDIEKIT_INTERNAL_URL="${INTERNAL_FETCH_URL:-http://${INDIEKIT_BIND_HOST:-127.0.0.1}:${PORT:-3000}}" +WEBMENTION_ENDPOINT="${INDIEKIT_INTERNAL_URL}${WEBMENTION_SENDER_MOUNT_PATH:-/webmention-sender}" WEBMENTION_ORIGIN="${PUBLICATION_URL:-${SITE_URL:-}}" ( echo "[webmention] Starting auto-send polling every ${WEBMENTION_POLL_INTERVAL}s (${WEBMENTION_ENDPOINT})" # Wait for indiekit to be ready before first poll (up to 2 minutes) _i=0 - until curl -sf "${INDIEKIT_LOCAL_URL}/status" -o /dev/null 2>&1; do + until curl -sf "${INDIEKIT_INTERNAL_URL}/status" -o /dev/null 2>&1; do _i=$((_i + 1)) [ $_i -lt 60 ] || { echo "[webmention] Warning: indiekit not ready after 120s, proceeding anyway"; break; } sleep 2