chore: drop legacy Relay signing

This commit is contained in:
Peter Steinberger
2026-01-16 02:51:45 +00:00
parent 23e4ba845c
commit 16bc4cdef3
4 changed files with 16 additions and 29 deletions

View File

@@ -214,19 +214,6 @@ if [ -f "$APP_BUNDLE/Contents/MacOS/Clawdbot" ]; then
echo "Signing main binary"; sign_item "$APP_BUNDLE/Contents/MacOS/Clawdbot" "$APP_ENTITLEMENTS" echo "Signing main binary"; sign_item "$APP_BUNDLE/Contents/MacOS/Clawdbot" "$APP_ENTITLEMENTS"
fi fi
# Sign bundled gateway payload (native addons, libvips dylibs)
if [ -d "$APP_BUNDLE/Contents/Resources/Relay" ]; then
find "$APP_BUNDLE/Contents/Resources/Relay" -type f \( -name "*.node" -o -name "*.dylib" \) -print0 | while IFS= read -r -d '' f; do
echo "Signing gateway payload: $f"; sign_item "$f" "$ENT_TMP_BASE"
done
if [ -f "$APP_BUNDLE/Contents/Resources/Relay/node" ]; then
echo "Signing embedded node"; sign_item "$APP_BUNDLE/Contents/Resources/Relay/node" "$ENT_TMP_RUNTIME"
fi
if [ -f "$APP_BUNDLE/Contents/Resources/Relay/clawdbot" ]; then
echo "Signing embedded relay wrapper"; sign_plain_item "$APP_BUNDLE/Contents/Resources/Relay/clawdbot"
fi
fi
# Sign Sparkle deeply if present # Sign Sparkle deeply if present
SPARKLE="$APP_BUNDLE/Contents/Frameworks/Sparkle.framework" SPARKLE="$APP_BUNDLE/Contents/Frameworks/Sparkle.framework"
if [ -d "$SPARKLE" ]; then if [ -d "$SPARKLE" ]; then

View File

@@ -29,7 +29,7 @@ function resolveControlUiRoot(): string | null {
} }
})(); })();
const candidates = [ const candidates = [
// Packaged relay: Resources/Relay/control-ui // Packaged app: control-ui lives alongside the executable.
execDir ? path.resolve(execDir, "control-ui") : null, execDir ? path.resolve(execDir, "control-ui") : null,
// Running from dist: dist/gateway/control-ui.js -> dist/control-ui // Running from dist: dist/gateway/control-ui.js -> dist/control-ui
path.resolve(here, "../control-ui"), path.resolve(here, "../control-ui"),

View File

@@ -7,12 +7,12 @@ import { describe, expect, it } from "vitest";
import { ensureClawdbotCliOnPath } from "./path-env.js"; import { ensureClawdbotCliOnPath } from "./path-env.js";
describe("ensureClawdbotCliOnPath", () => { describe("ensureClawdbotCliOnPath", () => {
it("prepends the bundled Relay dir when a sibling clawdbot exists", async () => { it("prepends the bundled app bin dir when a sibling clawdbot exists", async () => {
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-path-")); const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-path-"));
try { try {
const relayDir = path.join(tmp, "Relay"); const appBinDir = path.join(tmp, "AppBin");
await fs.mkdir(relayDir, { recursive: true }); await fs.mkdir(appBinDir, { recursive: true });
const cliPath = path.join(relayDir, "clawdbot"); const cliPath = path.join(appBinDir, "clawdbot");
await fs.writeFile(cliPath, "#!/bin/sh\necho ok\n", "utf-8"); await fs.writeFile(cliPath, "#!/bin/sh\necho ok\n", "utf-8");
await fs.chmod(cliPath, 0o755); await fs.chmod(cliPath, 0o755);
@@ -28,7 +28,7 @@ describe("ensureClawdbotCliOnPath", () => {
platform: "darwin", platform: "darwin",
}); });
const updated = process.env.PATH ?? ""; const updated = process.env.PATH ?? "";
expect(updated.split(path.delimiter)[0]).toBe(relayDir); expect(updated.split(path.delimiter)[0]).toBe(appBinDir);
} finally { } finally {
process.env.PATH = originalPath; process.env.PATH = originalPath;
if (originalFlag === undefined) delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED; if (originalFlag === undefined) delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED;
@@ -65,11 +65,11 @@ describe("ensureClawdbotCliOnPath", () => {
const originalFlag = process.env.CLAWDBOT_PATH_BOOTSTRAPPED; const originalFlag = process.env.CLAWDBOT_PATH_BOOTSTRAPPED;
const originalMiseDataDir = process.env.MISE_DATA_DIR; const originalMiseDataDir = process.env.MISE_DATA_DIR;
try { try {
const relayDir = path.join(tmp, "Relay"); const appBinDir = path.join(tmp, "AppBin");
await fs.mkdir(relayDir, { recursive: true }); await fs.mkdir(appBinDir, { recursive: true });
const relayCli = path.join(relayDir, "clawdbot"); const appCli = path.join(appBinDir, "clawdbot");
await fs.writeFile(relayCli, "#!/bin/sh\necho ok\n", "utf-8"); await fs.writeFile(appCli, "#!/bin/sh\necho ok\n", "utf-8");
await fs.chmod(relayCli, 0o755); await fs.chmod(appCli, 0o755);
const localBinDir = path.join(tmp, "node_modules", ".bin"); const localBinDir = path.join(tmp, "node_modules", ".bin");
await fs.mkdir(localBinDir, { recursive: true }); await fs.mkdir(localBinDir, { recursive: true });
@@ -85,7 +85,7 @@ describe("ensureClawdbotCliOnPath", () => {
delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED; delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED;
ensureClawdbotCliOnPath({ ensureClawdbotCliOnPath({
execPath: relayCli, execPath: appCli,
cwd: tmp, cwd: tmp,
homeDir: tmp, homeDir: tmp,
platform: "darwin", platform: "darwin",
@@ -93,11 +93,11 @@ describe("ensureClawdbotCliOnPath", () => {
const updated = process.env.PATH ?? ""; const updated = process.env.PATH ?? "";
const parts = updated.split(path.delimiter); const parts = updated.split(path.delimiter);
const relayIndex = parts.indexOf(relayDir); const appBinIndex = parts.indexOf(appBinDir);
const localIndex = parts.indexOf(localBinDir); const localIndex = parts.indexOf(localBinDir);
const shimsIndex = parts.indexOf(shimsDir); const shimsIndex = parts.indexOf(shimsDir);
expect(relayIndex).toBeGreaterThanOrEqual(0); expect(appBinIndex).toBeGreaterThanOrEqual(0);
expect(localIndex).toBeGreaterThan(relayIndex); expect(localIndex).toBeGreaterThan(appBinIndex);
expect(shimsIndex).toBeGreaterThan(localIndex); expect(shimsIndex).toBeGreaterThan(localIndex);
} finally { } finally {
process.env.PATH = originalPath; process.env.PATH = originalPath;

View File

@@ -55,7 +55,7 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
const candidates: string[] = []; const candidates: string[] = [];
// Bundled macOS app: `clawdbot` lives in the Relay dir (process.execPath). // Bundled macOS app: `clawdbot` lives next to the executable (process.execPath).
try { try {
const execDir = path.dirname(execPath); const execDir = path.dirname(execPath);
const siblingClawdbot = path.join(execDir, "clawdbot"); const siblingClawdbot = path.join(execDir, "clawdbot");