Repository navigation
Closed
Labels
featFeature enhancement
Description
Motivation
After closing `#5` (plugin protocol) and `#20` (command widget), the product has no escape hatch for "I want to show some custom data in my splash." The only options are: ship a built-in widget, or submit a PR.
A ReadStore fetcher plugs this gap without reopening any of the exec/URL attack surface:
- User writes data to a known local path (via cron, post-commit hook, CI step, editor, whatever).
- splashboard reads + renders it.
- No code executed by splashboard. No URL fetched. The only thing splashboard does is `std::fs::read` a user-controlled path and parse it.
Classifies as `Safety::Safe`. Works identically in local and global configs.
Proposal
[[widgets]]
id = \"deploy_status\"
fetcher = \"read_store\"
store = \"./.splashboard/deploy.json\" # relative to config file, or absolute
format = \"json\" # json | toml | text (default: infer from extension)
[widgets.render]
type = \"entries\"Fetcher:
- Reads the file once per fetch.
- Parses per `format` into a `Payload`:
- `text` → `Body::Lines` (split on `\n`)
- `json` / `toml` → deserialize into the Payload body shape the widget declares
- Missing file → render empty / placeholder (don't error the splash).
Design questions
- Path resolution: relative to the config file that declares the widget, or to CWD? Config-relative is more predictable (`.splashboard/deploy.json` always resolves the same way regardless of where `cd` lands). CWD-relative lets one config show per-directory data, which overlaps with the per-dir config feature we already have.
- Watch vs poll: does the fetcher observe mtime for cache invalidation, or rely on the normal TTL refresh? First pass: TTL refresh only; mtime watching is a nice-to-have.
- Which Payload bodies: `Lines`, `Entries`, `NumberSeries`, `PointSeries`, `Ratio`, `Bars`, `Calendar`. All of them should be expressible in json/toml. `Bignum` / `Lines` are trivial; chart shapes need schema definition.
- Schema / error reporting: malformed files → placeholder payload with an error string? Quiet empty? Flag to toggle? First pass: empty + log, match how trust-gated widgets behave.
Security notes
- Path is user-config-controlled. The read happens with the user's own permissions. No capability escalation possible — it's equivalent to the user `cat`ing the file.
- The file's contents are whatever the user put there. No sandboxing of the rendered output beyond the usual control-char sanitization the renderer already does.
- Stays `Safety::Safe` in both local and global configs: "read a local file at a config-declared path" is weaker than anything that would require a trust prompt.
Relation to other issues
- Fills the gap left by closing `core: Plugin protocol (subprocess-based I/O spec) #5` / `widget: command / shell oneliner (generic subprocess fetcher) #20`.
- Overlaps conceptually with `widget: TODO list (local file) #10` todo widget (todo.md is effectively a ReadStore with a specific parser). Todo stays a dedicated widget for its Markdown + CRUD semantics; ReadStore is the general escape hatch for arbitrary shapes.
Metadata
Metadata
Assignees
Labels
featFeature enhancement
Activity