This update continues the hardening and modernization work around Mediabot v3 and its companion web console, mbweb.
The main goal was to make mbweb more useful as a real operational console, while keeping it safer, cleaner, and easier to maintain. The focus was on runtime visibility, better diagnostics, safer session/user payloads, stricter input handling, and reducing confusion between database state and the live Perl bot process.
In short: mbweb now sees more clearly, leaks less, and no longer mistakes shadows in the Pensieve for real Partyline ghosts.
The biggest improvement is the new Partyline runtime snapshot.
Previously, the Partyline page could show a runtime count through Prometheus metrics, but it could not list the actual live telnet/DCC sessions. It also risked confusing two different concepts:
USER.auth = 1.That distinction is now explicit.
The Perl bot now writes a runtime JSON snapshot containing only safe operational data:
telnet or dcc;No passwords, no command history, no private command content.
The JSON snapshot was initially tested through /tmp, but systemd isolation made that unreliable for mbweb. The runtime file now lives in:
/run/mediabot/partyline_sessions.json
This is a much cleaner place for inter-service runtime data.
The Partyline page now reads the runtime JSON snapshot and can display live sessions directly.
It now distinguishes clearly between:
This fixes the earlier misleading situation where mbweb could show 1 runtime from Prometheus while still showing no session details.
The runtime snapshot path was moved from:
/tmp/mediabot_partyline_sessions.json
to:
/run/mediabot/partyline_sessions.json
This avoids PrivateTmp issues under systemd and makes the runtime exchange between the Perl bot and mbweb predictable.
The directory is created as:
/run/mediabot
with ownership suitable for the mediabot service user.
The mbweb login logs were cleaned up to avoid writing unnecessary sensitive or personally identifying data.
The logs no longer expose:
The logs still remain useful for debugging, but now report safer fields such as:
{
"loginProvided": true,
"passwordProvided": true
}
and:
{
"ok": true,
"method": "mysql-password"
}
/api/me and dashboard user payloadsThe API responses were adjusted to avoid returning the full session user object.
Instead, mbweb now uses a public session user shape containing only safe UI-level data:
This reduces accidental data exposure if new API endpoints are added later.
A new route helper was added for strict route IDs.
Instead of loose parsing like:
Number(req.params.id)
routes can now use strict validation that rejects ambiguous values such as:
1.0
abc
0
-1
This makes URL parameter handling cleaner and more predictable.
Configuration parsing was hardened.
The previous parseInt() behavior could accept values such as:
4002abc
as 4002.
mbweb now uses strict integer parsing for important settings such as ports. Invalid values fail loudly at startup instead of silently producing weird behavior.
A new /diagnostics page was added for Owner-level users.
It provides quick health checks for:
The page intentionally avoids displaying secrets.
A small runtime cache was added to reduce repeated external calls.
This helps when several pages call the same integrations repeatedly, such as:
/partyline;/diagnostics;/radio;/api/radio/status.The cache is intentionally short-lived, so the UI remains fresh without hammering Prometheus or Icecast.
New cache-related endpoints were also added for Owner-level users:
/api/cache/status
/api/cache/clear
Metrics fetch failures now include the target URL and useful network cause information, without exposing secrets.
This makes it much easier to distinguish between:
Radio handling was made stricter and safer.
Improvements include:
http:// and https:// bases;The radio API now behaves more like an operational endpoint rather than a raw proxy.
A shared publicSessionUser() helper was added so routes do not reinvent their own session payload shape.
This helps prevent future accidental exposure of internal session fields.
New helper modules were added:
lib/runtimeCache.js
lib/integrationCache.js
lib/partylineRuntime.js
Their purpose is simple:
runtimeCache.js provides a small generic TTL cache;integrationCache.js wraps cached metrics/radio access;partylineRuntime.js reads and sanitizes the Partyline runtime JSON snapshot.Mediabot::Partyline now has helper methods for runtime export:
This gives mbweb a proper bridge to the bot runtime without scraping logs or touching process memory.
The work was validated through several layers:
Example runtime snapshot:
{
"ok": 1,
"count": 1,
"sessions": [
{
"login": "teuk",
"level_desc": "Owner",
"session_type": "telnet",
"peer_host": "localhost"
}
]
}
Suggested commit message:
πͺ Revelio Partyline: teach mbweb to see live sessions and guard its secrets
Alternative:
π§ Mischief managed: mbweb now sees Partyline ghosts through the proper portal
This update turns mbweb into a more serious operational companion for Mediabot v3.
The web console now has better runtime awareness, cleaner diagnostics, safer logs, stricter inputs, and a clearer separation between database state and live bot state.
Most importantly, the Partyline page now tells the truth: a live telnet session is no longer just a metric shadow β it can be seen directly through the runtime snapshot.
Mischief managed.
You must be logged in to reply.