An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.
TypeScript agentic-browseragentic-browsingagy-cliaiai-agentai-browser-extensionai-toolsbrave-extensionbrowser-agentbrowser-automationbrowser-extensionbrowser-usebrowserskillchrome-extensionclaude-codecodexfirefox-addonmcp-servernanobrowserweb-automation
fix(mac): notarize the DMG when Apple credentials exist, and correct how to open an unnotarized one
Shahriare9907a7a1c68
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex eb6c2f2..0d747d7 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -225,7 +225,12 @@ jobs:# The macOS app, attached to the release the job above created. A separate job because it# needs a Mac, and after it rather than before because it is the one artifact that can be# rebuilt and re-uploaded by hand: a failure here leaves a release without a DMG, never a- # DMG without a release. Signed ad hoc and not notarized — docs/guide/mac-app.md says so.+ # DMG without a release.+ #+ # Notarized when five repository secrets exist, ad hoc when they do not: MACOS_CERT_P12 (a+ # base64 "Developer ID Application" certificate with its key), MACOS_CERT_PASSWORD,+ # APPLE_ID, APPLE_TEAM_ID and APPLE_APP_PASSWORD (an app-specific password). An ad hoc build+ # is blocked by Gatekeeper on download; docs/guide/mac-app.md says how to get past that.# ---------------------------------------------------------------------------------------mac:needs: release@@ -247,7 +252,34 @@ jobs:node "$yarn_bin" buildnode "$yarn_bin" daemon:build+ - name: Import the Developer ID certificate, when there is one+ env:+ MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}+ MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}+ run: |+ if [ -z "$MACOS_CERT_P12" ]; then+ echo "::warning::no MACOS_CERT_P12 secret, so this DMG is ad hoc and Gatekeeper will block it on download"+ exit 0+ fi+ keychain="$RUNNER_TEMP/signing.keychain-db"+ password="$(uuidgen)"+ echo "$MACOS_CERT_P12" | base64 --decode > "$RUNNER_TEMP/cert.p12"+ security create-keychain -p "$password" "$keychain"+ security set-keychain-settings -lut 3600 "$keychain"+ security unlock-keychain -p "$password" "$keychain"+ security import "$RUNNER_TEMP/cert.p12" -k "$keychain" -P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign+ security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain" >/dev/null+ security list-keychains -d user -s "$keychain" $(security list-keychains -d user | tr -d '"')+ rm "$RUNNER_TEMP/cert.p12"+ identity="$(security find-identity -v -p codesigning "$keychain" | sed -n 's/.*"\(Developer ID Application:[^"]*\)".*/\1/p' | head -1)"+ test -n "$identity" || { echo "::error::MACOS_CERT_P12 holds no Developer ID Application identity"; exit 1; }+ echo "CODESIGN_IDENTITY=$identity" >> "$GITHUB_ENV"+- name: Build Browsentic.app and the disk image+ env:+ APPLE_ID: ${{ secrets.APPLE_ID }}+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}+ APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}run: |src/mac/Scripts/build-app.shsrc/mac/Scripts/make-dmg.shdiff --git a/docs/guide/mac-app.md b/docs/guide/mac-app.mdindex c404e01..19a6fd0 100644--- a/docs/guide/mac-app.md+++ b/docs/guide/mac-app.md@@ -15,8 +15,15 @@ Requires macOS 14 or newer, on Apple silicon or Intel.2. Open it and drag **Browsentic** onto **Applications**.3. Open the app.-The build is signed ad hoc and is not notarized. If macOS refuses to open it, right-click the app-and choose **Open** once, or run `xattr -dr com.apple.quarantine /Applications/Browsentic.app`.+Until the release is notarized, macOS blocks the downloaded app with “Apple could not verify+Browsentic is free of malware”. Press **Done**, then either open **System Settings → Privacy &+Security**, scroll to the Browsentic line and press **Open Anyway**, or run:++```sh+xattr -dr com.apple.quarantine /Applications/Browsentic.app+```++Right-click ▸ Open no longer gets past this on macOS 15 and newer.## The first screen: what your Mac already hasdiff --git a/docs/internals/mac-app.md b/docs/internals/mac-app.mdindex afd3be5..9cb4ec2 100644--- a/docs/internals/mac-app.md+++ b/docs/internals/mac-app.md@@ -59,6 +59,11 @@ swift build && swift test # swift-testing, no XCTestARCHS=arm64 Scripts/build-app.sh # quick local bundle; the default is a universal binary```+`build-app.sh` signs with the hardened runtime when `CODESIGN_IDENTITY` names a Developer ID, and+`make-dmg.sh` notarizes and staples when `APPLE_ID`, `APPLE_TEAM_ID` and `APPLE_APP_PASSWORD` are set+too. With none of them the build is ad hoc, which runs where it was built and is blocked by+Gatekeeper anywhere it was downloaded to.+CI builds and tests it on `macos-15`; the release workflow’s `mac` job attaches the DMG to theGitHub release after the npm publish. Colours in[Theme.swift](../../src/mac/Sources/Browsentic/Theme/Theme.swift) are Ember and Daylight fromdiff --git a/scripts/release-notes.mjs b/scripts/release-notes.mjsindex 6263ae0..4eab926 100644--- a/scripts/release-notes.mjs+++ b/scripts/release-notes.mjs@@ -92,7 +92,8 @@ function renderNotes(version, commits, prevTag) {'### Install','',`**macOS** — download \`Browsentic-${version}.dmg\` below, drag the app to Applications and open it. It installs`,- 'everything, Node included. The build is signed ad hoc, so right-click ▸ **Open** the first time.',+ 'everything, Node included. If macOS says it could not verify the app, press **Done**, then **System Settings →',+ 'Privacy & Security → Open Anyway**, or run `xattr -dr com.apple.quarantine /Applications/Browsentic.app`.','','**Any platform**','',diff --git a/src/mac/Packaging/Browsentic.entitlements b/src/mac/Packaging/Browsentic.entitlementsnew file mode 100644index 0000000..cffd637--- /dev/null+++ b/src/mac/Packaging/Browsentic.entitlements@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.automation.apple-events</key>+ <true/>+</dict>+</plist>diff --git a/src/mac/Packaging/dmg-readme.txt b/src/mac/Packaging/dmg-readme.txtindex 1771ba4..c3793a2 100644--- a/src/mac/Packaging/dmg-readme.txt+++ b/src/mac/Packaging/dmg-readme.txt@@ -11,8 +11,9 @@ puts the browsentic command, the daemon and the browser extension where they belThe extension sits outside the dotfolder on purpose. Chrome's "Load unpacked" pickerhides dotfolders, and a browser's pairing is tied to the extension's path.-This build is signed ad hoc and is not notarized. If macOS refuses to open it,-right-click the app and choose Open once, or run:+If macOS says it "could not verify Browsentic is free of malware", this build was+not notarized by Apple. Press Done, open System Settings > Privacy & Security,+scroll down to the Browsentic line and press Open Anyway. Or run this once:xattr -dr com.apple.quarantine /Applications/Browsentic.appdiff --git a/src/mac/Scripts/build-app.sh b/src/mac/Scripts/build-app.shindex c1b3088..ac92429 100755--- a/src/mac/Scripts/build-app.sh+++ b/src/mac/Scripts/build-app.sh@@ -61,8 +61,17 @@ cp -R "$EXTENSION" "$PAYLOAD/extension/chrome-mv3"cp "$DAEMON/package.json" "$DAEMON/LICENSE" "$PAYLOAD/"find "$PAYLOAD" -name .DS_Store -delete-echo "▸ Signing (ad hoc)"-codesign --force --deep --sign "${CODESIGN_IDENTITY:--}" --timestamp=none "$APP"+# Notarization only accepts a Developer ID signature with the hardened runtime and a secure+# timestamp. Under the hardened runtime, opening chrome://extensions over Apple Events needs the+# entitlement. Without an identity the build is ad hoc, which Gatekeeper blocks on download.+if [ -n "${CODESIGN_IDENTITY:-}" ]; then+ echo "▸ Signing as $CODESIGN_IDENTITY"+ codesign --force --deep --options runtime --timestamp \+ --entitlements "$MAC/Packaging/Browsentic.entitlements" --sign "$CODESIGN_IDENTITY" "$APP"+else+ echo "▸ Signing (ad hoc — Gatekeeper will block this build when it is downloaded)"+ codesign --force --deep --sign - --timestamp=none "$APP"+ficodesign --verify --verbose=2 "$APP"echo "✓ $APP"diff --git a/src/mac/Scripts/make-dmg.sh b/src/mac/Scripts/make-dmg.shindex 12eadcc..1b809ea 100755--- a/src/mac/Scripts/make-dmg.sh+++ b/src/mac/Scripts/make-dmg.sh@@ -20,4 +20,15 @@ cp "$MAC/Packaging/dmg-readme.txt" "$STAGING/Read Me.txt"hdiutil create -volname "Browsentic $VERSION" -srcfolder "$STAGING" -ov -format UDZO -fs HFS+ "$DMG" >/dev/nullrm -rf "$STAGING"++# With Apple credentials in the environment the image is signed, notarized and stapled, which is+# what makes it open on someone else's Mac without a Gatekeeper dialog.+if [ -n "${CODESIGN_IDENTITY:-}" ] && [ -n "${APPLE_ID:-}" ] && [ -n "${APPLE_TEAM_ID:-}" ] && [ -n "${APPLE_APP_PASSWORD:-}" ]; then+ echo "▸ Notarizing (this waits on Apple, usually a few minutes)"+ codesign --force --timestamp --sign "$CODESIGN_IDENTITY" "$DMG"+ xcrun notarytool submit "$DMG" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_PASSWORD" --wait+ xcrun stapler staple "$DMG"+else+ echo "! not notarized: set CODESIGN_IDENTITY, APPLE_ID, APPLE_TEAM_ID and APPLE_APP_PASSWORD to notarize"+fiecho "✓ $DMG"