Skip to content

Add a Mac App Store build and tighten privacy - #10

Open
weskcode wants to merge 14 commits into
mainfrom
feature/mac-app-store
Open

weskcode wants to merge 14 commits into
mainfrom
feature/mac-app-store

Conversation

@weskcode

Copy link
Copy Markdown
Owner

Nudge ships as a Developer ID app. The Mac App Store needs a sandboxed build, and the current app could not pass review. It opens at login through a LaunchAgent that the sandbox cannot write, and it uses private WebKit keys for its see-through windows.

This PR adds a separate Mac App Store build mode. The Developer ID build keeps its behavior. It also tightens privacy in both builds. Nudge still collects nothing and sends nothing.

Mac App Store build

  • sh scripts/build-mas.sh builds from a clean clone of HEAD with --no-default-features --features mas. In that clone it removes tauri's macos-private-api feature, signs with App Sandbox entitlements and makes Nudge.pkg. --local makes an ad-hoc test copy under the bundle ID in.nudge.maslocal.
  • In that build, Open at login uses SMAppService, so it needs macOS 13 or later.
  • New files: src-tauri/tauri.mas.conf.json, src-tauri/entitlements.mas.plist (sandbox, network.client so WebKit can draw the windows, app and team identifiers) and src-tauri/PrivacyInfo.xcprivacy.
  • scripts/check-mas-bundle.sh checks a built bundle against the store requirements. scripts/check-no-network.sh fails if networking crates, imports or libraries appear.
  • In this build the reminder and the Settings sidebar are opaque, because see-through windows need the private WebKit keys.

Privacy and data safety, both builds

  • The macOS key tap is switched on only while a reminder shows.
  • Settings and diagnostics files are created owner-only (mode 600, folders 700). Older ones are tightened at launch.
  • Settings are flushed to disk before the rename. An unreadable config.json that cannot be moved aside is never overwritten.
  • Settings > General gains Open GitHub issue, which opens a blank issue with no report attached, and an in-app privacy policy. PRIVACY.md lists what Nudge stores and how to check each claim.

Verified

  • cargo test --locked --offline passes 106 tests in the default build and in the mas mode, with no warnings, at a6dfbc0.
  • sh scripts/build-mas.sh --local at 6feea59: every applicable bundle check passed, including the network scan.
  • On an earlier sandboxed build: the reminder, the sound and Settings render, and Open at login turns on and off with the system's login-item record agreeing.
  • The running debug app creates its data folders as 700 and its files as 600.

Not verified

  • The signed Apple Distribution path and the .pkg. No installer certificate or Mac App Store provisioning profile exists yet.
  • Closing a reminder from another app through Input Monitoring in the sandbox.
  • Windows and Linux builds, including the Linux browser launch change.
  • The new Settings button and privacy dialog in the real window. The test build's menu bar item was hidden, so I checked them in a browser harness built from the real page.

How this was proved: the tests in both build modes, the local store build with its bundle checker, and the runtime checks listed above.

…and the package signature, document the Mac App Store build in SECURITY.md
…nd protect an unreadable settings file

The key tap is switched on when a reminder opens and off when it closes. Settings and diagnostics files are created with mode 600 and folders with 700, and older ones are tightened at launch. When an unreadable config.json cannot be moved aside, saves are skipped for that run so the original is not overwritten. Open GitHub issue and the credit link open fixed addresses and report launcher failures.
…iled inspection, and state the key listener precisely
Another team registered in.nudge.app, so the store build cannot use it. The Developer ID build keeps in.nudge.app, which keeps its Input Monitoring permission and login item.
@weskcode

Copy link
Copy Markdown
Owner Author

Update at de9e950: the store build now uses the bundle ID com.weskcode.nudge.

Apple reported in.nudge.app as registered to another team, so the store build can't use it. The Developer ID build keeps in.nudge.app, so its Input Monitoring permission and login item carry over.

Account setup done: the com.weskcode.nudge bundle ID, a Mac installer certificate, and a Mac App Store profile.

Verified at de9e950: sh scripts/build-mas.sh compiled and signed the app with the Apple Distribution identity. check-mas-bundle.sh passed every check on the signed app, including the four that need a real store signature:

  • the application identifier is HD39MR492X.com.weskcode.nudge
  • the team matches the certificate
  • it is signed with Apple Distribution
  • the profile is embedded

Not done yet:

  • The .pkg step. productbuild waited on a keychain prompt for the new installer key, so the script was stopped before it made the package.
  • The App Store Connect app record.

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.

1 participant