Skip to content

install.sh: report the install once, so installs can be paired to nodes - #48

Open
Alexgodoroja wants to merge 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:feat/install-analytics
Open

install.sh: report the install once, so installs can be paired to nodes#48
Alexgodoroja wants to merge 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:feat/install-analytics

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Contributor

Nothing today connects "someone ran the installer" to "a node appeared on the network". Release download counts are per-tag and bot-polluted; the registry only ever sees nodes that made it all the way to registration. The gap between the two is invisible — and it is the number actually worth having.

On a first install only, this mints a random install_id, writes ~/.pilot/install.json, and POSTs that file once to https://telemetry.pilotprotocol.network/v1/installs.

The file on disk IS the payload

cat ~/.pilot/install.json answers "what did it send" exactly, with nothing to cross-check:

{ "install_id": "546fcaaacad3432236db3b8a30234dd7",
  "ts": "2026-08-28T01:17:02Z", "entrypoint": "curl-sh",
  "channel": "stable", "tag": "v1.13.9",
  "platform": "linux/arm64", "upgrade": false }

No email, hostname, username, key material, or paths. The server additionally records the request's country and a salted hash of the IP — never the address.

Guarded on the file, not $UPDATING

Matching the config.json and auto-update.json writes above. Re-running the installer is a repair or an upgrade, not a new install: re-minting would double-count and orphan the pair already reported under the old id. A host whose binaries were removed for a clean reinstall keeps the id it already reported.

Opt-out is an env var, not a flag

PILOT_ANALYTICS=0 (or false/no/off). Deliberately not a CLI flag — it stays out of --help, never prompts, and never gates the install. Anything unrecognised means on, the same way common/consent treats a malformed consent flag as true. The doc comment sits below line 32 so --help, which prints lines 4–32, is byte-identical to before.

It cannot block or fail an install

The POST is backgrounded with a hard 2s cap and its exit status discarded. A lost report is always preferable to a blocked install, so the send is fire-and-forget: on a very slow network the report is dropped rather than waited on.

The header no longer over-promises

"Send any personal data anywhere" was true before this change and would not have been after. It is amended, and a new INSTALL ANALYTICS section states exactly what is sent and how to turn it off.

Verified end-to-end

Ran in a Debian container as a non-root user with no TTY — a genuine curl | sh path, against the live ingest:

check result
first install row in telemetry.installs, upgrade=false
PILOT_ANALYTICS=0 no install.json, nothing sent
re-run after opting out mints id, reports, upgrade=true correctly detected
third run install.json unchanged, no second row
shellcheck -s sh 0 findings, same as baseline

Merging this publishes immediately

notify-install-sh-sync.yml dispatches to the website's sync-install-sh.yml, which uploads to the pilot-release-assets R2 bucket. There is no separate release step — merge means live for every new install.

Depends on

The receiving endpoint (POST /v1/installs + the telemetry.installs table) is already deployed and live on pilot-telemetry revision -00011-w58, so this can merge in either order. That change is committed but unpushed — I have READ on pilot-protocol/telemetry and it is private with forking disabled, so it needs someone with write access.

Opened from a fork because this account has push=false on pilot-protocol/release.

🤖 Generated with Claude Code

…to nodes

Nothing today connects "someone ran the installer" to "a node appeared on the
network". Release download counts are per-tag and bot-polluted, and the
registry only ever sees nodes that made it all the way to registration — the
gap between the two is invisible, which is exactly the number worth having.

On a first install only, mints a random install_id, writes ~/.pilot/install.json
and POSTs that file once. The file on disk IS the payload, so
`cat ~/.pilot/install.json` answers "what did it send" with nothing to
cross-check. The daemon reports the same id alongside its node id later, which
turns two anonymous counts into one funnel.

Guarded on the file rather than $UPDATING, matching the config.json and
auto-update.json writes above: re-running the installer is a repair or an
upgrade, not a new install, and re-minting would double-count while orphaning
the pair already reported under the old id.

Off with PILOT_ANALYTICS=0. Deliberately an env var and not a flag — it stays
out of --help, never prompts, and never gates the install. The POST is
backgrounded with a 2s cap and its status discarded: a lost report is always
preferable to a blocked install.

The header's "does not send any personal data" claim is amended rather than
left standing, and a new INSTALL ANALYTICS section states exactly what is sent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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