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 @@
55# ORGSTAR_SIGN signing identity; ad hoc ("-") for local use by default. Any other
66# identity also turns on the hardened runtime and a secure timestamp.
77# 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.
810set -eu
911
1012cd "$(dirname "$0")/.."
@@ -248,13 +250,27 @@ for item in "$fw/XPCServices/Installer.xpc" "$fw/XPCServices/Downloader.xpc" "$f
248250done
249251
250252# 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
251267cat > "$work/app.entitlements" <<PLIST
252268<?xml version="1.0" encoding="UTF-8"?>
253269<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
254270<plist version="1.0">
255271<dict>
256272 <key>com.apple.security.personal-information.calendars</key>
257 <true/>
273 <true/>$keychain
258274</dict>
259275</plist>
260276PLIST
scripts/release-mac.sh +3 −1 · view
@@ -28,6 +28,8 @@ files="${ORGSTAR_FILES:-homelab:/var/www/files/orgstar}"
2828publish="${ORGSTAR_PUBLISH:-1}"
2929sign="${ORGSTAR_SIGN:-$(security find-identity -v -p codesigning | sed -n 's/.*"\(Developer ID Application: .*\)"/\1/p' | head -1)}"
3030[ -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; }
3133! grep -q 'publicKey = .*// placeholder' Sources/OrgApp/LicenseKey.swift ||
3234 { echo "Run packaging/license-issuer/keygen.sh first: the license public key is a placeholder." >&2; exit 1; }
3335# 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
4648
4749# The build number counts commits, so each release's is higher than the last's.
4850build="$(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
5052app=".build/app/orgstar.app"
5153codesign --verify --strict --deep "$app"
5254
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