Repository navigation
feat: make analytics_opt_out the single switch for error reporting - #3538
Open
vpetersson-bot wants to merge 1 commit into
Open
vpetersson-bot wants to merge 1 commit into
vpetersson-bot wants to merge 1 commit into
Conversation
analytics_opt_out in anthias.conf used to turn off GA telemetry and strip PII from Sentry, but crash reports still went out, and the anthias-wifi-connect container kept reporting regardless. Opting out meant also setting SENTRY_DSN and adding WIFI_CONNECT_NO_SENTRY to docker-compose.yml by hand, which every upgrade then threw away. - settings.py: the default Sentry DSN is empty when the operator opted out. An explicit SENTRY_DSN still wins. - bin/analytics_opt_out.sh reads the key the way configparser does; upgrade_containers.sh renders its answer into the wifi-connect service as WIFI_CONNECT_NO_SENTRY on every run, so the opt-out survives upgrades. - Docs: FAQ entry, a section on the WiFi setup page, and the comment in the shipped anthias.conf. Balena can't propagate a file setting into another service, so it is documented as a device variable there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
|
vpetersson
approved these changes
Nov 30, 2026
This branch has not been deployed
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
analytics_opt_outin~/.anthias/anthias.confbecomes the one switch for everything that reports home: Google Analytics, Anthias's own Sentry, and Sentry inanthias-wifi-connect.Why
Today the opt-out turns off GA and strips PII from Sentry events, but crash reports still go out. The Wi-Fi setup service (wifi-connect, which now reports to Sentry upstream) ignores it entirely. To really opt out, an operator had to set
SENTRY_DSNas well and addWIFI_CONNECT_NO_SENTRY=truetodocker-compose.ymlby hand.upgrade_containers.shregenerates that file from its template on every run, so the hand edit was lost on each upgrade.How
django_project/settings.py: the default Sentry DSN is empty whenanalytics_opt_outis on. An explicitSENTRY_DSNstill wins, so an operator who points Anthias at their own Sentry keeps that.bin/analytics_opt_out.sh(new): printstrue/falsefor the key, using the same rules as configparser'sgetboolean(case-insensitive key,=or:,1/yes/true/on). A missing file, missing key or unexpected value givesfalse, which is also the server's default. It always prints exactly one word because wifi-connect rejects values it can't parse, and a rejected value would stop the portal starting.bin/upgrade_containers.shexports the answer beforeenvsubst, anddocker-compose.yml.tmplpasses it to the wifi-connect service asWIFI_CONNECT_NO_SENTRY. The existingup -d --no-start anthias-wifi-connectrecreates the container when its definition changes, so the setting takes effect on the next upgrade and stays in place after that.anthias.conf, and wifi-connect is an upstreamFROM scratchimage that only reads environment variables. On balena the docs therefore say to set the device variableWIFI_CONNECT_NO_SENTRY=trueas well. The balena templates are unchanged.anthias.conf.Testing
tests/test_analytics_opt_out_script.py(new): runs the helper against true, false and malformed values,on/offas written byAnthiasSettings.save(), CRLF line endings, commented-out keys, the wrong section and a missing file, and checks that its answer matches configparser. It also checks that the template uses the variable and that the upgrade script exports it before rendering.tests/test_sentry.py: the DSN-default helper and the pinned source expression now cover the opt-out.pyteston the sentry, telemetry, settings, wifi-connect, upgrade-script, core-dump and balena-compose suites: 264 passed.ruff checkandruff format --checkpass, andshellcheckis clean on the new script.envsubstand confirmedWIFI_CONNECT_NO_SENTRY=trueends up in the wifi-connect service.🤖 Generated with Claude Code