logical.INSTALL_FILESconstno test imports itconst INSTALL_FILES: readonly ["user-data", "preseed.cfg", "ks.cfg", "autoinst.xml", "meta-data", "vendor-data", "guard.sh", "facts", "event", "done"]The install's own names under its URL.
What a request for a path is: a boot file, the menu of the network GRUB, the installer image, the menu of one MAC, or one of the files and posts of an install (/install/<host>/<token>/<mac>/<what>). TFTP and HTTP use the same classification, so that PXE and HTTP boot get the same files. Pure.
import { classify } from "./routes.ts";
classify("/boot/hosts/aa:bb:cc:dd:ee:ff.cfg").kind; // "mac-menu"logical.INSTALL_FILESconstno test imports itconst INSTALL_FILES: readonly ["user-data", "preseed.cfg", "ks.cfg", "autoinst.xml", "meta-data", "vendor-data", "guard.sh", "facts", "event", "done"]The install's own names under its URL.
logical.InstallFiletypeno test imports ittype InstallFile = (typeof INSTALL_FILES)[number];A name under an install's URL.
logical.Routetypeno test imports ittype Route =
| { readonly kind: "boot-file"; readonly name: string }
| { readonly kind: "main-menu" }
| { readonly… (463 characters)type Route =
| { readonly kind: "boot-file"; readonly name: string }
| { readonly kind: "main-menu" }
| { readonly kind: "mac-menu"; readonly mac: string }
| { readonly kind: "host-boot-file"; readonly host: string; readonly name: string }
| { readonly kind: "iso"; readonly name: string }
| { readonly kind: "install"; readonly host: string; readonly token: string; readonly mac: string; readonly file: InstallFile }
| { readonly kind: "unknown" };What a path is.
logical.classifyfunctionno test imports itfunction classify(path: string, bootFiles?: readonly string[]): RouteThe kind of route a path is. bootFiles are the names of the files the server holds (bootx64.efi, grubx64.efi, linux, initrd).
INSTALL_FILESconstno test imports itconst INSTALL_FILES: readonly ["user-data", "preseed.cfg", "ks.cfg", "autoinst.xml", "meta-data", "vendor-data", "guard.sh", "facts", "event", "done"]The install's own names under its URL.
InstallFiletypeno test imports ittype InstallFile = (typeof INSTALL_FILES)[number];A name under an install's URL.
Routetypeno test imports ittype Route =
| { readonly kind: "boot-file"; readonly name: string }
| { readonly kind: "main-menu" }
| { readonly… (463 characters)type Route =
| { readonly kind: "boot-file"; readonly name: string }
| { readonly kind: "main-menu" }
| { readonly kind: "mac-menu"; readonly mac: string }
| { readonly kind: "host-boot-file"; readonly host: string; readonly name: string }
| { readonly kind: "iso"; readonly name: string }
| { readonly kind: "install"; readonly host: string; readonly token: string; readonly mac: string; readonly file: InstallFile }
| { readonly kind: "unknown" };What a path is.
classifyfunctionfunction classify(path: string, bootFiles?: readonly string[]): RouteThe kind of route a path is. bootFiles are the names of the files the server holds (bootx64.efi, grubx64.efi, linux, initrd).