Skip to content

Conversation

@ammario
Copy link
Member

@ammario ammario commented Oct 7, 2025

@spikecurtis - Secrets Added βœ…

Spike has configured the App Store Connect API key secrets. This PR is ready to merge and test!


Problem

Current state:

  • βœ… DMGs are code-signed with Developer ID certificate
  • ❌ DMGs are not notarized by Apple
  • 🚫 Result: macOS Gatekeeper blocks the app with "cannot open" errors

When users download the DMG, macOS shows:

"Cmux.app" can't be opened because Apple cannot check it for malicious software.

The app is properly signed, but requires notarization to pass Gatekeeper on modern macOS.


Solution

This PR adds notarization support using App Store Connect API keys (more secure than app-specific passwords):

Changes

1. Workflow updates (.github/workflows/build.yml):

  • Exports notarization credentials using API key approach
  • Uses API_KEY_ID, API_KEY_ISSUER_ID, API_KEY environment variables
  • Gracefully skips notarization if secrets aren't configured
  • Logs whether notarization will run

2. electron-builder config (package.json):

  • Added notarize block with team ID (4399GN35BJ)
  • Configured to use App Store Connect API key for notarization
  • electron-builder will automatically submit to Apple after signing

How it works

  1. Sign - App is signed with Developer ID (already working βœ…)
  2. Submit - electron-builder uploads to Apple's notarization service using API key
  3. Wait - Polls Apple until notarization completes (~2-5 minutes)
  4. Staple - Attaches the notarization ticket to the DMG
  5. Upload - Artifact includes fully signed + notarized DMG

After merge

Once this merges:

  • βœ… DMGs will be signed with Developer ID certificate
  • βœ… DMGs will be notarized by Apple
  • βœ… Users can download and open without Gatekeeper warnings
  • βœ… No "right-click β†’ Open" workaround needed

Current build status

Latest main build (run #18325710712):

  • Code signing: βœ… Working - verified with codesign --verify --deep --strict
  • Notarization: ❌ Missing - spctl -a -vv shows "Unnotarized Developer ID"

Testing

After merge:

  1. Wait for build on main to complete
  2. Download DMG from artifacts
  3. Verify notarization: spctl -a -vv Cmux.app should show "accepted" (not "rejected")
  4. Double-click DMG - should open without warnings

Generated with cmux

@ammario ammario force-pushed the add-macos-notarization branch 2 times, most recently from 5d9cc43 to 0012899 Compare October 7, 2025 21:05
@spikecurtis
Copy link
Collaborator

I added an Apple Connect API key for this instead of using someone's Apple ID directly. This way we know the scope of the key will always remain "Developer." A person's permission could change over time.

You'll need to modify notarytool call to use the API key as described here: https://keith.github.io/xcode-man-pages/notarytool.1.html#App

Relevant secrets are: AC_APIKEY_ID AC_APIKEY_ISSUER_ID and AC_APIKEY_P8_BASE64

- Configure electron-builder to notarize DMGs when credentials provided
- Add environment variables for APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, APPLE_TEAM_ID
- Notarization is optional - builds will succeed without credentials but skip notarization

_Generated with `cmux`_
- Use API_KEY_ID, API_KEY_ISSUER_ID, API_KEY instead of Apple ID/password
- API keys are more secure and don't expire like app-specific passwords

_Generated with `cmux`_
- AC_APIKEY_ID
- AC_APIKEY_ISSUER_ID
- AC_APIKEY_P8_BASE64 (decoded to /tmp/AuthKey.p8)

_Generated with `cmux`_
@ammario ammario force-pushed the add-macos-notarization branch from a653fea to 28e187e Compare October 8, 2025 14:39
- APPLE_API_KEY (path to .p8 file)
- APPLE_API_KEY_ID
- APPLE_API_ISSUER

_Generated with `cmux`_
electron-builder will auto-detect credentials from env vars when notarize: true

_Generated with `cmux`_
@ammario ammario enabled auto-merge (squash) October 8, 2025 15:46
@ammario ammario merged commit 8b3af7f into main Oct 8, 2025
7 checks passed
@ammario ammario deleted the add-macos-notarization branch October 8, 2025 15:50
ammario added a commit that referenced this pull request Oct 8, 2025
Simplified installation instructions now that proper code signing and
notarization are in place (from #90).

## Changes

- **docs/install.md**: Removed all Gatekeeper bypass instructions
(right-click β†’ Open, terminal workarounds)
- **docs/install.md**: Clarified separate x64 and arm64 artifact names
- **README.md**: Updated to note signed/notarized status

## User Impact

Users can now install cmux on macOS without any security warnings or
workarounds. The app opens normally like any other Mac application.

_Generated with `cmux`_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants