@sentry/cli 1.72.1 → 1.73.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  "You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott
4
4
 
5
+ ## 1.73.1
6
+
7
+ ### Various fixes & improvements
8
+
9
+ - feat: Allow for using local binary through SENTRYCLI_USE_LOCAL env (#1129) by @kamilogorek
10
+ - ref: Dont panic on malformed xcodeproj directories (#1127) by @kamilogorek
11
+
12
+ ## 1.73.0
13
+
14
+ * feat: Add checksum validation for installed binaries (set `SENTRYCLI_SKIP_CHECKSUM_VALIDATION` to opt-out) (#1123)
15
+ * fix: Detect unwind and debug information in files linked with `gold` (#1124)
16
+ * ref: Silence progress bar in CI environments by default (#1122)
17
+
18
+ ## 1.72.2
19
+
20
+ * feat: Use default xcode values for plist struct (#1111)
21
+ * fix: Fixes a panic when inspecting debug files larger than 4GB (#1117)
22
+ * ref: Update log message when bundle ID is missing (#1113)
23
+
5
24
  ## 1.72.1
6
25
 
7
26
  * fix: Dont include `debug_id` during assemble when not PDBs are not supported (#1110)
package/checksums.txt ADDED
@@ -0,0 +1,9 @@
1
+ sentry-cli-Darwin-arm64=94134d4e93df23462698f09ff172b53abcff13ef929507670372c84b20f776b7
2
+ sentry-cli-Darwin-universal=041e3994de2d49c562792ae74d2a4f9be1fa145f267dcb1ec894cd83cb8ec2f6
3
+ sentry-cli-Darwin-x86_64=2b236ce84f866251013964ad4190ee6be8e8079d52d5b38d0efd13a468073f20
4
+ sentry-cli-Linux-aarch64=3dc9dacf69d55f4fe64e67dccbea647f50f884019e0d0eb58534f407bbde7fbd
5
+ sentry-cli-Linux-armv7=28bbd534ab4312e6a49b9792cf6f12c77fe5a280fa7bb7d71101af66ce3380b5
6
+ sentry-cli-Linux-i686=437eeed2799dabae95e3fda76ddff649604729068265b2c2d88afff1a3a64446
7
+ sentry-cli-Linux-x86_64=85ca7fce2267088766fdb6d00d6ff3ad45e43c234eab21a107e70292cee714c7
8
+ sentry-cli-Windows-i686.exe=e994d15f6d6300feaca1f178d4b980b44162e8d9fac7ef23fff9490fd033aa6a
9
+ sentry-cli-Windows-x86_64.exe=224a411aa268183576b56cd3978a4cd5e58bea4753f67bcfda51be5b46a5a58b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "1.72.1",
3
+ "version": "1.73.1",
4
4
  "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/",
5
5
  "homepage": "https://docs.sentry.io/hosted/learn/cli/",
6
6
  "license": "BSD-3-Clause",
@@ -40,7 +40,8 @@
40
40
  "node-fetch": "^2.6.7",
41
41
  "npmlog": "^4.1.2",
42
42
  "progress": "^2.0.3",
43
- "proxy-from-env": "^1.1.0"
43
+ "proxy-from-env": "^1.1.0",
44
+ "which": "^2.0.2"
44
45
  },
45
46
  "devDependencies": {
46
47
  "eslint": "^6.8.0",
@@ -18,6 +18,7 @@ const Proxy = require('proxy-from-env');
18
18
  // NOTE: Can be dropped in favor of `fs.mkdirSync(path, { recursive: true })` once we stop supporting Node 8.x
19
19
  const mkdirp = require('mkdirp');
20
20
  const npmLog = require('npmlog');
21
+ const which = require('which');
21
22
 
22
23
  const helper = require('../js/helper');
23
24
  const pkgInfo = require('../package.json');
@@ -48,8 +49,9 @@ function shouldRenderProgressBar() {
48
49
  const silentFlag = process.argv.some(v => v === '--silent');
49
50
  const silentConfig = process.env.npm_config_loglevel === 'silent';
50
51
  const silentEnv = process.env.SENTRY_NO_PROGRESS_BAR;
52
+ const ciEnv = process.env.CI === 'true';
51
53
  // If any of possible options is set, skip rendering of progress bar
52
- return !(silentFlag || silentConfig || silentEnv);
54
+ return !(silentFlag || silentConfig || silentEnv || ciEnv);
53
55
  }
54
56
 
55
57
  function getDownloadUrl(platform, arch) {
@@ -149,11 +151,64 @@ function getTempFile(cached) {
149
151
  .slice(2)}.tmp`;
150
152
  }
151
153
 
154
+ function validateChecksum(tempPath, name) {
155
+ let storedHash;
156
+ try {
157
+ const checksums = fs.readFileSync(path.join(__dirname, '../checksums.txt'), 'utf8');
158
+ const entries = checksums.split('\n');
159
+ for (let i = 0; i < entries.length; i++) {
160
+ const [key, value] = entries[i].split('=');
161
+ if (key === name) {
162
+ storedHash = value;
163
+ break;
164
+ }
165
+ }
166
+ } catch (e) {
167
+ npmLog.info(
168
+ 'Checksums are generated when the package is published to npm. They are not available directly in the source repository. Skipping validation.'
169
+ );
170
+ return;
171
+ }
172
+
173
+ if (!storedHash) {
174
+ npmLog.info(`Checksum for ${name} not found, skipping validation.`);
175
+ return;
176
+ }
177
+
178
+ const currentHash = crypto
179
+ .createHash('sha256')
180
+ .update(fs.readFileSync(tempPath))
181
+ .digest('hex');
182
+
183
+ if (storedHash !== currentHash) {
184
+ fs.unlinkSync(tempPath);
185
+ throw new Error(
186
+ `Checksum validation for ${name} failed.\nExpected: ${storedHash}\nReceived: ${currentHash}`
187
+ );
188
+ } else {
189
+ npmLog.info('Checksum validation passed.');
190
+ }
191
+ }
192
+
152
193
  function downloadBinary() {
153
194
  const arch = os.arch();
154
195
  const platform = os.platform();
155
196
  const outputPath = helper.getPath();
156
197
 
198
+ if (process.env.SENTRYCLI_USE_LOCAL === '1') {
199
+ try {
200
+ const binPath = which.sync('sentry-cli');
201
+ npmLog.info('sentry-cli', `Using local binary: ${binPath}`);
202
+ fs.copyFileSync(binPath, outputPath);
203
+ return Promise.resolve();
204
+ } catch (e) {
205
+ throw new Error(
206
+ 'Configured installation of local binary, but it was not found.' +
207
+ 'Make sure that `sentry-cli` executable is available in your $PATH or disable SENTRYCLI_USE_LOCAL env variable.'
208
+ );
209
+ }
210
+ }
211
+
157
212
  const downloadUrl = getDownloadUrl(platform, arch);
158
213
  if (!downloadUrl) {
159
214
  return Promise.reject(new Error(`Unsupported target ${platform}-${arch}`));
@@ -216,6 +271,9 @@ function downloadBinary() {
216
271
  .on('error', e => reject(e))
217
272
  .on('close', () => resolve());
218
273
  }).then(() => {
274
+ if (process.env.SENTRYCLI_SKIP_CHECKSUM_VALIDATION !== '1') {
275
+ validateChecksum(tempPath, name);
276
+ }
219
277
  fs.copyFileSync(tempPath, cachedPath);
220
278
  fs.copyFileSync(tempPath, outputPath);
221
279
  fs.unlinkSync(tempPath);