I have just pushed a new round of cleanup and hardening work around the Mediabot v3 web console (mbweb). This one is less about shiny new features and more about making the web interface safer, clearer, and more predictable.
The main goal was simple: keep the console useful for daily operations, but stop it from being fragile, noisy, or misleading.
The live mbweb app runs from:
/opt/mbweb/app
and is synchronized back into the repository under:
/home/mediabot/mediabot_v3/contrib/mbweb
The sync script was improved so it now behaves more strictly and predictably:
.env and private runtime files out of the repository;node_modules, logs, backups, archives, sessions and temporary files;rsync;That should make it much harder to accidentally commit sensitive or useless runtime material.
The login flow was logging too much detail. The previous logs could include things like:
That was useful while debugging, but too noisy and too sensitive for normal logs.
The authentication logs now keep only what is operationally useful:
POST received: URL, body keys, loginProvided, passwordProvided
auth result: ok, reason, method
login success: global level, role, channel count
So we still know what happened, without dumping personal or sensitive details into journalctl.
The metrics proxy was improved to behave more defensively:
fetch failed.This makes metrics failures easier to diagnose without exposing unnecessary details to the browser.
This was an important one.
The Partyline page was previously showing users from the database with USER.auth = 1, and presenting that as if it were the live Partyline session list.
That was misleading.
A telnet/DCC Partyline connection lives inside the Perl bot process memory. The web console cannot directly list those users unless the bot exposes that runtime state somewhere.
So the page was corrected:
mediabot_partyline_sessions_current when available;mbweb;This prevents confusion when someone is logged into the Partyline via telnet but does not appear in the DB-authenticated users table.
The Partyline SQL queries were moved into mediabotRepository.js instead of being embedded directly in the route.
New repository helpers include:
getAuthenticatedDbUsers()getRecentChannelBans(limit)This keeps route code cleaner and makes DB access easier to audit.
Several routes were using direct conversions such as:
Number(req.query.page) || 1
That works for happy paths, but can behave badly with values like:
InfinityA shared helper now clamps and sanitizes parameters more consistently:
parsePositiveInt()cleanSearch()This was applied across routes such as channels, users, commands and quotes.
Some API endpoints returned the whole session user object. That was broader than necessary.
The following endpoints now return a smaller public shape:
/api/dashboard/api/meInstead of returning everything in the session, they now expose only fields that are actually needed by the frontend, such as nickname, role, global level and channel count.
The radio helper was hardened too:
http:// or https://;/api/radio/status no longer returns raw exception messages to the browser.This makes the radio page safer and more predictable when Icecast is down, misconfigured, or returning unexpected data.
The previous requireLogin() middleware refreshed the session in the background, but did not wait for that refresh before continuing.
For sensitive pages, that can mean a route makes a decision using slightly stale role information.
A new requireFreshLogin() middleware now waits for the session refresh before continuing. Protected routes were moved to this stricter middleware.
This matters especially for Owner/Master-only views like Partyline.
The UI was also adjusted to make the console easier to read:
The goal was not to remove the visual identity, but to make the interface less oversized and more practical for daily use.
The live app is still the source for runtime testing:
/opt/mbweb/app
Once validated, it is synchronized back into the repository with:
/home/mediabot/mediabot_v3/tools/sync_mbweb_contrib.sh
The repository copy lives here:
contrib/mbweb
🪄 Protego Mbweb: harden the console, tame Partyline mirrors, and silence nosy logs
This was mostly a hardening and clarity pass, but it matters a lot.
The web console now leaks less in logs, handles bad inputs more calmly, explains Partyline state more honestly, and is easier to maintain because more logic has moved into shared helpers and repository functions.
Next possible improvements:
mbweb routes;Mischief managed.
You must be logged in to reply.