Skip to content

Add configurable map defaults via admin settings API#284

Open
Knobee wants to merge 2 commits intobrian7704:masterfrom
Knobee:feature/configurable-map-defaults
Open

Add configurable map defaults via admin settings API#284
Knobee wants to merge 2 commits intobrian7704:masterfrom
Knobee:feature/configurable-map-defaults

Conversation

@Knobee
Copy link
Copy Markdown

@Knobee Knobee commented Apr 16, 2026

Summary

  • Add OTS_MAP_DEFAULT_LAT, OTS_MAP_DEFAULT_LON, OTS_MAP_DEFAULT_ZOOM, OTS_MAP_DEFAULT_LAYER config settings to defaultconfig.py
  • New GET/PUT /api/config endpoint with a whitelist that only exposes safe config keys (map settings initially, expandable for future settings)
  • GET is available to any authenticated user (needed for map rendering), PUT is admin-only
  • Defaults match current hardcoded behavior (lat 10, lon 0, zoom 3, OSM) so existing installs see no change

Test plan

  • GET /api/config returns the four map settings for an authenticated user
  • PUT /api/config with valid keys updates config.yml and in-memory config
  • PUT /api/config with non-whitelisted keys returns 400
  • Non-admin users get 403 on PUT
  • Existing installs without the new keys in config.yml get defaults from defaultconfig.py

Companion UI PR: brian7704/OpenTAKServer-UI
Fixes brian7704/OpenTAKServer-UI#165

🤖 Generated with Claude Code

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.

UI Map Enhancements

1 participant