fix(rust): nothing names who is online by default
All checks were successful
PR Checks / client-build (pull_request) Successful in 27s
PR Checks / frozen-manifest (pull_request) Successful in 51s
PR Checks / server-tests (pull_request) Successful in 8m6s

The org lead's rule, settled 2026-09-22: who is online is always the
narrowest audience - staff - unless an operator deliberately widens it,
and a count is fine where a list of names is not.

The public site broke that in three places since phase 4. The Online
tab named every player, the feed carried joins, respawns, deaths, chat
and tallies, and the leaderboard's lastSeen - refreshed every minute by
a gather tally - said who was on as plainly as either. All three now
sit behind one setting:

* PRESENCE_KINDS, a subset of the public allowlist, gated per request.
  Below the audience the feed keeps the server's own story (wipe, start,
  shutdown) and says presenceHidden rather than looking quiet.
* the Online route answers { players: [], hidden, count, audience } -
  same shape, so an older client renders empty rather than breaking.
* rungs staff / signed_in / public, fleet-wide default in a new
  rust_settings table with an optional per-server override on
  rust_servers; an unknown stored word narrows to staff.
* the viewer's standing is RE-READ from the users row (ctx.users.getById),
  not taken from the token, so a demotion or a ban applies on the next
  request. Walked: a moderator demoted mid-session lost the roll call on
  the same cookie.
* per-viewer answers are Cache-Control: private, no-store.
* GET/PUT /admin/rust/visibility (requireRole admin) and an admin page,
  Rust visibility; every save is one activity-log row.

The browser walk also found every empty state in this module rendering
as a blank box. Core's EmptyState renders children only; this module
passed title/message (the shape the Integration Kit template teaches)
and React dropped both without a word. Fixed module-side with a small
Empty wrapper - nothing core or module-uo renders changes - and a client
test that refuses a titled EmptyState or a PageHeader subtitle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-09-23 00:30:08 -05:00
parent 480a99f661
commit be44839896
31 changed files with 1739 additions and 33 deletions

View File

@@ -683,6 +683,68 @@
}
}
},
"/api/v1/admin/rust/visibility": {
"get": {
"tags": [
"Admin · Rust"
],
"summary": "Who may see who is online",
"description": "The fleet default and every server’s optional override. It governs the Online list, every feed item that names a player who was on the server (connects, respawns, deaths, chat, tallies) and the leaderboard’s `lastSeen`. The default is `staff`: nothing names who is online until an operator widens it. The player count is public at every setting.",
"responses": {
"200": {
"description": "The fleet default and each server",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RustVisibility"
}
}
}
},
"500": {
"description": "Internal Server Error"
}
}
},
"put": {
"tags": [
"Admin · Rust"
],
"summary": "Change who may see who is online",
"description": "Sets the fleet default, one or more server overrides, or both. A server set to `null` follows the fleet default again. Validated whole before anything is written: a request naming a server that does not exist changes nothing.",
"responses": {
"200": {
"description": "Saved; answers the new state",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RustVisibility"
}
}
}
},
"400": {
"description": "An audience that does not exist"
},
"404": {
"description": "A server that does not exist"
},
"500": {
"description": "Internal Server Error"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RustVisibilityUpdate"
}
}
}
}
}
},
"/api/v1/admin/users/{id}/rust/links": {
"get": {
"tags": [
@@ -1245,7 +1307,7 @@
"Public · Rust"
],
"summary": "Recent events on one Rust server",
"description": "The killfeed and everything else public that happened on a server, newest first. Narrow with `kind` (comma-separated) and `wipe`. Only publicly classified kinds are ever returned — moderation events, login attempts and anything carrying an IP address are stored but never served here.",
"description": "The killfeed and everything else public that happened on a server, newest first. Narrow with `kind` (comma-separated) and `wipe`. Only publicly classified kinds are ever returned — moderation events, login attempts and anything carrying an IP address are stored but never served here. Kinds that name a player who was on the server (connects, respawns, deaths, chat, tallies) are served only to viewers inside the operator’s presence audience, which defaults to staff; `presenceHidden` says when they were withheld.",
"parameters": [
{
"name": "id",
@@ -1300,7 +1362,7 @@
"Public · Rust"
],
"summary": "The leaderboard for one Rust server",
"description": "Per-wipe when `wipe` is given, all-time otherwise. All-time is the per-wipe rows summed rather than a second set of counters, so a wipe splits a player’s history without ending it.",
"description": "Per-wipe when `wipe` is given, all-time otherwise. All-time is the per-wipe rows summed rather than a second set of counters, so a wipe splits a player’s history without ending it. `lastSeen` is withheld below the operator’s presence audience: a gather tally refreshes it every minute a player is on, so it would name who is online.",
"parameters": [
{
"name": "id",
@@ -1355,7 +1417,7 @@
"Public · Rust"
],
"summary": "Who is on one Rust server right now",
"description": "Read from the presence board the bridge re-sends on every connect and every minute, rather than counted from connect and disconnect events — so it is correct even after the website has missed one.",
"description": "Read from the presence board the bridge re-sends on every connect and every minute, rather than counted from connect and disconnect events — so it is correct even after the website has missed one. **Nothing names who is online by default**: below the operator’s presence audience (staff unless widened) the names are withheld and only `count` is answered.",
"parameters": [
{
"name": "id",
@@ -1369,7 +1431,14 @@
],
"responses": {
"200": {
"description": "Who is online"
"description": "Who is online — or, below the operator’s presence audience, only how many",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RustOnline"
}
}
}
},
"500": {
"description": "Internal Server Error"
@@ -3894,6 +3963,374 @@
}
}
},
"RustOnline": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"description": {
"type": "string",
"example": "Who is on one server (GET /public/rust/servers/{id}/online). Below the operator’s presence audience the names are withheld and only the count is answered — nothing names who is online by default."
},
"properties": {
"type": "object",
"properties": {
"players": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "array"
},
"description": {
"type": "string",
"example": "Empty whenever `hidden` is true."
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"properties": {
"type": "object",
"properties": {
"steamId": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"example": {
"type": "string",
"example": "76561198000000000"
}
}
},
"name": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"nullable": {
"type": "boolean",
"example": true
},
"example": {
"type": "string",
"example": "Wanderer"
}
}
},
"sleeping": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "boolean"
},
"example": {
"type": "boolean",
"example": false
}
}
},
"connectedAt": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"nullable": {
"type": "boolean",
"example": true
}
}
}
}
}
}
}
}
},
"hidden": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "boolean"
},
"description": {
"type": "string",
"example": "Were the names withheld from this viewer?"
},
"example": {
"type": "boolean",
"example": true
}
}
},
"count": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "integer"
},
"description": {
"type": "string",
"example": "How many are online. Public at every audience."
},
"example": {
"type": "number",
"example": 12
}
}
},
"audience": {
"$ref": "#/components/schemas/RustAudience"
}
}
}
}
},
"RustAudience": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"enum": {
"type": "array",
"example": [
"staff",
"signed_in",
"public"
],
"items": {
"type": "string"
}
},
"description": {
"type": "string",
"example": "Who may see something: admins and moderators, any signed-in account, or anybody. Ordered — each includes the ones before it."
},
"example": {
"type": "string",
"example": "staff"
}
}
},
"RustVisibility": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"description": {
"type": "string",
"example": "Who may see who is online: the fleet default and each server’s optional override (GET /admin/rust/visibility)."
},
"properties": {
"type": "object",
"properties": {
"audiences": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "array"
},
"items": {
"$ref": "#/components/schemas/RustAudience"
}
}
},
"presence": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"properties": {
"type": "object",
"properties": {
"fleet": {
"$ref": "#/components/schemas/RustAudience"
},
"servers": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "array"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"example": {
"type": "string",
"example": "main"
}
}
},
"name": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"example": {
"type": "string",
"example": "Main · Vanilla"
}
}
},
"enabled": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "boolean"
},
"example": {
"type": "boolean",
"example": true
}
}
},
"override": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"nullable": {
"type": "boolean",
"example": true
},
"enum": {
"type": "array",
"example": [
"staff",
"signed_in",
"public",
null
],
"items": {}
},
"description": {
"type": "string",
"example": "This server’s own choice, or null to follow the fleet default."
}
}
},
"effective": {
"$ref": "#/components/schemas/RustAudience"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"RustVisibilityUpdate": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"description": {
"type": "string",
"example": "A change to who may see who is online. Either part may be omitted; a server set to null follows the fleet default again."
},
"properties": {
"type": "object",
"properties": {
"fleet": {
"$ref": "#/components/schemas/RustAudience"
},
"servers": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "object"
},
"additionalProperties": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "string"
},
"nullable": {
"type": "boolean",
"example": true
},
"enum": {
"type": "array",
"example": [
"staff",
"signed_in",
"public",
null
],
"items": {}
}
}
},
"example": {
"type": "object",
"properties": {
"main": {
"type": "string",
"example": "public"
},
"pvp": {}
}
}
}
}
}
}
}
},
"RustSidecarProbe": {
"type": "object",
"properties": {