fix: EleventyFetch undefined + NAT hairpin on build runner
Build & Deploy / build-and-deploy (push) Successful in 2m5s

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.
This commit is contained in:
svemagie
2026-05-03 13:12:02 +02:00
parent b308471de2
commit e021e7f70b
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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