Repository navigation
fix(app): check where Ovis for Mac's installer, phone address and phone step come from, and finish #1455's follow-ups - #2116
Merged
Conversation
…ne step come from, and finish #1455's follow-ups Fixes #1455 (the items still on main after #1877). - The installer download follows only HTTPS redirects to ovis.sh or herdrweb.dev and checks the final URL. - /api/access is read only from a loopback origin, without following redirects; serving_url draws the QR code only as https://<name>.ts.net. Open in Browser opens only web addresses. - The phone step runs scripts/plugin.ts from the code the server runs now, read from its processes: `plugin.ts status` names the launcher (this checkout's server/managed.ts), whose supervisor runs the bridge (`bun server/index.ts`) in the active release's dir or the checkout. That dir counts only when it is the checkout or a release-* dir whose plugin.ts is its own; otherwise the checkout's runs. The step checks for the phone command, waits up to 240 s (plugin.ts gives tailscale serve 180 s) and reports a failure. - Remove stops at a failed plugin list, stop or plugin uninstall, and turns off Tailscale serve for the app's port even when the server is down (tailscale serve status --json), failing when that read fails. - Start with no LaunchAgent runs herdr for this login only, from a plist deleted after bootstrap, and makes no login item. - herdr-server.log moves to herdr-server.log.1 past 10 MB (copied and emptied in place, since launchd keeps it open; a link is rotated where it points). - Try again reruns the action that failed. The refresh button has an accessibility label. - build.sh refuses a version or build that is not numbers and dots, and passes the keychain as one argument. - app/mac/Tests (swift test) covers the pure checks and a real launcher/supervisor/bridge tree.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Owner
Author
|
Merging b7a13de: omo-native-code-reviewer and Codex both pass this head (LOW notes only), and the required checks are green. Both reviewed the Swift by reading on Linux; the PR's own MacBook Air runs (swift test 14/14) stand. CodeRabbit did not review this head. |
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.
Fixes #1455: the Ovis for Mac follow-ups from #1451's review that were still on main. The device sweep checked each item against main (comment). M1, M2 and part of M4 were already fixed (#1877 and the
workcounter).This ships with the next Ovis for Mac build. Ovis.dmg is built at release (
mac-dmg.yml), so installed apps keep the old behaviour until then. Nothing here touchesserver/,src/orshared/, and the remote bundle is unchanged.What changes (app/mac)
Security-ish
ovis.shorherdrweb.dev, and checks the final URL before running the script. Todayovis.sh/install.shreturns a 302 toherdrweb.dev/install.sh. Before, any redirect was followed and only the final 200 was checked./api/accessis read only from a loopback origin, with no redirect followed.serving_urlbecomes the QR code only ashttps://<name>.ts.net, the only address Tailscale's certificate covers. No user info, query, fragment or path is allowed.plugin.ts statusmust be http(s), and Open in Browser opens only http(s).Behaviour
M3, the phone step: it now runs
scripts/plugin.ts phonefrom the code the server runs now, not the first-installed checkout. Settings → Updates runs newer releases from the state dir while herdr's checkout stays put, so the app reads that code from the running processes instead of copying the plugin's lookup:plugin.ts status, read when the button is clicked, names the launcher's pid.server/managed.ts.bun server/index.ts) in the active release's dir, and the app reads that directory from the bridge process. This holds even when the launcher fell back to an older supervisor.release-*dir whosescripts/plugin.tsis its own. Otherwise the checkout's script runs.The step also checks that the script has the
phonecommand, waits up to 240 s (plugin.ts givestailscale serve180 s), and checks the exit status: a failure shows the output instead of a silent refresh.Remove: it stops and says why when
herdr plugin list,stoporplugin uninstallfails. Try again then goes on from that step. It turns offtailscale servefor the app's port even when the server is down: it readstailscale serve status --jsonthe wayserver/tailscale.tsdoes, and fails when that read fails.Start without a LaunchAgent (herdr set up from a terminal): herdr now runs for this login only. The job is bootstrapped from a temp plist that is deleted right after, so no login item is created. Only Install creates one.
Logs:
herdr-server.logmoves toherdr-server.log.1past 10 MB, when the app opens or starts herdr. It is copied and emptied in place, because launchd keeps the file open with O_APPEND. A symlinked log is rotated where it points.Try again reruns the action that failed (install, restart, phone or remove).
The refresh button gets an accessibility label.
build.sh: it refuses a version or build that is not numbers and dots, which broke itssedbefore. The keychain now reachescodesignas one argument.Tests:
app/mac/Tests(swift test) adds 14 XCTest cases: the pure checks, plus a real launcher, supervisor and bridge process tree. No CI job runs them; the README says how.Verification
All runs were on the test MacBook Air (
eamac, macOS 27.0.1, Xcode 27), in fresh clones under /tmp that were deleted afterwards. The installed Ovis.app, herdr and thesh.ovis.*LaunchAgents were not touched.Build and tests:
swift buildOK,swift test14/14.build.shbuilds an ad hoc signed app and DMG./bin/shon macOS 27.bun <root>/server/managed.ts, then its childserver/supervisor.ts, thenbun server/index.ts. I only read these processes.The tests can fail: on main, the new tests do not compile (the checks are missing). On this branch I broke each check in turn, and each made its test fail:
plugin.tslinked out of the release, no pid read, and an unterminated argument.build.sh:OVIS_MAC_VERSION=1.0/0andOVIS_MAC_BUILD=1&2exit 1 with a message.codesignshim showsOVIS_KEYCHAIN="/tmp/key chain/k.keychain-db"arriving as one argument. main's build.sh split it in two."$@"underset -uis fine in macOS/bin/sh(bash 3.2).launchd probe with a throwaway label (
dev.fix1455.probe.*):~/Library/LaunchAgents.bootoutremoved the probe, andsh.ovis.herdr-serverwas in the same state before and after.bun run check fast: typecheck, build and all other checks pass. On this busy PC (load 80 to 90), each full run had one timing-bound test fail in a file this PR does not touch, and a different one each time:server/codex-processes.test.ts, the Codex Chat unavailable after resuming a session through the codex resume picker #896 case;scripts/ci-browser.test.ts, three cases killed at their 5 s limit;server/codex.test.ts, the bounded-time case.The diff is only
app/mac/and one changelog fragment. Run on their own, the failing files pass (codex-processes 3/3; ci-browser 2/2 on this branch and 2/2 on main), and a full run on main passed. CI runs the full suite.Review
b7a13dee) is a PASS with no CRITICAL, HIGH or MEDIUM. Earlier rounds found MEDIUMs, all fixed:serve statuscounted as success;/privatenormalization, both state dir names,HERDR_PLUGIN_CONFIG_DIR), so the app now reads the running bridge instead;Left as known limits (LOW):