Commit 8f2ce3e9ae

8f2ce3e9aea5e545a257dab3e7600f258daab10b

parent: b50ce164c2

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-26 15:48 UTC

Embed the Developer ID provisioning profile with a Keychain access group

Layout: unified · split

Changed files (2)
scripts/build-app.sh +17 −1 · view
@@ -5,6 +5,8 @@
5# ORGSTAR_SIGN signing identity; ad hoc ("-") for local use by default. Any other 5# ORGSTAR_SIGN signing identity; ad hoc ("-") for local use by default. Any other
6# identity also turns on the hardened runtime and a secure timestamp. 6# identity also turns on the hardened runtime and a secure timestamp.
7# ORGSTAR_ARCHS architectures, e.g. "arm64 x86_64" for a universal app; this Mac's by default. 7# ORGSTAR_ARCHS architectures, e.g. "arm64 x86_64" for a universal app; this Mac's by default.
8# ORGSTAR_PROFILE a Developer ID provisioning profile to embed, with its Keychain access group,
9# so passphrases can be kept in the data protection keychain. Needs ORGSTAR_SIGN.
8set -eu 10set -eu
9 11
10cd "$(dirname "$0")/.." 12cd "$(dirname "$0")/.."
@@ -248,13 +250,27 @@ for item in "$fw/XPCServices/Installer.xpc" "$fw/XPCServices/Downloader.xpc" "$f
248done 250done
249 251
250# The hardened runtime needs Calendar access declared for the agenda's events. 252# The hardened runtime needs Calendar access declared for the agenda's events.
253keychain=""
254if [ -n "${ORGSTAR_PROFILE:-}" ]; then
255 [ "$sign" != "-" ] || { echo "ORGSTAR_PROFILE needs ORGSTAR_SIGN." >&2; exit 1; }
256 cp "$ORGSTAR_PROFILE" "$app/Contents/embedded.provisionprofile"
257 security cms -D -i "$ORGSTAR_PROFILE" -o "$work/profile.plist"
258 team="$(/usr/libexec/PlistBuddy -c 'Print :Entitlements:com.apple.developer.team-identifier' "$work/profile.plist")"
259 keychain="
260 <key>com.apple.application-identifier</key>
261 <string>$team.sh.krz.orgstar</string>
262 <key>com.apple.developer.team-identifier</key>
263 <string>$team</string>
264 <key>keychain-access-groups</key>
265 <array><string>$team.sh.krz.orgstar</string></array>"
266fi
251cat > "$work/app.entitlements" <<PLIST 267cat > "$work/app.entitlements" <<PLIST
252<?xml version="1.0" encoding="UTF-8"?> 268<?xml version="1.0" encoding="UTF-8"?>
253<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 269<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
254<plist version="1.0"> 270<plist version="1.0">
255<dict> 271<dict>
256 <key>com.apple.security.personal-information.calendars</key> 272 <key>com.apple.security.personal-information.calendars</key>
257 <true/> 273 <true/>$keychain
258</dict> 274</dict>
259</plist> 275</plist>
260PLIST 276PLIST
scripts/release-mac.sh +3 −1 · view
@@ -28,6 +28,8 @@ files="${ORGSTAR_FILES:-homelab:/var/www/files/orgstar}"
28publish="${ORGSTAR_PUBLISH:-1}" 28publish="${ORGSTAR_PUBLISH:-1}"
29sign="${ORGSTAR_SIGN:-$(security find-identity -v -p codesigning | sed -n 's/.*"\(Developer ID Application: .*\)"/\1/p' | head -1)}" 29sign="${ORGSTAR_SIGN:-$(security find-identity -v -p codesigning | sed -n 's/.*"\(Developer ID Application: .*\)"/\1/p' | head -1)}"
30[ -n "$sign" ] || { echo "No Developer ID Application identity in the keychain." >&2; exit 1; } 30[ -n "$sign" ] || { echo "No Developer ID Application identity in the keychain." >&2; exit 1; }
31profile="${ORGSTAR_PROFILE:-$HOME/Library/MobileDevice/Provisioning Profiles/orgstar_dev_id.provisionprofile}"
32[ -f "$profile" ] || { echo "No Developer ID provisioning profile at $profile." >&2; exit 1; }
31! grep -q 'publicKey = .*// placeholder' Sources/OrgApp/LicenseKey.swift || 33! grep -q 'publicKey = .*// placeholder' Sources/OrgApp/LicenseKey.swift ||
32 { echo "Run packaging/license-issuer/keygen.sh first: the license public key is a placeholder." >&2; exit 1; } 34 { echo "Run packaging/license-issuer/keygen.sh first: the license public key is a placeholder." >&2; exit 1; }
33# The Sparkle public key; its private half is in the release Mac's login keychain (generate_keys). 35# The Sparkle public key; its private half is in the release Mac's login keychain (generate_keys).
@@ -46,7 +48,7 @@ ORGSTAR_GATES=1 swift test -c release --filter GateTests || { echo "A performanc
46 48
47# The build number counts commits, so each release's is higher than the last's. 49# The build number counts commits, so each release's is higher than the last's.
48build="$(git rev-list --count HEAD)" 50build="$(git rev-list --count HEAD)"
49ORGSTAR_SIGN="$sign" ORGSTAR_ARCHS="arm64 x86_64" sh scripts/build-app.sh "$version" "$build" > /dev/null 51ORGSTAR_SIGN="$sign" ORGSTAR_PROFILE="$profile" ORGSTAR_ARCHS="arm64 x86_64" sh scripts/build-app.sh "$version" "$build" > /dev/null
50app=".build/app/orgstar.app" 52app=".build/app/orgstar.app"
51codesign --verify --strict --deep "$app" 53codesign --verify --strict --deep "$app"
52 54
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form