The goal
I wanted one place for the household's movies, TV, and music that streams to every device, survives a disk failure, and that I fully understand from the hardware up. Running it every day became my main way of learning storage, networking, and monitoring.
The setup
Primary pool
A single large drive that holds the main media library.
Redundant pool
Four drives that can lose any one disk without losing data.
Streaming
Serves movies, TV, and music to every device in the house.
The same server also runs Home Assistant, which powers my home automation hub, “Jarvis.”
The problem
My portfolio showed a hand-typed snapshot of the server, and it went stale almost immediately. The CPU, the TrueNAS version, the uptime, and the library counts were all out of date.
The obvious fix, letting the website query the server, meant opening my home network to the internet. That wasn't worth it for a stats card.
The solution: push, don't pull
Instead of the website reaching in, the server reaches out once a day:
dorina.json to GitHub.Hurdles along the way
-
The TrueNAS web API rejected the script's HTTPS connections with a TLS
“unrecognized name” error, whether I used
localhost,127.0.0.1, or the LAN IP. Since the script runs on TrueNAS itself, I switched tomidclt, TrueNAS's local command-line client. It needs no HTTPS and no API key, which also removed a credential I'd have had to protect.
def midclt(method, *args):
# Ask TrueNAS directly via its local CLI (no HTTPS, no API key needed)
out = subprocess.check_output(["midclt", "call", method, *[json.dumps(a) for a in args]])
return json.loads(out)
-
TrueNAS's system folders are read-only. The script lives on a ZFS dataset
instead, so it survives reboots and updates. It's scheduled through the TrueNAS UI rather
than
crontab, which updates can wipe. - Raw size isn't usable space. A RAIDZ1 pool's raw size includes parity, so my first version overstated capacity. Reading each pool's root dataset gives the space you can actually use.
Designed to fail gracefully
Stats file missing
Each card keeps its last snapshot instead of breaking.
Home Assistant down
Server stats still publish, and the Jarvis card shows the hub as unreachable.
Stale data
Every card shows when it last updated, so old numbers are obvious.
What I learned
- Choose the architecture that avoids the risk. Pushing data out removed the need to expose anything.
- Use the platform's native tools.
midcltwas simpler and more reliable than fighting the web API. - Live data keeps you honest. Automating the card showed me how far my hand-written numbers had drifted.