@runinfra/cli 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,6 +65,93 @@ yet. Run the CLI from a checkout instead, see [Development](#development).
65
65
 
66
66
  ---
67
67
 
68
+ ## Verifying a release
69
+
70
+ Every release publishes `SHA256SUMS`, which lists the sha256 of each binary,
71
+ and `SHA256SUMS.sig`, an Ed25519 signature over that file.
72
+
73
+ `install.sh` checks both for you. It carries the public key **inside the
74
+ script** rather than fetching it, because a key downloaded from the same host
75
+ as the binary proves nothing: whoever can replace one can replace the other and
76
+ serve a matching pair. It verifies the signature before it reads a single hash
77
+ out of `SHA256SUMS`, and a bad signature ends the install rather than printing
78
+ a warning.
79
+
80
+ A **missing** signature ends the install too, when the artifacts came from a
81
+ release. An attacker who can serve you a swapped binary can also delete the
82
+ signature that would expose it, so a check that disappears on request is not a
83
+ check. If you are deliberately mirroring a release, or installing one published
84
+ before the signing key existed, `RUNINFRA_ALLOW_UNSIGNED=1` skips it and says
85
+ so, and artifacts taken from your own `--base-url` are never held to this rule.
86
+
87
+ Being unable to **perform** the check is the one case that stays a warning. If
88
+ the host has no `openssl`, or none that can do Ed25519, `install.sh` says so on
89
+ one line, names that exact reason, and continues on the checksum alone.
90
+ Refusing to install on a minimal container would cost more than it buys, and
91
+ the checksum still refuses a bad download. On macOS it looks past the LibreSSL
92
+ at `/usr/bin/openssl`, which cannot do the job, and tries the Homebrew
93
+ `openssl@3` locations before it gives up.
94
+
95
+ `install.ps1` does not check the signature. Windows PowerShell 5.1 has no
96
+ Ed25519 and .NET only gained one in 8, so it verifies the checksum, prints the
97
+ command below, and tells you which check it skipped rather than letting you
98
+ assume both ran.
99
+
100
+ To check a release by hand, save this as `runinfra-release.pub`:
101
+
102
+ ```
103
+ -----BEGIN PUBLIC KEY-----
104
+ MCowBQYDK2VwAyEAYkEJIc7GfRAHAvUXcY/jrtnwFj53XZNDoXE6cAkOxYk=
105
+ -----END PUBLIC KEY-----
106
+ ```
107
+
108
+ Its fingerprint is sha256 over the raw 32 byte key, and you can derive it from
109
+ the file you just saved rather than taking this line on trust:
110
+
111
+ ```console
112
+ $ openssl pkey -pubin -in runinfra-release.pub -outform DER | tail -c 32 | sha256sum
113
+ 5b2c8f637c0cd00a61ec6f126e5a9493c022ef1ea5be70fdd3ef4adf55801532
114
+ ```
115
+
116
+ Then, in the directory holding the downloaded files:
117
+
118
+ ```console
119
+ $ openssl pkeyutl -verify -pubin -inkey runinfra-release.pub -rawin -in SHA256SUMS -sigfile SHA256SUMS.sig
120
+ Signature Verified Successfully
121
+
122
+ $ sha256sum --ignore-missing -c SHA256SUMS
123
+ runinfra-linux-x64: OK
124
+ ```
125
+
126
+ Run them in that order. The signature is what makes the checksum worth
127
+ checking: `SHA256SUMS` arrives from the same place as the binary, so anyone who
128
+ can swap the binary can swap its recorded hash to match. Verify the signature
129
+ first, then let the verified `SHA256SUMS` speak for the bytes.
130
+
131
+ Two things that are a failed check rather than a bad file. If the signature is
132
+ published base64 encoded rather than as 64 raw bytes, decode it first and point
133
+ `-sigfile` at the result, `base64 -d SHA256SUMS.sig > SHA256SUMS.sig.raw`, with
134
+ `-D` instead of `-d` on macOS. And
135
+ `-rawin` needs OpenSSL 1.1.1 or newer: the `openssl` on a stock macOS is
136
+ LibreSSL, whose `pkeyutl` has no `-rawin` at all, so it answers with a usage
137
+ error rather than a verdict. Read that as "not checked", not as "bad", and
138
+ install OpenSSL through Homebrew if you want the real answer.
139
+
140
+ ### What a good signature proves
141
+
142
+ It proves the RunInfra release pipeline signed that file with the private half
143
+ of the key above, and that nothing has altered it since.
144
+
145
+ It does **not** prove that pipeline was not subverted. The signing key lives in
146
+ CI, so anyone who could steal the release token or edit the release workflow
147
+ could also reach the key and sign whatever they wanted. What this closes is a
148
+ release asset altered after publication, and a mirror or CDN serving something
149
+ other than what was published. Both are real attacks and both are worth
150
+ closing. Neither is the same thing as the download being tamper proof, and we
151
+ do not claim it is.
152
+
153
+ ---
154
+
68
155
  ## What the CLI never does
69
156
 
70
157
  - **It never sees your password.** Sign-in happens in your browser, in your
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const CLI_NAME = "runinfra";
2
2
  export const CLI_PACKAGE = "@runinfra/cli";
3
- export const CLI_VERSION = "0.2.0";
3
+ export const CLI_VERSION = "0.2.2";
4
4
  export const CLI_CLIENT_ID = "runinfra-cli";
5
5
  export const MINIMUM_NODE_MAJOR = 20;
6
6
  export function isSupportedNodeVersion(version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runinfra/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "RunInfra CLI: browser-approved sign-in and resumable downloads for optimized model packages",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://runinfra.ai/catalog",