Repository navigation
20260928 - Ship the CARTO basemap key to nodes with the OS image - #63
Merged
Merged
Conversation
retina-gui reads CARTO_API_KEY to stop the setup wizard's tower map coming back watermarked, and nothing supplies it. CARTO does not refuse an unkeyed request: it answers HTTP 200 with every tile stamped "API KEY REQUIRED", which is the state every node is in today. The key cannot be committed. This repository is public, and a key in its history outlives every rotation. So configuration/retina-gui/retina-gui.yml carries an empty default, CI writes the real value from a repository secret into retina-gui_custom.yml beside it, and with_first_found prefers the latter. That is the arrangement configuration/mender/ already uses for the tenant token, and the same reasoning retina-server states in its own deploy/env.prod.example. Written to /etc/retina-gui/carto.env rather than to /data, which is the part worth pausing on. /data survives an OS update by design, so a file the image writes there only ever reaches a freshly flashed node and never the fleet. /etc is replaced wholesale by every A/B update, so this reaches existing nodes on the next release and rotates with it. retina-gui's unit reads /etc first and then /data, so a node handed its own key by hand keeps it across updates. No key supplied means no file, rather than a file assigning an empty string: the rootfs is rebuilt for every image, so absent cannot be a stale leftover, while an empty assignment would read as a key that had stopped working. A build without the secret still succeeds and produces the watermarked map it produces today. Eight tests cover the arrangement, including two that fail if a key is ever pasted into the committed default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Purple10101
force-pushed
the
20260928-carto-basemap-key
branch
from
September 28, 2026 09:19
41590e7 to
468c9df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
retina-gui reads
CARTO_API_KEYto stop the setup wizard's tower map coming back watermarked (retina-gui#100), and nothing supplies it. CARTO does not refuse an unkeyed request: it answers HTTP 200 with every tile stamped "API KEY REQUIRED", which is the state every node is in today.The key is not in this repo, and cannot be
This repository is public, and a key in its history outlives every rotation.
configuration/retina-gui/retina-gui.ymlcarriescarto_api_key: ""— committed, empty on purpose.retina-gui_custom.ymlbeside it, which is gitignored.with_first_foundinradar_data_bootstrapprefers the CI-written file.That is exactly the arrangement
configuration/mender/already uses for the tenant token, and the same reasoning retina-server states in its owndeploy/env.prod.example. It is also the same key at the other end.Needs one thing before merge: a
CARTO_API_KEYrepository secret. Without it the build still succeeds and produces the watermarked map it produces today.Why
/etcand not/dataThis is the part worth pausing on, because the obvious choice is wrong.
/datasurvives an OS update by design. That means a file the image writes there only ever reaches a freshly flashed node, and never the existing fleet./etcis on the rootfs, which every A/B update replaces wholesale, so it reaches existing nodes on the next release and rotates with it.retina-gui's unit reads
/etc/retina-gui/carto.envfirst and then/data/retina-gui/carto.env, so a node handed its own key by hand keeps it across updates. Later assignment wins in systemd.No key means no file
Rather than a file assigning an empty string. The rootfs is rebuilt for every image, so "absent" cannot be a stale leftover, while an empty assignment would read as a key that had stopped working.
Verification
8 tests in
tests/deployment-values/, covering the empty default, the gitignore entry, the CI step, thewith_first_foundordering, the/etcpath, the skip-when-empty guard and the0600mode.Two of them fail if a key is ever pasted into the committed default — verified by doing exactly that and watching them go red, then restoring.
All four changed/added YAML files parse, and the full suite passes in a venv built the way CI builds one (
pip install 'pytest>=8.0'and nothing else).The first push of this branch failed CI: the new test imported
yaml, which CI does not install. Fixed by asserting the line directly instead, rather than adding a dependency to a deliberately lean CI.tests/contact-emailshows two failures in my local environment. They are not a problem with this branch or withmain— the Tests workflow is green on every recentmainpush — so they look environmental and nothing here touches them.Companion change
This is inert on its own. retina-gui's
systemd/retina-gui.servicecurrently reads only/data/retina-gui/carto.envand needs the/etcline added above it. One line, not in this PR.🤖 Generated with Claude Code