Skip to content

Add game available to configs and endpoint for frontend to check#141

Merged
marcosfrenkel merged 3 commits intomasterfrom
game_availability_through_config
Apr 16, 2026
Merged

Add game available to configs and endpoint for frontend to check#141
marcosfrenkel merged 3 commits intomasterfrom
game_availability_through_config

Conversation

@marcosfrenkel
Copy link
Copy Markdown
Collaborator

@marcosfrenkel marcosfrenkel commented Apr 15, 2026

Description

Adds a GamesAvailability configuration model and a /games/availability API endpoint so the frontend can check which games are enabled on a given node. Also adds a toggle_game CLI command to enable/disable games in config.toml without manually editing the file.

Changes:

  • config.py: New GamesAvailability pydantic model (fields: chsh, qf, ssm, all defaulting to True) added as a field on Settings
  • routes/games.py: New /games/availability GET endpoint returning the current GamesAvailability
  • cli.py: New toggle_game CLI command — accepts one or more game names and --enable/--disable, writes the updated value back to config.toml using tomli-w
  • pyproject.toml / uv.lock: Added tomli-w dependency (webapp extra)

Motivation and Context

The frontend needs to know which games are available on each node so it can show or hide game options accordingly. This allows node operators to configure game availability via config.toml rather than requiring code changes or frontend-specific config.

How have these changes been tested?

  • Verified the /games/availability endpoint returns the correct defaults and respects values set in config.toml
  • Tested toggle_game CLI command with --enable and --disable for each game (chsh, qf, ssm) and confirmed the config.toml is updated correctly
  • Confirmed the server must be restarted for config changes to take effect

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My changes require changes to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests pass.

@marcosfrenkel marcosfrenkel force-pushed the game_availability_through_config branch from 4678c5e to 1471da2 Compare April 16, 2026 20:29
@marcosfrenkel marcosfrenkel merged commit 73f93b8 into master Apr 16, 2026
6 checks passed
@marcosfrenkel marcosfrenkel deleted the game_availability_through_config branch April 16, 2026 20:32
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.

1 participant