Skip to content

Gate the scoreboard behind LLMVAULT_SCOREBOARD, on by default - #51

Open
incr3d1ble wants to merge 1 commit into
CyberSunil:mainfrom
incr3d1ble:fix/scoreboard-opt-out
Open

incr3d1ble wants to merge 1 commit into
CyberSunil:mainfrom
incr3d1ble:fix/scoreboard-opt-out

Conversation

@incr3d1ble

Copy link
Copy Markdown

Summary

Implements the primary suggestion from #41: the scoreboard can now be disabled for single-player installs, so the local player's name is no longer published to anyone who can reach the server.

Follows the same opt-in/out env pattern the project already uses for debug mode (LLMVAULT_DEBUG, #39).

Changes

  • config.py — new scoreboard_enabled(environ=None) helper next to debug_enabled(). Default is ON (no behaviour change for existing setups); LLMVAULT_SCOREBOARD=0 or false opts out. The comment explains the why.
  • app.py — /scoreboard answers 404 when disabled (the endpoint is simply not there, rather than advertising a locked door). The template context now carries scoreboard_on.
  • templates/base.html — sidebar nav item hides when disabled (block wrapper untouched; the check lives inside nav_score_item, which live_*.html already overrides to empty — no Jinja nesting surprises).
  • templates/welcome.html — dashboard quick-nav tile hides when disabled.
  • tests/test_scoreboard_env.py — new, mirrors test_debug_env.py house style: env helper matrix (default/1/true/empty → on; 0/false → off), route returns 404 when disabled, route renders 200 with content when enabled.

Verification

  • pytest tests/test_scoreboard_env.py -v — 8/8 pass
  • Full suite: 48 passed, 1 failed — the failure (test_expert_unlock.py::test_unlock_events_are_audited_without_secrets) is pre-existing on clean main (verified by stashing this change and re-running), unrelated to this PR. Happy to look at it separately if wanted.

Fixes #41

The scoreboard lists every player's name and score from PROGRESS.
On a shared instance that is the point, but on a single-player
install it publishes the local player's name to anyone who can
reach the server.

Operators can now opt out with LLMVAULT_SCOREBOARD=0 (or false).
When disabled, /scoreboard answers 404 and the nav links in the
sidebar and dashboard hide themselves. Default is unchanged, so
existing setups keep working.

Fixes CyberSunil#41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/scoreboard exposes all player names from all sessions without auth

1 participant