Skip to content

feat: Add brew services integration#2

Merged
rbas merged 4 commits into
masterfrom
brew-integration
Feb 10, 2026
Merged

feat: Add brew services integration#2
rbas merged 4 commits into
masterfrom
brew-integration

Conversation

@rbas

@rbas rbas commented Feb 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Homebrew formula template with brew services support for starting/stopping Roxy as a managed service
  • Update release workflow to publish formula to tap after release

Cleanup

Code quality improvements made along the way:

  • Unify PathsConfig and RoxyPaths into a single type
  • Thread loaded Config into Server/AppState instead of re-reading from disk
  • Re-resolve paths from fresh config in reload/restart
  • Remove TLS fallback cert for unknown domains (clean failure + warning instead)
  • Fix .unwrap() in uninstall.rs, add context to create_dir_all errors
  • Rename RouteError variants and fix clippy suppressions

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Homebrew brew services support for running Roxy as a managed service, and refactors configuration/path handling so the daemon/CLI use explicit system paths (config, certs, logs, PID) rather than $HOME-relative defaults.

Changes:

  • Introduce a Homebrew formula template + local test script, and update the release workflow to publish to the Homebrew tap after tagging a release.
  • Consolidate path configuration into RoxyPaths under [paths] in config, thread Config/paths through CLI and daemon instead of re-reading from disk in multiple places.
  • Adjust TLS SNI certificate resolution to fail cleanly (no fallback cert) for unknown domains.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main.rs Adds global --config flag and threads loaded Config/RoxyPaths into CLI commands.
src/infrastructure/tracing.rs Removes the old home-dir-based default log path helper.
src/infrastructure/pid.rs Makes PID file location explicit via PidFile::new(path) and avoids unwrap() on parent().
src/infrastructure/paths.rs New: defines RoxyPaths with system-default locations and serde defaults.
src/infrastructure/mod.rs Exposes the new paths module.
src/infrastructure/config/mod.rs Adds paths: RoxyPaths to config; makes ConfigStore path-explicit and defaults config when missing.
src/infrastructure/certs/service.rs Threads RoxyPaths into certificate operations (CA + cert generation paths).
src/infrastructure/certs/generator.rs Removes home-dir defaults; makes generator path-explicit; simplifies save() return type.
src/infrastructure/certs/ca.rs Removes home-dir defaults; makes CA base directory explicit.
src/domain/value_objects/route.rs Renames RouteError variants to remove clippy suppression and improve naming consistency.
src/domain/value_objects/path_prefix.rs Removes unused is_empty, keeps len() with clippy allow.
src/daemon/tls.rs Removes fallback cert behavior; loads cert/key directly from configured certs dir; warns on unknown SNI.
src/daemon/server.rs Server now takes Config and RoxyPaths; initializes AppState from in-memory registrations.
src/daemon/router.rs AppState no longer reads config from disk; takes registrations via DI.
src/cli/unregister.rs Uses explicit config path and RoxyPaths for cert service.
src/cli/uninstall.rs Uses explicit config path and RoxyPaths; expands cleanup to PID/log dirs; improves kill check logic.
src/cli/stop.rs Uses explicit PID file path from RoxyPaths.
src/cli/status.rs Uses explicit config path and RoxyPaths for pid/config/certs queries.
src/cli/start.rs Threads config/path into start; background start re-execs with --config; daemon logging uses configured log file.
src/cli/route.rs Uses explicit config path for route mutations.
src/cli/restart.rs Reloads config from disk before starting; uses explicit PID file path.
src/cli/reload.rs Reloads config from disk before starting; uses explicit PID file path.
src/cli/register.rs Uses explicit config path and RoxyPaths for cert service + config store.
src/cli/logs.rs Reads/clears/follows logs via configured log file path.
src/cli/list.rs Uses explicit config path and RoxyPaths for cert status checks.
src/cli/install.rs Ensures data/certs/log dirs exist; writes default config if missing; uses path-injected cert service.
scripts/test-brew.sh New: local Homebrew formula + brew services integration test helper.
scripts/formula.rb.template New: Homebrew formula template with a service do block and fixed config/log paths.
docs/README.md Updates docs for new filesystem layout, global --config, and brew services usage.
README.md Adds Homebrew auto-start instructions and updates filesystem layout bullets.
Cargo.toml Removes dirs dependency (no longer home-dir based).
Cargo.lock Removes transitive dirs/dirs-sys deps.
.github/workflows/release.yml Generates formula from template and pushes it to the Homebrew tap after release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread src/cli/start.rs Outdated
Comment thread src/cli/uninstall.rs Outdated
Comment thread scripts/formula.rb.template
@rbas rbas merged commit b1cc623 into master Feb 10, 2026
1 check passed
@rbas rbas deleted the brew-integration branch February 10, 2026 09:17
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