Repository navigation
v0.5.0 — content quality of life + ops + perms + audit-driven hardening
Big batch release rolling up the entire ops-quality-of-life pass driven by
the external audit + several follow-up feature drops the operator asked for
during a single working session: granular permissions (mapActivate so a
non-admin user can change maps without inheriting full ServerConfig.toml
rights), one-click BeamMP-Server binary update from the dashboard banner,
a Cars catalogue mirroring Mapas, custom-map metadata + thumbnails read
from info.json (including info.json files BeamMP-Server's own parser
tolerates but JSON.parse rejects), CPU temperature on the Dashboard,
four new KPI tiles (mods-on-disk excluding Kunos vanilla, joins / laps /
total drivers), strictly admin-only mod deletion + ConfirmModal, the
Mods catalogue collapsed by default, a stable per-player id that doesn't
collapse two guests behind the same NAT into one entry, and the active-
map tile in the Dashboard now shows modder title + screenshot for custom
maps too. Plus the security / health / audit-export hardening from the
external audit and a fast unit-test layer in front of the existing smoke
run. Two coordinated panels — BeamMP + Assetto Corsa siblings — got the
shared Dashboard tiles (mods-on-disk, joins / laps / drivers, CPU temp)
identically, with the AC panel filtering Kunos vanilla out of the disk
total.
Changed
- Mod deletion is now strictly admin-only.
DELETE /api/mods/<loc>/<name>
switched from themodUploadpermission gate tocheckAdminAuth.
modUploadstill controls who can push new archives in, but the
destructive side moves up to admin — the wrong delete on a busy
server (operator picks the wrong row, modder's hash mismatches
mid-rotation, …) kicks every connected player and forces a manual
reupload, and the panel's risk model treats that as a single-actor
operation. Frontend mirrors the change: the Mods catalogue's delete
button only renders when the viewer is admin (was: when they had
upload rights), and the existing ConfirmModal continues to gate
the click. Same approach as the assetto-server-panel sibling, where
car / track delete has always required admin. - Mod classifier no longer tags vehicle-extension mods as "Coche".
The previous heuristic flagged any zip containingvehicles/<X>/<Y>.jbeam
as a car — which caught full-vehicle mods but also license-plate packs,
body kits, bumpers and trim that ship plate / tuning.jbeamfiles
for stock vehicles without aninfo.jsonof their own. EuroPlates_JorgePinto.zip
was the prompting case: Mods page said "Coche", Cars catalogue
(which requiresvehicles/<X>/info.json) said "no car" — inconsistent.
Strict criterion now:kind=cariff at least onevehicles/<X>/info.json
exists. Vehicle-extension mods classify asother.
Added
- Collapsible "Installed mods" card on the Mods page. Catalogue
is informational; the uploader below is the action surface. Card
starts collapsed; click the header to expand. Total-mods badge stays
visible even when collapsed. Preference persisted in
localStorage['bp-mods-installed-open']. Same idiom the Dashboard
activity card already uses (chevron indicator, keyboard handler,
aria-expanded). - Stable per-player id (no more "everyone is UUID 0"). PanelBridge
consumer was using BeamMP-Server's per-session slot number (0, 1,
2…) as the canonical player_id, collapsing every guest that ever
held slot 0 into a single DB row. New_stableIdFor(p)returns
bmp:<uid>for registered BeamMP users (forum UID — durable across
sessions / IPs / name changes),guest:<name>for guests (BeamMP
assigns each guest a session-unique handle like "guest8099544" so
two guests behind the same NAT no longer collapse into one panel
entry — the operator pointed this out as the genuine common case
during BeamMP-auth maintenance windows when AllowGuests has to stay
true), andnamed:<name>/slot:<n>as deeper fallbacks.
_connectedPlayersis rekeyed by stableId; each entry carries
slotIdso MP.DropPlayer still works for kicks. Migration #13
purges legacy slot-numeric rows from players / player_events / bans.
apiPlayerKick + apiPlayerBan resolve the stableId → slotId via the
live map. _publishBans writes each ban under both keys (prefixed +
raw) so the in-tree PanelBridge keeps matching without a reload. - Player nickname rendered in Dashboard players-online list.
Matches the Players page's "Nickname (in-game)" shape so the
admin-set nickname is visible from both views at a glance. Falls
back to the in-game name when no nickname is set. Single inline
ternary; no new fetch. - Active-map Dashboard tile now shows modder title + thumbnail for
custom maps. Vanilla maps were already rendering bundled
screenshots — but the moment the operator switched to a Nürburgring
mod the tile fell back to the raw directory name + the technical
/levels/ks_nord/info.jsonpath, with no image. apiDashboardExtra
now resolves custom maps via enumerateCustomMaps and surfaces
{ source, levelName, hasPreview }. Frontend builds the preview
URL from/api/maps/preview/<source>/<levelName>— same endpoint
the Maps page card uses, so the active-map thumbnail and the
catalogue thumbnail stay in sync. mapActivategranular permission. The User role can now be
granted access to the Maps + Cars pages and to changing the active
map without inheriting full ServerConfig.toml editing rights. Closes
the gap that "let a user pick the next map" required handing over
the whole config editor (port, max players, AuthKey rotation
scope, etc).ROLE_PERMISSIONSgrows amapActivateentry which
is checked byapiMaps,apiMapsActivate,apiMapPreview,
apiCarsandapiCarPreviewinstead ofserverConfig.
Map rotation (apiMapsRotation+apiMapsRotationUpdate) keeps
theserverConfiggate — the rotation timer rewrites the live
config and restarts the server, so it's a config-level operation
not an operator-level one. New_applyImplicationshelper makes
serverConfigautomatically grantmapActivateat runtime so an
existing admin or any user already trusted with serverConfig keeps
Maps + Cars access without the operator having to tick a second
checkbox. UI: a new row in Users > Permissions explains the
difference; the sidebar entries for Maps + Cars now hide via
requires:'mapActivate'; the Map rotation card on the Maps page
is only rendered when the viewer has full serverConfig. New i18n
keysperm.mapActivate+perm.mapActivate_hint(en + es).- CPU temperature badge on the Dashboard's "Uso CPU" tile. Small
number in the top-right corner of the existing CPU card, no layout
changes. Sourced from/sys/class/thermal/thermal_zone*/temp— pure
kernel surface, no extra package, no sudo, plug-and-play on every
modern Linux host._getCpuTempCwalks each zone, prefers ones whose
typematches a CPU sensor (x86_pkg_temp,coretemp,
cpu[-_]thermal,core_N,package_N) and reports the highest
reading among the preferred set so a multi-package box shows the
hottest die. On hosts where the thermal tree doesn't exist (some VPS,
LXC containers, FreeBSD, Windows) or every reading is out of plausible
range, the helper returns null and the badge simply doesn't render —
the tile looks exactly like before. - One-click BeamMP-Server binary update from the dashboard banner.
POST /api/server/update-binary(gated onserverControl) downloads
the asset matching the host's distro/arch from the latest GitHub
release, makes a<bin>.bakof the running binary, atomically
replaces it (after stopping the service), restarts, verifies
--versionon the new binary, and rolls back to the.bakif the
new one is corrupted. Process-wide flag rejects concurrent calls with
409._detectLinuxAssetmaps/etc/os-release+process.archto
BeamMP'sBeamMP-Server.<id>.<version_id>.<arch>shape (Debian
12/13, Ubuntu 22.04/24.04, x86_64 + arm64); other distros refuse
with a 400 rather than ship a libc-mismatched binary. The Dashboard
update banner grows an "Actualizar" button next to "Ver release"
with a ConfirmModal that spells out the disruption. - Cars catalogue page. New
Cochesentry in the sidebar's
Contenido group, mirroring the Mapas page UX but read-only — BeamMP
auto-streams car mods to every connecting client, so there is no
activate flow.enumerateCustomCarswalksResources/Client/*.zip
pairingvehicles/<X>/info.jsonwithvehicles/<X>/default.(png|jpg),
emits one card per vehicle with brand / country / year / type
badges, and surfaces authors + description in the modal. Vanilla
BeamNG.drive cars are deliberately NOT enumerated — they ship with
each player's local game install — and the page leads with an
explanatory card making that explicit. - Custom maps now read their
levels/<X>/info.jsonso the
catalogue shows the modder's title, description, authors, country
(last segment of thelevels.common.country.*translation key),
biome and features rather than the bare directory name. Per-level
pairing means a track pack that ships multiple levels in one .zip
gets one card with the correct thumbnail per level._parseLooseJson
tolerates the JSONC dialect BeamNG uses (trailing commas, occasional
comments) so files like the Nordschleife mod's info.json don't
reject under strictJSON.parse. - Per-level preview extractor.
/api/maps/preview/<source>/<level>
extracts the targetedlevels/<level>/preview.(png|jpg|jpeg)from
inside the zip — separate from the mods page's first-preview-found
endpoint because a multi-level archive needs one thumbnail per
level, not one for the whole archive. - Ban enforcement at join (PanelBridge v3). The plugin gains an
onPlayerAuthhandler that readsResources/Server/PanelBridge/bans.json
on every auth attempt and refuses the connection with the operator-provided
reason as the kick string when any of the player's identifiers (beammp UID,
IP, …) is in the ban table. The panel publishes the file atomically on
every ban, every unban, everysweepExpiredBanstick that actually
removed rows, and once at boot. Reading on every auth instead of caching
means a ban issued seconds before a retry is effective without a plugin
reload. The plugin tries every identifier so a UID ban still catches an IP
rotation and vice versa. Seedocs/live-state.md
for the bans.json wire format. [3d8dcb1] GET /api/admin/health— clinical-style readiness probe for
Uptime-Kuma / blackbox-exporter / Kubernetes. Aggregates DB + disk +
process + BeamMP-Server checks into ahealthy/degraded/unhealthy
verdict; HTTP code mirrors the verdict (200 for the first two, 503 for
the last) so the alert rule is a one-line non-2xx check. Admin-gated —
the public/api/healthstill returns{ ok: true }and intentionally
leaks no fingerprintable signal. Thresholds: < 500 MB free disk →
unhealthy, < 5 GB → degraded; RSS > 1 GB → degraded; BeamMP-Server down
→ degraded, not unhealthy (the panel keeps serving config edits + uploads- audit log when BeamMP isn't up). The server check reads cached
_serverRunSinceso the scrape stays fast — a freshgetServerInfo()
would add ~1 s of TCP probing per call. [b09dd83]
- audit log when BeamMP isn't up). The server check reads cached
GET /api/audit/export?format=csv|json— streams the audit log for
offline analysis with optionalsince/until/actor/action
filters. CSV usesbetter-sqlite3.iterate()so a multi-year export
stays flat on memory; JSON ships one well-formed document because jq /
SIEM ingestion prefers that over NDJSON. RFC 4180 quoting handles
commas, quotes and newlines inside reason / detail fields. The export
action is itself audit-logged with the chosen filter so an operator
scraping the table leaves a trace. [9a755f1]- Unit tests.
npm run test:unitloadslib/pure.jsdirectly and
asserts on the CSV-quoting + BeamMP log-parsing invariants (strict
documented format + heuristic fallback) without booting the HTTP server
/ DB / log watcher. Runs in ~5 ms; chained ahead of the existing smoke
run bynpm testso a broken invariant fails fast. [80119ff]
Fixed
- Maps + Mods catalogues read
info.json["previews"][0]when no
canonicalpreview.png/.jpgexists. Some BeamNG map mods
(2K-Sadamine, e.g.) ship their thumbnail under a non-canonical path
likequickrace/TH.jpgand declare it ininfo.jsonrather than
bundling apreview.jpgat the standard location. New
_resolveLevelPreviewhelper does the two-step resolution
(canonical →previews[0]) and is used by bothenumerateCustomMaps
(Maps catalogue) andapiMapPreview(preview endpoint), plus
_classifyClientMod(Mods catalogue). Path-traversal-safe — rejects
anypreviewsentry with..or a leading slash. Catalogue cards
and the Dashboard active-map tile all light up consistently. _parseLooseJsontolerates missing commas between properties.
Sadamine'sinfo.jsonhad a literal missing comma between
"features"and"suitablefor"— BeamNG.drive's lenient parser
doesn't care, butJSON.parserejected with "Expected ',' or '}'
after property value at position 204", so thepreviewsfallback
branch never saw the meta object. Parser now also re-inserts the
comma before parsing.- Sidebar brand "BeamNG Server Panel" stays on one line. The
CSS rules for.brand/.brand-mark/.brand-nameare
byte-for-byte identical to the assetto-server-panel sibling, but
the BeamMP panel was breaking the title into "BeamNG Server" /
"Panel" while AC kept its 20-char "Assetto Server Panel" on a
single line. Cause was typographic: "BeamNG" packs four uppercase
glyphs (B + the wide-cap of M + N + G) which measure ~10 px wider
than "Assetto"'s one uppercase, just enough to overflow the ~146 px
text slot the 232 px sidebar leaves after icon + padding + gap.
Fix is scoped to BeamMP's stylesheet:.brandtightensgap
(10 → 6 px) and horizontal padding (8 → 4 px),.brand-namegets
white-space: nowrapand a slightly tighterletter-spacing
(-0.01em → -0.025em),.brand-submatches withnowrap+ ellipsis
so a long OS string (e.g. "Linux Mint 22.1") doesn't push the
layout downward. Font size stays at 14 px so the title reads at
the same weight as the AC sibling side by side. - Update banner no longer reads
vv3.9.3. GitHub publishes
release tags with a leadingvwhile_getLocalBmpVersionhas
always stripped it; the banner template then added its ownvso
the latest version showed two. Backend now normalisestag_name
before handing it to the client, and the i18n templates that were
missing the prefix on the "you are running …" subtitle and on the
success / already-latest toasts now have it, so there is exactly
onevin every place a version is shown. - Race condition in simultaneous mod uploads. The existing
_uploadLocksmap only serialised byuploadId, so two uploads from
different admins (or the same admin in two browser tabs) that happened
to resolve to the samesafeNamefor a client mod, or the same
modRootfor a server plugin, raced onO_TRUNCand could produce a
corrupt zip that BeamMP-Server would then stream verbatim to every
connecting player. NewwithDestPathLockwraps the open+write+close
in the client-mod branch and the entire entry-loop in the server-plugin
branch, keyed by the absolute destination path — different uploads
still proceed in parallel, only those touching the same destination
block on each other. [5564212] - Log parser retag for BeamMP-Server's documented output format. The
heuristic regexes were inherited verbatim from the AC fork, where
acServer emits unstructured English prose. Applied to BeamMP-Server's
structured[DD/MM/YYYY HH:MM:SS] $CONTEXT [LEVEL] $MSGoutput they
over-matched on the documented words inside log messages and
under-matched on the actual level brackets, so[WARN]lines could end
up taggedinfoand the SRV / HTTP / CFG fallback tags showed up on
lines that had a perfectly good context likeHeartbeatThreador
(42) "Alice". New_BMP_LINEregex peels off the documented shape
on the strict path, lifts the timestamp + context + level into
structured fields, and only falls through to the AC-style heuristics
when a line doesn't match — covering Lua pluginprint()output, the
panel's own injected lines and any log that lost its leading bracket
through a pipe. Maps the six BeamMP levels (DEBUG / INFO / LUA / WARN
/ ERROR / FATAL) onto four UI buckets, giving LUA its own colour so
plugin output (PanelBridge, MOTD loop, third-party plugins) is
filterable directly. [9d1e837] _enqueueBridgeCommandcleans up its.tmpon a failed rename. A
failedfs.rename(cross-device link, ENOSPC mid-write, plugin dir
wiped between mkdir and rename) used to leavecommands.json.tmp
behind on every retry. Now wrapped intry/finallywith a best-effort
unlink. Same pattern applied to the newbans.jsonwriter. [3d8dcb1]
Changed
- Boot banner surfaces silent
TRUST_PROXYmisconfigurations. Before,
settingTRUST_PROXY=1with aTRUST_PROXY_FROMthat had typos or
malformed CIDRs would silently drop the bad entries and could leave the
trusted-proxy allowlist completely empty —clientIp()then ignored
CF-Connecting-IP/X-Forwarded-Foron every request, so per-IP rate
limits, audit-log attribution and thecheckOriginX-Forwarded-Host
fallback silently fell back to using the socket peer (typically the
upstream proxy itself, one bucket for everyone). The defensive fallback
was still correct (spoofs got ignored, not honoured), but there was no
way for an operator to discover the misconfiguration short of grepping
audit logs. The boot banner now prints the effective range count +
source (TRUST_PROXY_FROMvs Cloudflare defaults), lists any
unparseable entries by their original string, and warns again when the
resulting allowlist is empty. Seedocs/troubleshooting.mdfor the
remediation paths. [e23d1e9]