Installer: support Forgejo as catalog source; NPM dashboard bound to internal IP

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Ezequiel C. 2026-09-11 00:02:49 +02:00
parent d66db4e85e
commit 3c994af96b
4 changed files with 27 additions and 4 deletions

View file

@ -7,11 +7,14 @@ import { parseAndValidate } from "./metadata.ts";
const UA = "homelab-installer/1.0";
function rawUrl(cfg: Config, path: string): string {
return `https://raw.githubusercontent.com/${cfg.owner}/${cfg.repo}/${cfg.branch}/${path}`;
if (cfg.forgejo) {
return `${cfg.rawBase}/${cfg.owner}/${cfg.repo}/raw/branch/${cfg.branch}/${path}`;
}
return `${cfg.rawBase}/${cfg.owner}/${cfg.repo}/${cfg.branch}/${path}`;
}
function apiUrl(cfg: Config, path: string): string {
return `https://api.github.com/repos/${cfg.owner}/${cfg.repo}/${path}`;
return `${cfg.apiBase}/repos/${cfg.owner}/${cfg.repo}/${path}`;
}
function authHeaders(cfg: Config, scheme: "token" | "bearer"): Record<string, string> {