From c62b393c5230bb0d176c29f6facc8b4d566d7ea9 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 3 Jan 2023 21:17:01 -0800 Subject: [PATCH] Set quarantine attribute for downloads on macOS. Signed-off-by: Anders Kaseorg --- app/main/index.ts | 2 ++ package-lock.json | 56 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 59 insertions(+) diff --git a/app/main/index.ts b/app/main/index.ts index 7fbef0f49..523258fac 100644 --- a/app/main/index.ts +++ b/app/main/index.ts @@ -19,6 +19,8 @@ import {sentryInit} from "./sentry.js"; import {setAutoLaunch} from "./startup.js"; import {ipcMain, send} from "./typed-ipc-main.js"; +import "gatemaker/electron-setup"; // eslint-disable-line import/no-unassigned-import + // eslint-disable-next-line @typescript-eslint/naming-convention const {GDK_BACKEND} = process.env; diff --git a/package-lock.json b/package-lock.json index fd072c329..92f6b69a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "electron-updater": "^5.0.1", "electron-window-state": "^5.0.3", "escape-goat": "^3.0.0", + "gatemaker": "^1.0.0", "get-stream": "^6.0.1", "i18n": "^0.15.1", "iso-639-1": "^2.1.9", @@ -4202,6 +4203,19 @@ "node": ">=8" } }, + "node_modules/fs-xattr": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/fs-xattr/-/fs-xattr-0.3.1.tgz", + "integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "!win32" + ], + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4241,6 +4255,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gatemaker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gatemaker/-/gatemaker-1.0.0.tgz", + "integrity": "sha512-X8hOO2gFQh/QzAZSm9MfSlfNIc8JIxzqujz1HkmpPAHTZ4k6u635Chh83Art9PMH7vl5RofLg8I7OhgAdMzD0A==", + "dependencies": { + "uuid": "^8.3.0" + }, + "bin": { + "quarantine": "cli.js" + }, + "optionalDependencies": { + "fs-xattr": "^0.3.1" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -8344,6 +8372,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -13163,6 +13199,12 @@ } } }, + "fs-xattr": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/fs-xattr/-/fs-xattr-0.3.1.tgz", + "integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==", + "optional": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -13193,6 +13235,15 @@ "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, + "gatemaker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gatemaker/-/gatemaker-1.0.0.tgz", + "integrity": "sha512-X8hOO2gFQh/QzAZSm9MfSlfNIc8JIxzqujz1HkmpPAHTZ4k6u635Chh83Art9PMH7vl5RofLg8I7OhgAdMzD0A==", + "requires": { + "fs-xattr": "^0.3.1", + "uuid": "^8.3.0" + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -16202,6 +16253,11 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/package.json b/package.json index ca708386b..af84dcc52 100644 --- a/package.json +++ b/package.json @@ -152,6 +152,7 @@ "electron-updater": "^5.0.1", "electron-window-state": "^5.0.3", "escape-goat": "^3.0.0", + "gatemaker": "^1.0.0", "get-stream": "^6.0.1", "i18n": "^0.15.1", "iso-639-1": "^2.1.9",