feat: serve the one-line installer from the site

The site serves install.sh at /retrobios/i and install.ps1 at
/retrobios/i.ps1. generate_site.py writes both copies with the
installer address set to install.py at the commit the site is built
from (GITHUB_SHA in CI, HEAD locally), so the pinned SHA-256 and the
downloaded installer always come from one commit, including while a
deploy is still running.

Every command a user copies names the short address. The raw form
stays on the installer page as the fallback. Deploy Site now runs on
changes to install.sh and install.ps1. The install box weight keeps
the address length its ratio was fitted on, so no console page moves.
This commit is contained in:
Abdessamad Derraz committed 2026-10-28 05:47:38 +01:00
1 parent 7c3e6ced09
commit 9e6af0aa6b
37 files changed
+486 -110

No files matched your search

+7 -3
View File
@@ -18,6 +18,7 @@ from pathlib import Path
import sitemarkup as markup
from safeparse import require_yaml
from sitebootstrap import PS1_NAME, SH_NAME
PLATFORMS_DIR = Path(__file__).resolve().parent.parent / "platforms"
GUIDES_FILE = PLATFORMS_DIR / "_guides.yml"
@@ -380,6 +381,9 @@ def load_guides(path: Path = GUIDES_FILE, registry: dict | None = None) -> dict:
_LOADED = load_guides()
INSTALL_BASE: str = _LOADED["install_base"]
# The bootstraps the site serves (sitebootstrap.py writes them).
INSTALL_SH: str = f"{INSTALL_BASE}/{SH_NAME}"
INSTALL_PS1: str = f"{INSTALL_BASE}/{PS1_NAME}"
DEVICE_GROUPS: dict[str, tuple[str, str]] = _LOADED["device_groups"]
GROUP_ANCHORS: dict[str, str] = _LOADED["group_anchors"]
ALSO_RUNS: dict[str, tuple[tuple[str, str, str, str, str], ...]] = _LOADED["also_runs"]
@@ -435,10 +439,10 @@ def install_command(shell: str, args: str = "") -> str:
takes none.
"""
if shell == "sh":
return f"curl -fsSL {INSTALL_BASE}/install.sh | sh" + (f" -s -- {args}" if args else "")
return f"curl -fsSL {INSTALL_SH} | sh" + (f" -s -- {args}" if args else "")
if args:
return f"&([scriptblock]::Create((irm {INSTALL_BASE}/install.ps1))) {args}"
return f"irm {INSTALL_BASE}/install.ps1 | iex"
return f"&([scriptblock]::Create((irm {INSTALL_PS1}))) {args}"
return f"irm {INSTALL_PS1} | iex"
# The title over each command block, by the shell it is written for.