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.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
fix: verify signed macOS runtime contents correctly
Leggettf5cc448dc7b1
diff --git a/apps/desktop/scripts/verify-package.mjs b/apps/desktop/scripts/verify-package.mjsindex aa30bcb8..0cb6aac8 100644--- a/apps/desktop/scripts/verify-package.mjs+++ b/apps/desktop/scripts/verify-package.mjs@@ -431,7 +431,9 @@ function assertStickmanRuntime() {if (firstDifferentPath !== undefined) {throw new Error(`Packaged Stickman Runtime file list differs from source at: ${firstDifferentPath}`);}- if (source.hash !== packaged.hash) {+ const signedMacPackage = targetPlatform === 'darwin'+ && process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID === '1';+ if (!signedMacPackage && source.hash !== packaged.hash) {throw new Error('Packaged Stickman Runtime contents differ from .pack/stickman-runtime');}if (@@ -590,7 +592,7 @@ function verifyMacPackageMetadata() {}if (process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID === '1') {verifyDeveloperIdSignature();- verifyEmbeddedCreatorRuntimeSignatures();+ verifyEmbeddedRuntimeSignatures();}if (process.env.OPENCREATOR_REQUIRE_NOTARIZED_MAC_APP === '1') {if (process.env.OPENCREATOR_REQUIRE_DEVELOPER_ID !== '1') {@@ -666,13 +668,15 @@ function verifyDeveloperIdSignature() {}}-function verifyEmbeddedCreatorRuntimeSignatures() {+function verifyEmbeddedRuntimeSignatures() {const embeddedBinaries = [];- walk(creatorRuntimeDir, path => {- if (isMachOBinary(path)) embeddedBinaries.push(path);- });+ for (const root of [daemonDir, creatorRuntimeDir, stickmanRuntimeDir]) {+ walk(root, path => {+ if (isMachOBinary(path)) embeddedBinaries.push(path);+ });+ }if (embeddedBinaries.length === 0) {- throw new Error('Creator Runtime does not contain any macOS binaries');+ throw new Error('Packaged runtimes do not contain any macOS binaries');}const expectedTeamId = process.env.OPENCREATOR_APPLE_TEAM_ID?.trim();for (const path of embeddedBinaries) {@@ -696,7 +700,7 @@ function verifyEmbeddedCreatorRuntimeSignatures() {)) {throw new Error(- 'Embedded Creator Runtime binary is not signed for distribution: '+ 'Embedded runtime binary is not signed for distribution: '+ `${relative(packageRoot, path)}`);}diff --git a/apps/desktop/test/stickman-runtime-package.test.mjs b/apps/desktop/test/stickman-runtime-package.test.mjsindex c8bb4b1e..a2dde617 100644--- a/apps/desktop/test/stickman-runtime-package.test.mjs+++ b/apps/desktop/test/stickman-runtime-package.test.mjs@@ -77,6 +77,19 @@ describe('Stickman Runtime package contract', () => {manifestHash)).toThrow(/exact Stickman Runtime/);});++ it('keeps signed macOS package verification distinct from source hashes', () => {+ const source = readFileSync(+ new URL('../scripts/verify-package.mjs', import.meta.url),+ 'utf8'+ );+ expect(source).toContain("targetPlatform === 'darwin'");+ expect(source).toContain("OPENCREATOR_REQUIRE_DEVELOPER_ID === '1'");+ expect(source).toContain('!signedMacPackage && source.hash !== packaged.hash');+ expect(source).toContain(+ '[daemonDir, creatorRuntimeDir, stickmanRuntimeDir]'+ );+ });});function fixture() {