Split into qemu and proxmox platforms over a shared content tree

platforms/qemu and platforms/proxmox each have their own lab.sh and
lab.conf; content/ holds everything shared (roles, seed, site, helpers).
The dispatcher, preflight and command implementations are common and take
platform differences from the backend.

Proxmox backend: qm create with q35/SATA/e1000, ISOs and seed ISOs in an
ISO storage, provisioning over qm guest exec (no Python packages needed on
the host), template + clone for reset, and peers/ to emit WireGuard configs.
The role scripts now ride on the seed ISO, so provisioning transfers nothing.

build-bundle.sh produces a self-contained tarball per platform, for hosts
that cannot reach the git server.

Both configs are generic: no absolute path from this machine remains.
This commit is contained in:
2026-10-22 19:23:16 -04:00
parent 538fb9a117
commit 890dd58700
349 changed files with 1142 additions and 2236 deletions
+128
View File
@@ -0,0 +1,128 @@
#!/usr/bin/env python3
"""
Turn the archived Norbourg.com home page into ready-to-open HTML.
Two outputs are produced from the same source capture:
norbourg.html one self-contained file (images inlined as data: URIs)
norbourg-static/ index.html + images/ with plain relative paths
(use this one if data: URIs are blocked by a viewer)
Both keep the original table layout, iso-8859-1 charset and the hover
JavaScript; they need no server and no network to display.
"""
import base64
import re
import shutil
import time
import urllib.error
import urllib.request
from pathlib import Path
ROOT = Path(__file__).resolve().parent
SRC = ROOT / "source" / "raw-home.html"
ASSETS = ROOT / "norbourg-2002" / "images"
OUT_INLINE = ROOT / "norbourg.html"
OUT_STATIC = ROOT / "norbourg-static"
TS = "20020929201450"
SHARD = f"http://web.archive.org/web/{TS}id_/http://www.norbourg.com/images/"
UA = "Mozilla/5.0 (X11; Linux x86_64) norbourg-template/1.0"
MIME = {".gif": "image/gif", ".jpg": "image/jpeg", ".jpeg": "image/jpeg",
".png": "image/png", ".swf": "application/x-shockwave-flash"}
IMG_RE = re.compile(r"(?:https?://(?:www\.)?norbourg\.com)?/?images/([A-Za-z0-9_.\-]+\.(?:gif|jpe?g|png))", re.I)
LINK_RE = re.compile(r'href="(?:https?://(?:www\.)?norbourg\.com)?/?([A-Za-z0-9_.\-]+\.(?:asp|html))"', re.I)
def fetch_asset(name):
dest = ASSETS / name
if dest.is_file() and dest.stat().st_size > 0:
return dest.read_bytes()
for attempt in range(4):
try:
req = urllib.request.Request(SHARD + name, headers={"User-Agent": UA})
with urllib.request.urlopen(req, timeout=60) as r:
data = r.read()
if data:
dest.parent.mkdir(parents=True, exist_ok=True)
dest.write_bytes(data)
print(f" fetched {name} ({len(data)} bytes)")
time.sleep(0.3)
return data
except urllib.error.HTTPError as e:
print(f" {name}: HTTP {e.code}")
if e.code == 404:
return None
except Exception as e: # noqa: BLE001
print(f" {name}: {e}")
time.sleep(2 * (attempt + 1))
return None
def finalise(html):
"""Strip the 2002 hit counter and point page links at the archived copies."""
html = re.sub(r"(?is)<script[^>]*>\s*<!--\s*document\.write\('<a href=\"/webstat.*?</script>", "", html)
def fix_link(m):
page = m.group(1)
if page in ("index.asp", "index.html", ""):
return 'href="#"'
page = re.sub(r"\.html$", ".asp", page) # local mirror names -> original
return f'href="https://web.archive.org/web/{TS}/http://www.norbourg.com/{page}"'
return LINK_RE.sub(fix_link, html)
def main():
raw = SRC.read_text(encoding="latin-1")
refs = sorted({m.group(1) for m in IMG_RE.finditer(raw)})
print(f"{len(refs)} image references")
blobs = {}
for name in refs:
data = fetch_asset(name)
if data:
blobs[name] = data
else:
print(f" !! could not get {name}")
# ---------- variant 1: everything inlined -----------------------------
def inline(m):
name = m.group(1)
if name not in blobs:
return m.group(0)
mime = MIME.get(Path(name).suffix.lower(), "application/octet-stream")
b64 = base64.b64encode(blobs[name]).decode("ascii")
return f"data:{mime};base64,{b64}"
html = finalise(IMG_RE.sub(inline, raw))
# a data: URI inside the old BACKGROUND attribute is unreliable, move it to CSS
m = re.search(r'background="(data:image/[^"]+)"', html, re.I)
if m:
html = re.sub(r'\sbackground="data:image/[^"]+"', "", html, count=1, flags=re.I)
html = html.replace(
"</HEAD>", f"<style>body{{background-image:url('{m.group(1)}');}}</style>\n</HEAD>", 1
)
OUT_INLINE.write_text(html, encoding="latin-1")
print(f"wrote {OUT_INLINE.name} ({OUT_INLINE.stat().st_size/1024:.0f} KB)")
# ---------- variant 2: plain files next to the html -------------------
OUT_STATIC.mkdir(exist_ok=True)
(OUT_STATIC / "images").mkdir(exist_ok=True)
for name in blobs:
shutil.copyfile(ASSETS / name, OUT_STATIC / "images" / name)
def relative(m):
name = m.group(1)
return f"images/{name}" if name in blobs else m.group(0)
html = finalise(IMG_RE.sub(relative, raw))
(OUT_STATIC / "index.html").write_text(html, encoding="latin-1")
left = IMG_RE.findall(html)
print(f"wrote {OUT_STATIC.name}/index.html + {len(blobs)} images, unresolved refs: {len(left)}")
if __name__ == "__main__":
main()