Split the proxy core into a shared library, add a Linux CLI#9
Draft
svandragt wants to merge 1 commit into
Draft
Conversation
Splits Package.swift into ProxyLightCore (portable), the existing macOS app target, and a new proxylight-cli target, extracting a plain-Swift ProxyOrchestrator out of AppState so both frontends drive the same start/stop/mapping logic. The CLI is minimal scope: proxy + PAC + CA cert generation only, no system-proxy automation, no CA trust-store install, no login-at-boot, no self-update on Linux. Closes stuartshields#8. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sg1MPNVjkvn53s8bgYdJD9
Author
|
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.
Closes #8.
My first thought was just to check whether the existing package builds on Linux, but with everything in one target that was never going to work.
Changes
Package.swiftintoProxyLightCore(portable library — mapping engine, PAC generation, CA/leaf cert generation, the SwiftNIO proxy pipeline, and a newProxyOrchestratorextracted fromAppState), the existing macOS app target, and a newproxylight-cliexecutable target.SystemProxyManager,CATrustManager,SelfUpdater,LoginItemManager,ProxyRestoreStore) moved toSources/ProxyLight/MacOS/. The macOS app's behaviour is unchanged — it now just depends onProxyLightCoreinstead of owning everything directly.proxylight-cli(swift-argument-parser) withstart,mapping add/list/remove,import,export,ca-path.ProxyLightCoreTests(portable) andProxyLightTests(macOS-only).ProxyLightCoreTestspasses on Linux — 86/86, checked against theswift:6.1Docker image.DispatchSourcewas scheduled onDispatchQueue.main, which never drains because the CLI blocks the main thread on a semaphore instead of running a run loop. Moved it to a dedicated queue.Scope
Linux CLI is deliberately minimal, per the issue: no system-proxy automation, no CA trust-store auto-install, no login-at-boot, no self-update.
proxylight startprints the PAC URL and the CA cert path; the user points their browser at the URL and imports the cert by hand.No CI job yet — Linux builds were checked manually via Docker, not wired into GitHub Actions.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Sg1MPNVjkvn53s8bgYdJD9