fix: EleventyFetch undefined + NAT hairpin on build runner
Build & Deploy / build-and-deploy (push) Successful in 2m5s
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:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user