Files
OpenPXE/crates/iso-store/src/lib.rs
T
Miles WardandClaude Opus 4.7 7b972dc049 v0.4.4: Settings tab, API reference, ISO category, branding, disk space
Settings:
- New top-level Settings tab. Carries a placeholder for the planned
  LDAP / OIDC / user-management work, the new branding controls, and
  the API reference at the bottom.
- Custom logo upload (PNG/SVG/JPEG/WebP/GIF up to 2 MB) replaces the
  bundled brand mark via /assets/logo.svg; bytes live at
  <work_dir>/branding/ and survive restart. The original "OpenPXE
  v<x.y.z>" pins to the sidebar footer for support.
- API reference rendered from a new GET /api/docs into a per-method
  coloured pill list grouped by area.

ISO category (Storage):
- New IsoCategory { Os, Tools } on IsoMeta with PUT
  /api/isos/:id/category. Storage table's Type cell becomes a
  dropdown; selecting Tools moves the ISO into the Tools submenu next
  to memtest / shell / NIC info and removes it from the OS Installers
  family submenu. Family detection still drives BIOS/UEFI / kernel
  args; only the menu placement changes.

Storage telemetry:
- New IsoStore::disk_usage (libc::statvfs, lives in iso-store so the
  http-api crate stays #![forbid(unsafe_code)]) and GET
  /api/storage/disk. The Storage tab now shows free/used/total for
  the volume hosting the ISO directory with an 80%/95% colour ramp.

UI polish:
- Brand block in the sidebar now matches the topbar height exactly,
  so the divider runs straight across the top of the app rather than
  stepping; version label moved out of the brand and pinned to the
  sidebar footer ("OpenPXE v0.4.4").
- Light-mode terminal: --terminal-bg + per-level text colours track
  the active theme rather than being hard-coded dark.
- About: lead paragraph spans the full content width; new Docs row
  links to https://openpxe.com/.

106 tests passing (was 89 in v0.4.1, +17 across branding unit tests
and new integration coverage for category / disk / docs / branding).
cargo clippy --workspace --all-targets clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-25 17:46:52 -04:00

35 lines
1.4 KiB
Rust

//! ISO store: uploads, listing, introspection, boot-entry generation.
//!
//! An ISO goes through three states:
//! 1. **Uploading** — bytes streaming to a `.partial` file under `iso_dir`.
//! 2. **Introspecting** — once upload completes, we probe the ISO to detect
//! the distro family and extract kernel/initrd if applicable. Metadata
//! persisted as a sibling `.meta.json` file.
//! 3. **Ready** — listed in the menu, servable over HTTP.
//!
//! Introspection is best-effort. If we can't identify the distro, the ISO is
//! still bootable via a generic `memdisk`/`sanboot` fallback path (not
//! recommended but better than nothing).
//!
//! The `smb` submodule needs exactly one `unsafe` call to `libc::kill` for
//! SIGHUP-based Samba reload — the call is documented inline and every
//! other file in this crate is `#![forbid(unsafe_code)]`-equivalent via
//! the workspace lints.
pub mod entry;
pub mod introspect;
pub mod nfs;
pub mod smb;
pub mod store;
pub mod windows;
pub use entry::{BootEntry, BootKind, KernelArgs};
pub use introspect::{DistroFamily, IntrospectionReport};
pub use nfs::{NfsAddRequest, NfsManager, NfsMount, NfsVersion};
pub use smb::{extract_windows_iso, SmbManager, SmbState};
pub use store::{
generate_boot_entries_for, slugify_str, IsoCategory, IsoMeta, IsoSource, IsoStore,
UploadHandle,
};
pub use windows::{WimPatcher, WinPatchState};