fix(startup): use configurable bind host instead of hardcoded 127.0.0.1

FreeBSD jails often don't have loopback available. The webmention poller
and readiness check now use INDIEKIT_BIND_HOST (defaults to 127.0.0.1
for backward compat). Set INDIEKIT_BIND_HOST=10.100.0.20 in .env.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sven
2026-03-17 16:09:57 +01:00
parent 42db9d85b6
commit cc1edd81a8

View File

@@ -62,14 +62,15 @@ INDIEKIT_PID="$!"
# Webmention sender — polls every 5 minutes (see @rmdes/indiekit-endpoint-webmention-sender README)
WEBMENTION_POLL_INTERVAL="${WEBMENTION_SENDER_POLL_INTERVAL:-300}"
WEBMENTION_ENDPOINT="http://127.0.0.1:${PORT:-3000}${WEBMENTION_SENDER_MOUNT_PATH:-/webmention-sender}"
INDIEKIT_LOCAL_URL="http://${INDIEKIT_BIND_HOST:-127.0.0.1}:${PORT:-3000}"
WEBMENTION_ENDPOINT="${INDIEKIT_LOCAL_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 "http://127.0.0.1:${PORT:-3000}/status" -o /dev/null 2>&1; do
until curl -sf "${INDIEKIT_LOCAL_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