Skip to content

20260925 - Report the owner's support email in Mender inventory - #62

Merged
Purple10101 merged 1 commit into
mainfrom
20260924-contact-email-inventory
Sep 25, 2026
Merged

Purple10101 merged 1 commit into
mainfrom
20260924-contact-email-inventory

Conversation

@Purple10101

@Purple10101 Purple10101 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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_end0 on all 21 enrolled boards, so only the email is new.

17c1c13: mender-inventory-retina-contact

  • Reports contact_email from /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.
  • Contact address only, never the claim address (telemetry-claim.json). retina-gui keeps them apart because the claim address decides who owns the node.
  • No email, no attribute. retina-gui deletes the file when every contact box is empty, and a file without an email reports nothing. Consumers should read a missing contact_email as "none given".
  • Sanitised. retina-gui checks only the field's length, so an owner can save a value containing a newline, which would otherwise add attributes of its own (e.g. remote_access=true). Only a single local@domain token with no whitespace or control characters is reported. Anything else, and any missing, truncated or non-object file, reports nothing. Always exits 0.
  • Parses with jq, which the mender role already installs.
  • 7 tests under /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

  • Consent. Inventory goes to hosted.mender.io, a third party, and is visible to anyone with access to the tenant. Owners gave this address through the telemetry flow, and Mender reporting runs under the separate cloud-services toggle. Confirm the agreement wording covers sending it to Mender.

Live verification (2026-09-25)

On one of Josh's test nodes: owl-os-pi5-v0.17.2-dev, bookworm, /bin/sh is dash, jq 1.6. The script was copied from 17c1c13 and its checksum matched the branch.

  • Real data. Against the node's own telemetry-contact.json, it printed contact_email=<the owner's address>, exit 0, 82 ms.
  • Edge cases on the node's dash and jq 1.6. A good address is reported. Newline injection (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.
  • Reaches Mender. Installed at /usr/share/mender/inventory/ and mender-updated restarted, with no deployment in progress. The client logged Inventory data submitted successfully, and the management API showed contact_email on the device, with updated_ts matching the submission. The other attributes (ipv4_wlan0, remote_access, retina_stack) were unaffected.
  • Clearing removes it. With the script removed and mender-updated restarted, the next submission dropped contact_email from 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.
  • Unrelated: mender-inventory-mender-configure fails 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.
  • The node was left as found: script removed, inventory resubmitted.

Reaches the fleet only with the next owl-os release, and only on nodes with cloud services enabled.

🤖 Generated with Claude Code

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>
@Purple10101
Purple10101 merged commit 5faa6b4 into main Sep 25, 2026
1 check passed
@Purple10101
Purple10101 deleted the 20260924-contact-email-inventory branch September 25, 2026 06:28
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