interplane.Get Omega
Read in your language

readings-window

aien-dev/readings-window

Brought by drakestapleton

branch main Branches Tags History

readings-window / NOTES.md

88 lines · 11964 bytes Raw Blame History Source

readings-window

Read-only, token-protected HTTPS window onto the Spark's GPU/CPU readings, hosted on the Pi "hub".

What exists

Spark target configuration migration

The target configuration introduced in PR #12 replaces embedded SSH targets. Before deploying that binary, recover the existing deployment's exact targets and fallback order into a private spark.conf. Do not copy the example's placeholders into production or publish recovered values in a PR, command output or logs. spark.conf is gitignored; keep backups outside the checkout.

On the deployment host:

  1. Inspect both service identities with systemctl show readings-window.service readings-collect.service -p Id -p User -p Group -p DynamicUser. Empty User= with DynamicUser=no means root; confirm running processes with ps -C readings-window -o user=,group=,args=.
  2. Check whether /etc/readings-window/spark.conf already exists, including a dangling symlink. Never overwrite an existing file as part of migration. If absent, stage the recovered bytes in a root-owned temporary file in /etc/readings-window/, set mode 600, then publish with ln -T TEMP /etc/readings-window/spark.conf. Hard-link creation refuses an existing destination; remove only the temporary name afterward.
  3. Root-owned mode 600 is correct for the current root services. If a deployment uses a non-root identity, stop and establish an explicitly approved ownership/access policy first. That deployment also needs access to its selected SSH identity; making this config readable alone is insufficient.
  4. Compare the installed bytes to the private recovered file without printing either. Confirm owner, mode and readability as the actual service user.
  5. Check the existing service without collecting or restarting it: systemctl is-active readings-window.service and curl --fail --silent --show-error --resolve readings.aienos.com:9443:127.0.0.1 https://readings.aienos.com:9443/health.

The config is read on each Spark fetch; installing it does not require a restart. Installing config is not a binary deployment. /health checks local history and exposure state, not SSH reachability, config loading or chat retrieval. Remote paths remain relative to the configured remote user's home. Collection and live-chat readiness need separate authorized checks; a health response alone does not establish them.

On 2026-10-25, the missing config was restored from the original two targets in their original order. Both service units used root (User= empty, DynamicUser=no), and both running processes were root. The file was published without overwriting via a hard link, with owner/group root and mode 600; a byte comparison against the private recovered file matched. No binary was deployed and no service was restarted. The read-only post-install smoke returned active from systemctl is-active readings-window.service and {"status":"ok","last_reading_age_s":13,"exposure":"ok"} from the local HTTPS /health request with certificate validation. No collection command, chat fetch or model request was made by this check.

SSH identity migration

The source no longer embeds a deployment-specific SSH key pathname. An optional identity=PATH line applies to every target; the first nonempty value is passed as one ssh -i argument. Leading/trailing whitespace is trimmed, but internal spaces are preserved and values are not shell-expanded or unquoted. With no nonempty identity, OpenSSH chooses from the service user's SSH configuration/default identities. Target ordering, batch mode and the five-second connect timeout are unchanged.

Before deploying this change, recover the previously selected identity path privately. For an existing config, preserve its exact target bytes, stage a mode-600 root-owned replacement with the explicit identity, verify the original has not changed, and atomically replace it. Check that the service user can read the identity and that installed bytes match the private backup without printing either. Do not replace another operator's existing identity choice.

On 2026-10-25, the installed root-owned mode-600 config and private backup were extended with the exact previously embedded identity path. The original target bytes were preserved, installed bytes were compared, owner/group and mode were checked, and the identity was readable as root. No key contents or private values were printed, no Spark fetch was made, no binary was deployed and no service was restarted. The local test smoke substitutes printf for SSH; it establishes argument boundaries only, not network authentication.

Private only, and fenced in (2026-11-15)

How Muse calls it

Fields: ts, gpu_util_pct, gpu_temp_c, gpu_power_w, load1, load5, load15, cpu_temp_c, mem_used_mb, mem_total_mb. Wrong/missing token 401; unknown path 404; non-GET 405. Note: cpu_temp_c is max over all thermal zones (the Spark's zones are all type "acpitz", none say "cpu"). TLS is terminated by rustls 0.23 (ring provider, TLS 1.2 and 1.3 only) in src/tls.rs; a minimal HTTP/1.1 reader (one request per connection, 16 KiB head cap, 64 connections max) replaced tiny_http, which pinned rustls 0.20 (RUSTSEC-2024-0336).

Status and results feeds (added 2026-10-04)

Exposure watch (added 2026-10-04)

Live Claude chat feed (added 2026-10-04)

Per-agent chat routes (added 2026-10-04, replaces the Claude-only feed above)