20260925 - Report the owner's support email in Mender inventory - #62
Merged
Merged
Conversation
Adds mender-inventory-retina-contact, which reports contact_email from /data/retina-gui/telemetry-contact.json: the support address the owner gave in the setup wizard's contact step or under Configuration > How we reach you. The node's IP address needed no change, since the stock network script already reports ipv4_<iface> on every enrolled board. This is the contact address, not the claim address in telemetry-claim.json. retina-gui keeps the two apart because the claim address decides who owns the node, and this keeps them apart too. An owner who gave no email reports nothing. retina-gui removes the file once every contact box is empty, and a file without an email yields no attribute, so consumers must treat a missing contact_email as "none given". retina-gui checks only the length of this field, not its shape, so an owner can save a value with a newline in it. Echoed as-is, that would let their text add inventory attributes of its own, such as remote_access=true. The script reports only a single local@domain token with no whitespace or control characters, and drops anything else. A missing, truncated or non-object file also reports nothing, and the script always exits 0 so it cannot hold up the rest of the inventory. It parses with jq, which the mender role already installs. Tests run the real script under /bin/sh and pass against jq 1.6 (bookworm, as on the nodes) and jq 1.7.1. CI also checks that the script is executable. Reaches a node only with the next owl-os release, and only while its cloud services are enabled. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Adds the owner's support email to Mender inventory. We were asked to collect the node's IP address and the owner's email. The IP address is already collected: the stock network script reports
ipv4_wlan0/ipv4_end0on all 21 enrolled boards, so only the email is new.17c1c13:
mender-inventory-retina-contactcontact_emailfrom/data/retina-gui/telemetry-contact.json: the support address from the wizard's contact step or Configuration > How we reach you. The existing inventory glob picks it up, so the mender role is unchanged.telemetry-claim.json). retina-gui keeps them apart because the claim address decides who owns the node.contact_emailas "none given".remote_access=true). Only a singlelocal@domaintoken with no whitespace or control characters is reported. Anything else, and any missing, truncated or non-object file, reports nothing. Always exits 0./bin/sh, passing against jq 1.6 (bookworm, as on the nodes) and 1.7.1. The Tests workflow also checks that the script is executable.Before merging
Live verification (2026-09-25)
On one of Josh's test nodes:
owl-os-pi5-v0.17.2-dev, bookworm,/bin/shis dash, jq 1.6. The script was copied from17c1c13and its checksum matched the branch.telemetry-contact.json, it printedcontact_email=<the owner's address>, exit 0, 82 ms.a@b.com\nremote_access=true), an address with a space, a file without an email, a truncated file and a missing file all print nothing and exit 0./usr/share/mender/inventory/andmender-updatedrestarted, with no deployment in progress. The client loggedInventory data submitted successfully, and the management API showedcontact_emailon the device, withupdated_tsmatching the submission. The other attributes (ipv4_wlan0,remote_access,retina_stack) were unaffected.mender-updatedrestarted, the next submission droppedcontact_emailfrom the device, so the client replaces the whole inventory on each send. When an owner clears their email, the attribute disappears within one poll (10 min). This was tested by removing the script rather than editing the owner's contact file, because retina-telemetry forwards that file to the server.mender-inventory-mender-configurefails with a 403 on every poll. It appears 62 times in the journal from before this test, most likely because the configure add-on is disabled on the tenant. It doesn't stop the other attributes being submitted.Reaches the fleet only with the next owl-os release, and only on nodes with cloud services enabled.
🤖 Generated with Claude Code