Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

fix(release): detect signed packages from manifest

Leggettc4c5f635dffd
diff --git a/apps/desktop/scripts/verify-package.mjs b/apps/desktop/scripts/verify-package.mjs
index f50fe318..db8613e5 100644
--- a/apps/desktop/scripts/verify-package.mjs
+++ b/apps/desktop/scripts/verify-package.mjs
@@ -609,8 +609,7 @@ function assertStickmanRuntime() {
if (firstDifferentPath !== undefined) {
throw new Error(`Packaged Stickman Runtime file list differs from source at: ${firstDifferentPath}`);
}
- const signedMacPackage = targetPlatform === 'darwin'
- && process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID === '1';
+ const signedMacPackage = requiresDeveloperIdSignature();
if (!signedMacPackage && source.hash !== packaged.hash) {
throw new Error('Packaged Stickman Runtime contents differ from .pack/stickman-runtime');
}
@@ -814,12 +813,12 @@ function verifyMacPackageMetadata() {
+ `${signature.stderr || signature.stdout}`
);
}
- if (process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID === '1') {
+ if (requiresDeveloperIdSignature()) {
verifyDeveloperIdSignature();
verifyEmbeddedRuntimeSignatures();
}
if (process.env.OPENCREATOR_REQUIRE_NOTARIZED_MAC_APP === '1') {
- if (process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID !== '1') {
+ if (!requiresDeveloperIdSignature()) {
throw new Error(
'A notarized macOS package must also require Developer ID verification'
);
@@ -876,7 +875,7 @@ function verifyDeveloperIdSignature() {
);
}
const output = `${details.stdout}\n${details.stderr}`;
- const expectedTeamId = process.env.OPENCREATOR_APPLE_TEAM_ID?.trim();
+ const expectedTeamId = expectedAppleTeamId();
if (
!output.includes('Authority=Developer ID Application:')
|| !output.includes('Timestamp=')
@@ -902,7 +901,7 @@ function verifyEmbeddedRuntimeSignatures() {
if (embeddedBinaries.length === 0) {
throw new Error('Packaged runtimes do not contain any macOS binaries');
}
- const expectedTeamId = process.env.OPENCREATOR_APPLE_TEAM_ID?.trim();
+ const expectedTeamId = expectedAppleTeamId();
for (const path of embeddedBinaries) {
const details = spawnSync('codesign', [
'--display',
@@ -931,6 +930,21 @@ function verifyEmbeddedRuntimeSignatures() {
}
}
+function requiresDeveloperIdSignature() {
+ return targetPlatform === 'darwin'
+ && (
+ process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID === '1'
+ || manifest.macSigningMode === 'developer-id'
+ );
+}
+
+function expectedAppleTeamId() {
+ return process.env.OPENCREATOR_APPLE_TEAM_ID?.trim()
+ || (typeof manifest.appleTeamId === 'string'
+ ? manifest.appleTeamId.trim()
+ : undefined);
+}
+
function isMachOBinary(path) {
if (!statSync(path).isFile()) return false;
const descriptor = openSync(path, 'r');
diff --git a/apps/desktop/test/mac-signing.test.mjs b/apps/desktop/test/mac-signing.test.mjs
index 297b2048..ab84c94b 100644
--- a/apps/desktop/test/mac-signing.test.mjs
+++ b/apps/desktop/test/mac-signing.test.mjs
@@ -214,6 +214,8 @@ describe('macOS directory signing', () => {
expect(verifier).toContain(
"process.env.OPENCREATOR_REQUIRE_NOTARIZED_MAC_APP === '1'"
);
+ expect(verifier).toContain("manifest.macSigningMode === 'developer-id'");
+ expect(verifier).toContain('const expectedTeamId = expectedAppleTeamId();');
});
it('keeps Electron cookie encryption disabled to avoid macOS Safe Storage access', () => {
diff --git a/apps/desktop/test/stickman-runtime-package.test.mjs b/apps/desktop/test/stickman-runtime-package.test.mjs
index a2dde617..d04a355c 100644
--- a/apps/desktop/test/stickman-runtime-package.test.mjs
+++ b/apps/desktop/test/stickman-runtime-package.test.mjs
@@ -85,6 +85,8 @@ describe('Stickman Runtime package contract', () => {
);
expect(source).toContain("targetPlatform === 'darwin'");
expect(source).toContain("OPENCREATOR_REQUIRE_DEVELOPER_ID === '1'");
+ expect(source).toContain("manifest.macSigningMode === 'developer-id'");
+ expect(source).toContain('requiresDeveloperIdSignature()');
expect(source).toContain('!signedMacPackage && source.hash !== packaged.hash');
expect(source).toContain(
'[daemonDir, creatorRuntimeDir, stickmanRuntimeDir]'