app-builder-lib 27.0.0-alpha.10 → 27.0.0-alpha.12
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/dist/asar/asarAlign.d.ts +35 -0
- package/dist/asar/asarAlign.d.ts.map +1 -0
- package/dist/asar/asarAlign.js +149 -0
- package/dist/asar/asarAlign.js.map +1 -0
- package/dist/asar/asarUtil.d.ts +15 -1
- package/dist/asar/asarUtil.d.ts.map +1 -1
- package/dist/asar/asarUtil.js +111 -61
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/win/authenticodeSignature.d.ts +71 -0
- package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
- package/dist/codeSign/win/authenticodeSignature.js +241 -0
- package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +11 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +36 -16
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
- package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
- package/dist/codeSign/win/verifyUpdatePublisher.js +98 -0
- package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
- package/dist/configuration.d.ts +16 -13
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +15 -0
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +33 -2
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
- package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
- package/dist/electron/mac/asarIntegrityDigest.js +122 -0
- package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
- package/dist/electron/mac/electronMac.js +1 -28
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +8 -0
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
- package/dist/electron/mac/electronMacUtils.js +36 -0
- package/dist/electron/mac/electronMacUtils.js.map +1 -1
- package/dist/fileMatcher.d.ts +47 -12
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +150 -45
- package/dist/fileMatcher.js.map +1 -1
- package/dist/forge-maker.d.ts +64 -0
- package/dist/forge-maker.d.ts.map +1 -1
- package/dist/forge-maker.js +104 -2
- package/dist/forge-maker.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +5 -3
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +5 -3
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +6 -0
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +48 -2
- package/dist/macPackager.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +4 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -1
- package/dist/options/FuseOptionsV1.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +166 -8
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +36 -15
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +53 -18
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +15 -1
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +7 -4
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +6 -0
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +11 -4
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +53 -18
- package/dist/platformPackager.js.map +1 -1
- package/dist/presets/rectCra.js +3 -1
- package/dist/presets/rectCra.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +6 -1
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +80 -58
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +8 -10
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.d.ts.map +1 -1
- package/dist/targets/ArchiveTarget.js +7 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +12 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +17 -3
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +3 -2
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +3 -2
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +238 -48
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +10 -14
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -3
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +45 -20
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +5 -1
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +3 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +2 -2
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +13 -9
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/flatpakBundle.d.ts +43 -0
- package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
- package/dist/targets/linux/flatpakBundle.js +210 -0
- package/dist/targets/linux/flatpakBundle.js.map +1 -0
- package/dist/targets/linux/snap/core24.d.ts +0 -18
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +29 -100
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +7 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +25 -6
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
- package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapPlugs.js +242 -0
- package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +47 -3
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +1 -0
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +1 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +8 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +36 -5
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +6 -4
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +7 -2
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/targets/win/winAppUtil.d.ts +2 -2
- package/dist/targets/win/winAppUtil.d.ts.map +1 -1
- package/dist/targets/win/winAppUtil.js +5 -3
- package/dist/targets/win/winAppUtil.js.map +1 -1
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +19 -19
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/nsis.js +1 -1
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +14 -1
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +14 -1
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/util/AppFileWalker.js +9 -1
- package/dist/util/AppFileWalker.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +15 -2
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +30 -20
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/config/config.d.ts +1 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +42 -19
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/fileOptions.d.ts +52 -0
- package/dist/util/config/fileOptions.d.ts.map +1 -0
- package/dist/util/config/fileOptions.js +210 -0
- package/dist/util/config/fileOptions.js.map +1 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
- package/dist/util/config/legacyConfigGuard.js +31 -4
- package/dist/util/config/legacyConfigGuard.js.map +1 -1
- package/dist/util/config/legacyOptions.d.ts +11 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -1
- package/dist/util/config/legacyOptions.js +36 -10
- package/dist/util/config/legacyOptions.js.map +1 -1
- package/dist/util/electronGet.d.ts +13 -0
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +40 -17
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/removedEnvVars.d.ts +25 -0
- package/dist/util/removedEnvVars.d.ts.map +1 -0
- package/dist/util/removedEnvVars.js +54 -0
- package/dist/util/removedEnvVars.js.map +1 -0
- package/dist/util/trustedSourceRoots.d.ts +59 -0
- package/dist/util/trustedSourceRoots.d.ts.map +1 -0
- package/dist/util/trustedSourceRoots.js +127 -0
- package/dist/util/trustedSourceRoots.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +18 -17
- package/scheme.json +421 -436
- package/templates/nsis/include/installer.nsh +11 -8
- package/templates/nsis/installSection.nsh +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublishManager.d.ts","sourceRoot":"","sources":["../../src/publish/PublishManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,
|
|
1
|
+
{"version":3,"file":"PublishManager.d.ts","sourceRoot":"","sources":["../../src/publish/PublishManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAYL,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,iBAAiB,EAUjB,OAA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B,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,UAyBtI;AAED,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,qBAAqB,EAAE,4BAA4B,GAAG,OAAO,EAC7D,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,CA2B7C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arch, asArray, AsyncTaskManager, derivePublicKeyPem, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml, } from "builder-util";
|
|
1
|
+
import { Arch, asArray, AsyncTaskManager, derivePublicKeyPem, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, prepareFixedNameWrite, safeStringifyJson, serializeToYaml, } from "builder-util";
|
|
2
2
|
import { computeUpdateManifestKeyId, getS3LikeProviderBaseUrl, githubTagPrefix, githubUrl, normalizePublicKeyList, } from "builder-util-runtime";
|
|
3
3
|
import _debug from "debug";
|
|
4
4
|
import { BitbucketPublisher, getCiTag, GitHubPublisher, GitlabPublisher, KeygenPublisher, R2Publisher, S3Publisher, SnapStorePublisher, SpacesPublisher, } from "electron-publish";
|
|
@@ -22,8 +22,6 @@ function checkOptions(publishPolicy) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
/** Emitted once per feed (the url without its query) per process — app-update.yml is written for every pack, and platforms may use different feeds. */
|
|
26
|
-
const feedQueryWarnedFeeds = new Set();
|
|
27
25
|
/**
|
|
28
26
|
* electron-updater 7 adds the query string of a generic feed url (typically a token), like the credential headers, only to
|
|
29
27
|
* downloads on the feed's origin. An app whose latest*.yml points downloads at another origin that relies on that query gets
|
|
@@ -38,13 +36,9 @@ export function warnAboutGenericFeedQuery(publishConfig) {
|
|
|
38
36
|
if (queryStart < 0) {
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
41
|
-
|
|
42
|
-
if (feedQueryWarnedFeeds.has(feed)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
feedQueryWarnedFeeds.add(feed);
|
|
39
|
+
// once per feed (the url without its query) per process — app-update.yml is written for every pack, and platforms may use different feeds
|
|
46
40
|
const queryParameters = [...new Set(new URLSearchParams(url.slice(queryStart + 1).split("#")[0]).keys())];
|
|
47
|
-
log.warn({
|
|
41
|
+
log.once(`generic-feed-query:${url.slice(0, queryStart)}`).warn({
|
|
48
42
|
queryParameters: queryParameters.length === 0 ? "(none)" : queryParameters.join(", "),
|
|
49
43
|
solution: "serve the update files from the feed origin (relative files[].url, the default) or use pre-signed URLs",
|
|
50
44
|
}, "the generic publish url has a query string. electron-updater 7 (electron-builder v27) adds it, and sends the credential headers from requestHeaders / addAuthHeader, " +
|
|
@@ -52,10 +46,6 @@ export function warnAboutGenericFeedQuery(publishConfig) {
|
|
|
52
46
|
"Nothing changes for the relative URLs electron-builder writes. " +
|
|
53
47
|
"See https://www.electron.build/docs/migration/v27-breaking-changes#update-credentials-stay-on-the-feeds-origin");
|
|
54
48
|
}
|
|
55
|
-
/** @internal exported for tests — re-arms the once-per-feed warning. */
|
|
56
|
-
export function resetGenericFeedQueryWarning() {
|
|
57
|
-
feedQueryWarnedFeeds.clear();
|
|
58
|
-
}
|
|
59
49
|
/**
|
|
60
50
|
* v26 published implicitly when it detected a CI tag; v27 requires an explicit `--publish` policy.
|
|
61
51
|
* Without a signal, a tagged release pipeline goes green and uploads nothing — the build looks
|
|
@@ -134,7 +124,7 @@ export class PublishManager {
|
|
|
134
124
|
}
|
|
135
125
|
const publishConfig = await createAppUpdateConfiguration(packager, publishConfigs, this.isPublish, false);
|
|
136
126
|
if (publishConfig != null) {
|
|
137
|
-
await writeAppUpdateYaml(packager.getResourcesDir(event.appOutDir), publishConfig);
|
|
127
|
+
await writeAppUpdateYaml(packager.getResourcesDir(event.appOutDir), publishConfig, event.appOutDir);
|
|
138
128
|
}
|
|
139
129
|
});
|
|
140
130
|
packager.onArtifactCreated(async (event) => {
|
|
@@ -170,7 +160,11 @@ export class PublishManager {
|
|
|
170
160
|
}
|
|
171
161
|
const { emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, true);
|
|
172
162
|
if (emitsManifest && !this.cancellationToken.cancelled) {
|
|
173
|
-
await packager.requireUpdateSigningKeys(true);
|
|
163
|
+
const signingKeys = await packager.requireUpdateSigningKeys(true);
|
|
164
|
+
const updateManifestConfig = packager.updateManifestOptions;
|
|
165
|
+
if (updateManifestConfig !== false) {
|
|
166
|
+
checkSigningKeysTrusted(packager, signingKeys, normalizeExplicitPublicKeys(updateManifestConfig?.publicKey), true);
|
|
167
|
+
}
|
|
174
168
|
}
|
|
175
169
|
}
|
|
176
170
|
}
|
|
@@ -339,9 +333,6 @@ async function resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPub
|
|
|
339
333
|
}
|
|
340
334
|
return { publishConfigs: writers[0].publishConfigs, emitsManifest: true };
|
|
341
335
|
}
|
|
342
|
-
// keyed by platform packager (one per platform and build): afterPack and the targets writing app-update.yml themselves
|
|
343
|
-
// resolve the same pack, and every arch usually repeats the same conflict - report each one once
|
|
344
|
-
const reportedFeedConflicts = new WeakMap();
|
|
345
336
|
/**
|
|
346
337
|
* Targets of one pack resolve different app-update.yml feeds: an InvalidConfigurationError when publishing, otherwise
|
|
347
338
|
* a warning that says so, so the misconfiguration surfaces before a release is built with it.
|
|
@@ -355,27 +346,24 @@ function reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish) {
|
|
|
355
346
|
if (isPublish) {
|
|
356
347
|
throw new InvalidConfigurationError(`${problem}. To fix it, ${solution}.`);
|
|
357
348
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (reported.has(feeds)) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
reported.add(feeds);
|
|
367
|
-
log.warn({ solution }, `${problem}. No app-update.yml is written, so installed apps get neither an update feed nor the update-manifest public key. ` +
|
|
349
|
+
// scoped to the platform packager (one per platform and build): afterPack and the targets writing app-update.yml themselves
|
|
350
|
+
// resolve the same pack, and every arch usually repeats the same conflict - report each one once
|
|
351
|
+
log
|
|
352
|
+
.once(`conflicting-app-update-feeds:${feeds}`, packager)
|
|
353
|
+
.warn({ solution }, `${problem}. No app-update.yml is written, so installed apps get neither an update feed nor the update-manifest public key. ` +
|
|
368
354
|
"Publishing this configuration fails with an InvalidConfigurationError.");
|
|
369
355
|
}
|
|
370
356
|
// Options that only the publisher reads (the upload itself), never electron-updater, so they cannot make two otherwise
|
|
371
|
-
// identical first providers different feeds.
|
|
372
|
-
//
|
|
357
|
+
// identical first providers different feeds. Build-time-only options (credential sources, see
|
|
358
|
+
// BUILD_TIME_ONLY_PUBLISH_OPTIONS) are never embedded and are left out as well. Everything else is compared - including
|
|
359
|
+
// fields of custom providers and options such as `requestHeaders`, `token` or `private` that change how or whether the
|
|
360
|
+
// updater can read the feed.
|
|
373
361
|
const PUBLISH_ONLY_OPTIONS = new Set(["publishAutoUpdate", "timeout"]);
|
|
374
362
|
const S3_PUBLISH_ONLY_OPTIONS = new Set(["acl", "storageClass", "encryption"]);
|
|
375
363
|
/**
|
|
376
364
|
* What makes two first providers the same app-update.yml feed: the provider and every option that decides where, or
|
|
377
|
-
* how, electron-updater reads the manifest (url, bucket, region, path, owner, repo, channel, ...). Publish-only
|
|
378
|
-
* and unset (nullish) values are left out, and key order does not matter - so `publishAutoUpdate: true` against an
|
|
365
|
+
* how, electron-updater reads the manifest (url, bucket, region, path, owner, repo, channel, ...). Publish-only and
|
|
366
|
+
* build-time-only options and unset (nullish) values are left out, and key order does not matter - so `publishAutoUpdate: true` against an
|
|
379
367
|
* absent flag is the same feed, a different url or bucket is not.
|
|
380
368
|
*/
|
|
381
369
|
function appUpdateFeedIdentity(config) {
|
|
@@ -383,7 +371,7 @@ function appUpdateFeedIdentity(config) {
|
|
|
383
371
|
return "null";
|
|
384
372
|
}
|
|
385
373
|
const isS3Like = config.provider === "s3" || config.provider === "spaces" || config.provider === "r2";
|
|
386
|
-
const identity = Object.fromEntries(Object.entries(config).filter(([key, value]) => value != null && !PUBLISH_ONLY_OPTIONS.has(key) && !(isS3Like && S3_PUBLISH_ONLY_OPTIONS.has(key))));
|
|
374
|
+
const identity = Object.fromEntries(Object.entries(stripBuildTimeOnlyPublishOptions(config)).filter(([key, value]) => value != null && !PUBLISH_ONLY_OPTIONS.has(key) && !(isS3Like && S3_PUBLISH_ONLY_OPTIONS.has(key))));
|
|
387
375
|
// key order does not make two configs different feeds
|
|
388
376
|
return JSON.stringify(identity, (_key, value) => value != null && typeof value === "object" && !Array.isArray(value)
|
|
389
377
|
? Object.fromEntries(Object.keys(value)
|
|
@@ -404,7 +392,7 @@ async function createAppUpdateConfiguration(packager, publishConfigs, isPublish,
|
|
|
404
392
|
return null;
|
|
405
393
|
}
|
|
406
394
|
const publishConfig = {
|
|
407
|
-
...publishConfigs[0],
|
|
395
|
+
...stripBuildTimeOnlyPublishOptions(publishConfigs[0]),
|
|
408
396
|
updaterCacheDirName: packager.appInfo.updaterCacheDirName,
|
|
409
397
|
};
|
|
410
398
|
warnAboutGenericFeedQuery(publishConfig);
|
|
@@ -441,15 +429,43 @@ async function createAppUpdateConfiguration(packager, publishConfigs, isPublish,
|
|
|
441
429
|
if (trustedKeys.length > 0) {
|
|
442
430
|
publishConfig.updateManifestPublicKey = trustedKeys.length === 1 ? trustedKeys[0] : trustedKeys;
|
|
443
431
|
}
|
|
444
|
-
|
|
445
|
-
const trustedIds = new Set(trustedKeys.map(computeUpdateManifestKeyId));
|
|
446
|
-
if (!signingKeys.some(key => trustedIds.has(computeUpdateManifestKeyId(key)))) {
|
|
447
|
-
log.warn({ platform: packager.platform.name, trustedKeys: trustedKeys.length }, "none of the update-manifest signing keys is in updateManifest.publicKey: installs of this release will not be able to verify manifests signed with the current key(s). " +
|
|
448
|
-
"Intended only for a deliberate bridge release; otherwise add the current public key to updateManifest.publicKey.");
|
|
449
|
-
}
|
|
450
|
-
}
|
|
432
|
+
checkSigningKeysTrusted(packager, signingKeys, explicitKeys, isPublish && requireSigning);
|
|
451
433
|
return publishConfig;
|
|
452
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* An explicit `updateManifest.publicKey` list that holds none of the signing keys ships an app that rejects manifests
|
|
437
|
+
* signed with those keys, so every later release has to be signed by a listed key. That is a mistake unless it is a
|
|
438
|
+
* deliberate cutover release: with `fail` (a publishing build whose manifest is signed) it is an error unless
|
|
439
|
+
* `updateManifest.allowSigningKeyOutsideTrustList` is set; otherwise it only warns, once per process. Only key ids are
|
|
440
|
+
* ever reported, never key material.
|
|
441
|
+
*/
|
|
442
|
+
function checkSigningKeysTrusted(packager, signingKeys, explicitKeys, fail) {
|
|
443
|
+
if (signingKeys.length === 0 || explicitKeys.length === 0) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const trustedIds = explicitKeys.map(computeUpdateManifestKeyId);
|
|
447
|
+
const signingIds = signingKeys.map(computeUpdateManifestKeyId);
|
|
448
|
+
if (signingIds.some(id => trustedIds.includes(id))) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const updateManifestConfig = packager.updateManifestOptions;
|
|
452
|
+
const allowed = updateManifestConfig !== false && updateManifestConfig?.allowSigningKeyOutsideTrustList === true;
|
|
453
|
+
if (fail && !allowed) {
|
|
454
|
+
throw new InvalidConfigurationError(`none of the update-manifest signing keys (key id(s) ${signingIds.join(", ")}) is in updateManifest.publicKey (key id(s) ${trustedIds.join(", ")}) for ${packager.platform.name}. ` +
|
|
455
|
+
"The app built here embeds only the listed keys, so its installs will reject manifests signed with the signing key(s) above: every later release would have to be signed by a key in updateManifest.publicKey. " +
|
|
456
|
+
"Add the signing key's public key to updateManifest.publicKey, or sign with a key that is listed. " +
|
|
457
|
+
"For a deliberate cutover release that hands installs over to a listed key, set updateManifest.allowSigningKeyOutsideTrustList: true. " +
|
|
458
|
+
`See ${SIGNING_KEY_OUTSIDE_TRUST_LIST_DOCS}`);
|
|
459
|
+
}
|
|
460
|
+
log
|
|
461
|
+
.once("update-manifest-signing-key-outside-trust-list")
|
|
462
|
+
.warn({ platform: packager.platform.name, signingKeyIds: signingIds, trustedKeyIds: trustedIds }, "none of the update-manifest signing keys is in updateManifest.publicKey: installs of this release will not be able to verify manifests signed with the current key(s). " +
|
|
463
|
+
(allowed
|
|
464
|
+
? "Allowed by updateManifest.allowSigningKeyOutsideTrustList for a deliberate cutover release; every later release must be signed by a key in updateManifest.publicKey."
|
|
465
|
+
: "Publishing a manifest signed with these keys fails: add the current public key to updateManifest.publicKey, or set updateManifest.allowSigningKeyOutsideTrustList: true for a deliberate cutover release. " +
|
|
466
|
+
`See ${SIGNING_KEY_OUTSIDE_TRUST_LIST_DOCS}`));
|
|
467
|
+
}
|
|
468
|
+
const SIGNING_KEY_OUTSIDE_TRUST_LIST_DOCS = "https://www.electron.build/docs/migration/v27-breaking-changes#signing-key-must-be-in-updatemanifestpublickey";
|
|
453
469
|
/**
|
|
454
470
|
* Normalizes the configured `updateManifest.publicKey` (string, multi-PEM string, or array) into distinct,
|
|
455
471
|
* validated Ed25519 public keys, preserving order. Duplicates and non-Ed25519 keys are configuration errors.
|
|
@@ -473,8 +489,24 @@ function normalizeExplicitPublicKeys(value) {
|
|
|
473
489
|
});
|
|
474
490
|
return keys;
|
|
475
491
|
}
|
|
476
|
-
|
|
477
|
-
|
|
492
|
+
// Publish options that only configure the build machine (credential sources, local file paths). They must never be
|
|
493
|
+
// embedded in app-update.yml, which ships inside every installed app.
|
|
494
|
+
const BUILD_TIME_ONLY_PUBLISH_OPTIONS = ["awsCredentials"];
|
|
495
|
+
export function stripBuildTimeOnlyPublishOptions(publishConfig) {
|
|
496
|
+
const result = { ...publishConfig };
|
|
497
|
+
for (const key of BUILD_TIME_ONLY_PUBLISH_OPTIONS) {
|
|
498
|
+
delete result[key];
|
|
499
|
+
}
|
|
500
|
+
return result;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Writes `app-update.yml` into the resources directory. Untrusted files (extraResources, the app directory) were copied there before,
|
|
504
|
+
* so the write is confined to `containmentRoot` by real path and replaces, rather than follows, a symlink already at the file name.
|
|
505
|
+
*/
|
|
506
|
+
export async function writeAppUpdateYaml(resourcesDir, publishConfig, containmentRoot = resourcesDir) {
|
|
507
|
+
const file = path.join(resourcesDir, "app-update.yml");
|
|
508
|
+
await prepareFixedNameWrite(containmentRoot, file, "auto-update configuration");
|
|
509
|
+
await outputFile(file, serializeToYaml(stripBuildTimeOnlyPublishOptions(publishConfig)));
|
|
478
510
|
}
|
|
479
511
|
export async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
|
|
480
512
|
if (publishConfigs === null) {
|
|
@@ -704,9 +736,6 @@ function isDetectUpdateChannel(platformSpecificConfiguration, configuration) {
|
|
|
704
736
|
const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel;
|
|
705
737
|
return value == null ? configuration.detectUpdateChannel !== false : value;
|
|
706
738
|
}
|
|
707
|
-
// keyed by the build's CancellationToken (one instance per Packager) so that a build reports a given feed once - getResolvedPublishConfig
|
|
708
|
-
// is called per target and arch - without leaking state between programmatic builds running in the same process
|
|
709
|
-
const reportedInferredUpdateFeeds = new WeakMap();
|
|
710
739
|
/** @internal */
|
|
711
740
|
export function parseGithubRepoShorthand(repo) {
|
|
712
741
|
const separator = repo.indexOf("/");
|
|
@@ -717,16 +746,9 @@ export function parseGithubRepoShorthand(repo) {
|
|
|
717
746
|
// told which repository they are committing to. A repository taken from package.json "repository" is deliberate
|
|
718
747
|
// configuration (info); one picked up from the CI environment or .git/config is not (warn).
|
|
719
748
|
function logInferredUpdateFeed(buildId, provider, owner, project, source, inferredFields) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
reportedInferredUpdateFeeds.set(buildId, reported);
|
|
724
|
-
}
|
|
725
|
-
const feed = `${provider}:${owner}/${project}`;
|
|
726
|
-
if (reported.has(feed)) {
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
reported.add(feed);
|
|
749
|
+
// scoped to the build's CancellationToken (one instance per Packager) so that a build reports a given feed once - getResolvedPublishConfig
|
|
750
|
+
// is called per target and arch - without leaking state between programmatic builds running in the same process
|
|
751
|
+
const limited = log.once(`inferred-update-feed:${provider}:${owner}/${project}`, buildId);
|
|
730
752
|
const fields = {
|
|
731
753
|
reason: `${inferredFields.join(" and ")} not specified in the publish configuration`,
|
|
732
754
|
source: source ?? "unknown",
|
|
@@ -736,10 +758,10 @@ function logInferredUpdateFeed(buildId, provider, owner, project, source, inferr
|
|
|
736
758
|
};
|
|
737
759
|
const message = "update feed inferred from repository info; it will be used as the publish/update destination (written to app-update.yml in auto-update-capable targets) - specify it explicitly to be sure it stays under your control";
|
|
738
760
|
if (source === "package.json") {
|
|
739
|
-
|
|
761
|
+
limited.info(fields, message);
|
|
740
762
|
}
|
|
741
763
|
else {
|
|
742
|
-
|
|
764
|
+
limited.warn(fields, message);
|
|
743
765
|
}
|
|
744
766
|
}
|
|
745
767
|
async function getResolvedPublishConfig(platformPackager, options, arch, errorIfCannot, fallbackPackager) {
|