Repository navigation
Description
What's the problem
Pithead has no way to read basic facts about the box it runs on. /api/state already carries host_ip (HOST_IP env, default "Unknown Host"), host_addr (best-effort primary LAN IPv4 via detect_host_ipv4(), null when dashboard.host is already an IP or detection fails), the Pithead version, and on appliances only os_update (the update step and verdict). It has no distro name, os-release version, kernel, hardware model, CPU model/cores/clock, GPU, host uptime, multi-interface list, IPv6, power/battery state or locale. /api/state's system block (built by build_system) has CPU percent, load, memory, one disk and hugepages; /proc/cpuinfo is read today only for the AVX2 flag (collector/system.py). On develop-v2.1.0, host_resources already reserves swap and temperature slots that report "unsupported". The only place kernel, memory and disk text is captured is host.txt in the support bundle.
Related: #2523 (closed, Pithead server health view), #2540, #786, #379, #3872.
What it impacts
Operators of DIY and appliance installs (the appliance has no shell), anyone filing a support request, scripts that inventory several boxes, and the Pithead server health view (#2523), which has no data source for identity facts.
How I found it
I checked what system information Pithead exposes while scoping the lean UI's server health view. I read develop and develop-v2.1.0: grep for os-release, uname, dmidecode, /sys/class, lscpu and locale in dashboard/mining_dashboard found no collector; collector/system.py reads only /proc/stat, /proc/meminfo, loadavg and the AVX2 flag from /proc/cpuinfo. No open issue covers it. A live sample was not possible (no dashboard was running where I looked). Unknown: whether the appliance's os-update-state.json writer already records the running image version.
How important is it
Medium. It is a new feature (milestone 2.1.0), not a defect, but it unblocks the server health view and support triage.
Acceptance criteria
- GET /api/system returns JSON with named fields (strings/numbers/null): os_name, os_version, image_version (appliance only, else null), kernel, arch, cpu_model, cpu_cores, cpu_mhz, memory_total_bytes, gpus (array of strings), hardware_model, uptime_seconds, boot_time, lan_ips (array), locale, timezone, power (null if not applicable). Each field is null, not an error, when unreadable.
- lan_ips reuses detect_host_ipv4() or the same default-route logic, not a new mechanism.
- Served only when interface mode (Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974) is api or both. Dashboard-only is the default mode, so on a fresh install the external route returns 404 while the UI keeps working through its own internal calls. The 404-when-disabled pattern already exists as DASHBOARD_CONTROL_ENABLED; the interface-mode setting has no issue number yet and must be filed first or this criterion dropped.
- Gated by the same trust boundary as /api/state and /metrics: Caddy basic_auth when dashboard.auth.password is set (401 without credentials), open on a DIY box with no password set. Once Dashboard login page with admin and read-only roles, replacing the browser's basic-auth prompt #3872 lands (login page, admin and read-only roles, also covers the Provide read-only monitoring credentials separate from dashboard administration #3183 read-only metrics credential), it is readable by the read-only role. The 401 test applies only when auth is enabled.
- Read-only (GET/HEAD); response size is bounded; values are cached with a stated refresh interval and the collector cannot be triggered faster than that.
- The route is served on the LAN listener only and nothing is sent to clearnet. No wallet, onion address or token appears in the response; lan_ips lists only the host's own LAN addresses, never peer or client addresses. Each string value is length-capped (for example 256 characters) and the array fields are capped (for example 16 entries).
- Tests: field presence and types with fixtures, null on missing /proc or /sys files, 404 in dashboard-only mode, 401 unauthenticated when auth is enabled.
Possible solutions
- New /api/system route versus extending /api/state with a system_info key. A separate route keeps /api/state small and lets it be gated by mode.
- Read /proc and /sys directly (no new dependency) versus psutil. /proc and /sys fit the project's current collectors. Fill the existing host_resources swap and temperature placeholders rather than adding a parallel structure.
- Where to collect: the dashboard runs with network_mode: host, so its LAN IP is the host's, and kernel (uname), CPU, memory and uptime are host-true from the container. os-release and the DMI model are container or mount-dependent and would come from a host-written results/ file like os-update-state.json (appliance) or the control spool, as the diag verbs do. Unknown: whether the DMI and os-release mounts are available in the appliance container. Before promising image_version, check the os-update-state.json writer; if it has the running version, source image_version from there instead of a new collector.
Activity
pithead-developer commentedon Nov 24, 2026
Questions before work continues (answer here, then remove the
questionlabel):Add a system-information API for static and slow-changing host facts #3975 and Export host metrics (CPU, load, memory, swap, disk, temperature, network, uptime) on /metrics #3976 both require serving only when dashboard.mode (Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974) is api or both, with a 404 in the default dashboard-only mode. Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974 is open, has no PR, and depends on the unmerged Dashboard login page with admin and read-only roles, replacing the browser's basic-auth prompt #3872/Add dashboard login sessions with admin and viewer roles #3895. Should I drop the mode gate from this PR? Default: yes. Ship GET /api/system and the pithead_host_* families always on, behind the existing optional Caddy auth, as /metrics is today. No 404-when-disabled test and no mode wiring. List Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974 and Dashboard login page with admin and read-only roles, replacing the browser's basic-auth prompt #3872 under depends_on, and have the docs say the mode gate arrives with Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974. Reason: building dashboard.mode here pulls in config validation, Caddy and CLI work that Add a dashboard.mode setting: dashboard only (default), API only (headless), or both #3974 owns. The alternative is an env flag like DASHBOARD_CONTROL_ENABLED, default off, which breaks the issues' expectation that the APIs work out of the box.
Lean UI: "This box" view for system information and host health #3977 requires an approved mockup (dark, light, phone) before implementation. The lean UI is a preview, and its natural home is the Maintenance/Inspect work in unmerged draft PR dashboard: build Sovereign Maintenance and Inspect #3708. Should I leave Lean UI: "This box" view for system information and host health #3977 out of the group (left_out) and do only Add a system-information API for static and slow-changing host facts #3975 and Export host metrics (CPU, load, memory, swap, disk, temperature, network, uptime) on /metrics #3976? Default: yes. Reason: I cannot produce an approved mockup, the UI would conflict with dashboard: build Sovereign Maintenance and Inspect #3708, and it needs Add a system-information API for static and slow-changing host facts #3975's API merged first.
Add a system-information API for static and slow-changing host facts #3975 asks for image_version from the appliance os-update-state.json writer if it records the running version, and for os-release and DMI facts that may not be visible to the container. Should I read /etc/os-release, /proc and /sys directly from the container, with null for anything unreadable, and take image_version from os-update-state.json only if the writer already records it? Default: yes. I would not add a new host-written spool file or mounts in this PR.
The tier-4 proof. Both features add routes and collectors to the dashboard container. Should the proof be tiers 1-3 plus one tier4-e2e (mode targeted) on the PR head, with Python tests and an authenticated-/metrics fixture row? Default: yes. No tier4-kvm, because no os/ paths change.
pithead-architect commentedon Nov 24, 2026
Ruling: (1) No: keep the mode gate. This issue's acceptance criteria require a 404 in dashboard-only mode. They allowed dropping that line only until the interface-mode issue was filed, and it now exists as #3974, which states that the new external query APIs stay closed by default. Shipping /api/system and the
pithead_host_*families always on would open them by default, and that is the very choice those issues decide. Do not add a placeholder env flag either: #3974 owns the setting. Returnblockedwith #3974 independs_on, add the native blocked-by link, and keep the worktree. #3976 waits the same way. (2) Yes, leave #3977 out vialeft_out. It needs an approved mockup and #3975's API. (3) Partly. Reading/procand/sys/class/dmi/idfrom the container is fine, with null for anything unreadable. The dashboard runs withnetwork_mode: host, solan_ipssees the host's interfaces. Files under the container's own/etcdescribe the dashboard image, not the host:os-release,localtime, locale. Take each from a read-only bind mount of the host file, or return null; never return the container's value. Take image_version from os-update-state.json only if the writer already records it. Add no new host-written spool file. (4) Yes: tiers 1-3, then onetier4-e2etargeted job on the head. Add a tier-1 row for the 404 in dashboard-only mode and a row for the 401 when auth is enabled. Notier4-kvmunless the diff touchesos/.pithead-developer commentedon Nov 24, 2026
Blocked on #3974. Blocked on #3974 (the dashboard.mode setting). #3975 and #3976 must return 404 in dashboard-only mode, and #3974 owns that setting, so I will not ship the APIs always on or add a placeholder flag. #3974 is open with no PR and in turn depends on #3872/#3895. Finished: I read all the issues and the code, and the operator's rulings are recorded. The native blocked-by links are added from #3975 and #3976 to #3974. #3977 is left out. No code or PR exists yet, and the worktree is kept clean. On resume, once #3974 closes: (a) GET /api/system, with /proc and /sys/class/dmi/id read from the container, and os-release, localtime and locale taken only from read-only host bind mounts, else null. image_version comes from os-update-state.json only if the writer already records it, and there is no new spool file. (b) The pithead_host_* families on /metrics. Both are gated by dashboard.mode, with a tier-1 row for 404 in dashboard-only mode and a 401 row when auth is on. Proof is tiers 1-3 plus one targeted tier4-e2e on the head, no tier4-kvm unless os/ is touched. Who clears it: the owner or whoever lands #3974.
The runner resumes this issue when that one closes.
pithead-architect commentedon Nov 27, 2026
Release regroom (owner request, 2026-11-27): moved from v2.1.0 to v2.1.3. Headless-dashboard and system-info UI chain depends on the login work in 2.1.0; second UI chunk.