From e021e7f70be8e3aea0dc3aa6c52b3ddd4570c88e Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 3 May 2026 13:12:02 +0200 Subject: [PATCH] fix: EleventyFetch undefined + NAT hairpin on build runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit githubActivity.js: replace bare EleventyFetch() calls with cachedFetch() (imported wrapper) — EleventyFetch was never imported directly. recentComments, githubStarred, youtubeChannel: use INDIEKIT_URL env var (http://10.100.0.20:3000) instead of SITE_URL (public IP 46.225.0.216). Build runner on Gitea jail cannot reach its own public IP via NAT. INDIEKIT_URL is already set in deploy.yml; SITE_URL fallback preserved. --- _data/githubActivity.js | 4 ++-- _data/githubStarred.js | 2 +- _data/recentComments.js | 2 +- _data/youtubeChannel.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_data/githubActivity.js b/_data/githubActivity.js index 48a5f95..7d87878 100644 --- a/_data/githubActivity.js +++ b/_data/githubActivity.js @@ -27,7 +27,7 @@ async function fetchGiteaCommits() { try { const url = `${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${repo}/commits?limit=15`; console.log(`[giteaActivity] Fetching commits: ${url}`); - const commits = await EleventyFetch(url, { duration: "15m", type: "json" }); + const commits = await cachedFetch(url, { duration: "15m", type: "json" }); for (const c of Array.isArray(commits) ? commits : []) { const msg = (c.commit?.message || "").split("\n")[0]; @@ -52,7 +52,7 @@ async function fetchGiteaCommits() { async function fetchGiteaFeatured() { try { const url = `${GITEA_URL}/api/v1/orgs/${GITEA_ORG}/repos?limit=10&sort=newest`; - const repos = await EleventyFetch(url, { duration: "15m", type: "json" }); + const repos = await cachedFetch(url, { duration: "15m", type: "json" }); return (Array.isArray(repos) ? repos : []) .filter((r) => !r.fork && !r.private) diff --git a/_data/githubStarred.js b/_data/githubStarred.js index ae45b49..16016f2 100644 --- a/_data/githubStarred.js +++ b/_data/githubStarred.js @@ -8,7 +8,7 @@ import { cachedFetch } from "../lib/data-fetch.js"; -const INDIEKIT_URL = process.env.SITE_URL || "https://example.com"; +const INDIEKIT_URL = process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com"; export default async function () { try { diff --git a/_data/recentComments.js b/_data/recentComments.js index 0f9edda..5b3cc65 100644 --- a/_data/recentComments.js +++ b/_data/recentComments.js @@ -5,7 +5,7 @@ import { cachedFetch } from "../lib/data-fetch.js"; -const INDIEKIT_URL = process.env.SITE_URL || "https://example.com"; +const INDIEKIT_URL = process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com"; export default async function () { try { diff --git a/_data/youtubeChannel.js b/_data/youtubeChannel.js index 81be351..97d0e94 100644 --- a/_data/youtubeChannel.js +++ b/_data/youtubeChannel.js @@ -6,7 +6,7 @@ import { cachedFetch } from "../lib/data-fetch.js"; -const INDIEKIT_URL = process.env.SITE_URL || "https://example.com"; +const INDIEKIT_URL = process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com"; /** * Fetch from Indiekit's public YouTube API endpoint