Skip to content

chore: make helper launchdaemon approval mandatory #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 6, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Jul 24, 2025

First step in addressing #201.

This PR installs and kickstarts the LaunchDaemon as part of the .pkg installer, instead of requiring it be approved via the UI. As such, we no longer distribute the app contained within a .zip.

This PR adds a build script to install the LaunchDaemon when developing locally, to ensure it stays up to date when changes are made. Installing the LaunchDaemon requires administrator privileges, so to minimise password prompts, we only restart it when the binary itself, or any of it's frameworks have changed.

There's an Apple Developer Forum thread where I replied, enquiring about this installer approach vs the existing SMAppService approach, esp. w.r.t deploying the app via MDM: https://developer.apple.com/forums/thread/766351?answerId=850675022&page=1#851913022

(This PR previously had UI changes, and I did some refactoring. That refactoring is still in the diff.)

Copy link
Member Author

ethanndickson commented Jul 24, 2025

@@ -206,6 +206,3 @@ echo "$signature" >"$PKG_PATH.sig"

# Add dsym to build artifacts
(cd "$ARCHIVE_PATH/dSYMs" && zip -9 -r --symlinks "$DSYM_ZIPPED_PATH" ./*)

# Add zipped app to build artifacts
zip -9 -r --symlinks "$APP_ZIPPED_PATH" "$BUILT_APP_PATH"
Copy link
Member Author

@ethanndickson ethanndickson Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can no longer distribute the app outside of a pkg (i.e. a zip), as the pkg is responsible for installing the LaunchDaemon.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transitions the helper LaunchDaemon from optional UI-based approval to mandatory installation via the .pkg installer. This eliminates the previous SMAppService approach in favor of a traditional LaunchDaemon setup that doesn't require user interaction.

Key changes:

  • Adds automatic LaunchDaemon installation during package install/postinstall phases
  • Implements development-time helper management with conditional admin privilege prompts
  • Removes UI components and services related to optional helper approval

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/upsert-dev-helper.sh New script for installing/updating helper daemon during local development
scripts/update-cask.sh Adds helper process to uninstall quit list
scripts/build.sh Removes zipped app artifact generation
pkgbuild/scripts/preinstall Adds helper daemon shutdown before installation
pkgbuild/scripts/postinstall Adds helper daemon installation and startup
Coder-Desktop/project.yml Adds post-build script for development helper management
Coder-Desktop/Coder-DesktopHelper/com.coder.Coder-Desktop.Helper.plist Changes from BundleProgram to absolute Program path
Coder-Desktop/Coder-Desktop/Views/VPN/VPNState.swift Refactors UI components into reusable view modifiers
Coder-Desktop/Coder-Desktop/Views/Settings/Settings.swift Removes experimental settings tab
Coder-Desktop/Coder-Desktop/Views/Settings/HelperSection.swift Removes helper management UI components
Coder-Desktop/Coder-Desktop/Views/Settings/ExperimentalTab.swift Removes experimental settings tab
Coder-Desktop/Coder-Desktop/HelperService.swift Removes helper service management code
Coder-Desktop/Coder-Desktop/Coder_DesktopApp.swift Removes helper service dependencies

@ethanndickson ethanndickson force-pushed the ethan/mandatory-helper branch from b535a7d to 493701d Compare August 6, 2025 03:38
Copy link
Member Author

ethanndickson commented Aug 6, 2025

Merge activity

  • Aug 6, 3:39 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 6, 3:40 AM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 6, 3:41 AM UTC: @ethanndickson merged this pull request with Graphite.

@ethanndickson ethanndickson force-pushed the ethan/mandatory-helper branch from 493701d to 6135453 Compare August 6, 2025 03:39
@ethanndickson ethanndickson merged commit 99c912b into main Aug 6, 2025
4 checks passed
@ethanndickson ethanndickson deleted the ethan/mandatory-helper branch August 6, 2025 03:41
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