feat(apple): Add start on login functionality#9168
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new "start on login" functionality for macOS 13+ by adding a new configuration setting and updating the UI and service registration flows accordingly.
- Adds a new configuration key and corresponding default value for starting on login.
- Updates the settings UI with a new toggle and adjusts service registration in the store.
- Updates configuration handling to incorporate the new start on login option.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| swift/apple/FirezoneNetworkExtension/ConfigurationManager.swift | Adds support for persisting the new startOnLogin setting. |
| swift/apple/FirezoneKit/Sources/FirezoneKit/Views/SettingsView.swift | Inserts a new toggle for the start on login functionality and updates the connect toggle text. |
| swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift | Refactors configuration reloading and registers/unregisters the launch service based on startOnLogin. |
| swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Settings.swift | Updates the Settings model to include the new startOnLogin and its override flag. |
| swift/apple/FirezoneKit/Sources/FirezoneKit/Models/Configuration.swift | Adds the default value and key for startOnLogin in the configuration model. |
| Text("Automatically connect when Firezone is launched") | ||
| } | ||
| .toggleStyle(.checkbox) | ||
| .disabled(viewModel.settings.isConnectOnStartOverridden) |
There was a problem hiding this comment.
The 'startOnLogin' toggle is disabled based on 'isConnectOnStartOverridden'. Update it to use 'isStartOnLoginOverridden' so that the correct override flag is applied.
jamilbk
commented
May 16, 2025
….swift Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
thomaseizinger
approved these changes
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new settings/configuration item
startOnLoginwhich simply adds a "Login Item" which starts Firezone after signing into the Mac.This feature is macOS 13 and above only because otherwise we will need to bundle a helper application to register as a service to start the app. Given our very small footprint of macOS 12 users, and how unsupported it is, this is ok.
When it comes time to implement MDM for this feature, note that Apple provides a means to enforce login items via the
ServiceManagementLoginItemspayload which is outside the scope ofcom.apple.configuration.managed. This enforces the login item in System Settings so that the user is unable to disable it.We also add functionality here, but bear in mind that even if we disable the Toggle switch in our Settings page, the user could still disable the item in system settings unless it is being set through MDM via the service management key above.
Another thing to note is that this setting is applied on the GUI side of the tunnel only, because it is inherently tied to the process it is running as. We are not able to (nor does it make sense to) enable the login item for the tunnel service. This should be fine.
Tested to ensure enabling/disabling appropriately adds and removes the login item (and re-adds it if I manually remove it from system settings).
Related: #8916
Related: #2306