emrg: upgrade prompt: re-seal GUI bundle + clear xattrs before deploy (Gatekeeper quarantine fix) - #968
Conversation
… so Gatekeeper does not quarantine (rant 2026-08-25T09:18:19)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Re-verified against the rant (2026-08-25T09:18:19) acceptance items:
- Built artifact is re-sealed with
codesign --force --deep --sign - --timestamp=none(full ad-hoc re-sign →Identifier=com.emrg.gui, sealed resources) and xattr-cleared withxattr -crBEFORE any copy (step 3c). - Run copy
~/Applications/EMRG.appalso xattr-cleared (ditto propagates source attributes). - Verify step requires
codesign --verify --deep --strictto pass on both deployed copies; any failure = upgrade failure → rollback; result logged. - Safety boundary clarified: Developer ID signing/notarization stays release-side; ad-hoc re-sign is required for macOS 26 Gatekeeper compatibility, not a substitute.
- CI: test + test-windows both green (run 32799507262). Local pytest 1050 passed / 1 skipped; template renders.
Merging this unblocks the acceptance item: next GUI-including upgrade deploys a sealed, xattr-clean EMRG.app that Gatekeeper accepts.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3)
Re-checked this cycle: head 6e92db6 unchanged, CI test + test-windows still green (run 32799507262). The four acceptance items of rant 2026-08-25T09:18:19 are all addressed:
- Built artifact re-sealed (
codesign --force --deep --sign - --timestamp=none) + xattr-cleared (xattr -cr) before copy — step 3c. - Run copy
~/Applications/EMRG.appxattr-cleared after ditto — step 4. codesign --verify --deep --strictmandatory on both copies, failure → rollback + log — step 5.- Safety boundary clarified (Developer ID/notarization stays release-side).
No issues found; ready to merge once the 3rd LGTM lands.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3)
Final re-check: head 6e92db6 unchanged, CI test + test-windows green (run 32799507262), MERGEABLE. Three consecutive LGTMs from distinct cycles (100311, 101045, 101729) with no ❌. Rant 2026-08-25T09:18:19 acceptance items all covered — merging.
Uh oh!
There was an error while loading. Please reload this page.
Fixes the macOS Gatekeeper quarantine of EMRG.app during auto-upgrade (rant 2026-08-25T09:18:19).
Problem: After the v0.2.77 upgrade,
~/Applications/EMRG.appwas judged malware and moved to Trash ("已阻止恶意软件并移到废纸篓"). Root causes (host-verified):diroutput only ad-hoc signs the main binary — the bundle is unsealed (codesign -dshowsIdentifier=Electron,Info.plist=not bound,Sealed Resources=none;codesign --verify --deep --strictfails with "code has no resources but signature indicates they must be present").com.apple.provenance).Fix (in
emrg/server/prompts/upgrade_prompt.j2):codesign --force --deep --sign - --timestamp=none(full ad-hoc re-sign →Identifier=com.emrg.gui, sealed resources present) and clear xattrs withxattr -cron the built artifact BEFORE any copy; sanity-check withcodesign --verify --deep --strict(fail → do not copy, roll back).~/Applications/EMRG.app(ditto preserves source attributes).codesign --verify --deep --stricton both deployed copies; any failure = upgrade failure → restore from backup. Log the signature verification result (acceptance: upgrade log must show it).Verification:
upgrade_prompt.j2renders (Jinja2 smoke test, contains the new steps);uv run pytest tests/ -q→ 1050 passed / 1 skipped;from emrg.client.app import run_client+python -m emrg --helpOK.Acceptance: next upgrade with a GUI update deploys an EMRG.app that opens normally (no Gatekeeper interception), and the upgrade log records the signature verification pass.