feat: add macOS support via Homebrew and launchd#4
Open
webjuantwo wants to merge 1 commit into
Open
Conversation
- Detect OS via `uname -s` in ip-changer.sh and setup.sh; all Linux paths remain unchanged - macOS setup installs tor and jq with brew (no sudo required), patches torrc under $(brew --prefix)/etc/tor, and waits for Tor to be ready before starting the rotation loop - macOS service deployment (setup.sh) generates a launchd user-agent plist from the new com.techchip.change-tor-ip.plist template and loads it via launchctl, replacing the systemd flow - change_tor_ip.sh now resolves TOR_COOKIE and LOG_FILE at runtime based on OS, removing the HOME placeholder pattern - README updated with macOS prerequisites, run-without-install, launchd service control, and uninstall instructions
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.
Summary
uname -sin all scripts; every existing Linux code path is unchangedtorandjqvia Homebrew (nosudorequired), patchestorrcunder$(brew --prefix)/etc/tor, and waits for Tor to be ready before starting IP rotationcom.techchip.change-tor-ip.plistlaunchd template replaces the systemd unit on macOS —setup.shrenders and loads it as a user agent vialaunchctlchange_tor_ip.shresolvesTOR_COOKIEand log path at runtime based on OS (removes theHOMEplaceholder pattern)Test plan
./ip-changer.shon macOS — verify brew installs tor/jq, torrc is patched, Tor starts, IPs rotate at the specified interval./setup.shon macOS — verify~/change_tor_ip.shis deployed, launchd plist is loaded,~/tor_ip_log.txtaccumulates entrieslaunchctl unload/launchctl load -wand confirm rotation pauses/resumes./setup.sh(idempotency) — confirm no duplicate torrc lines and plist reloads cleanly./ip-changer.shand./setup.shon a supported Linux distro — confirm no regressions