Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up oidc-agent as a persistent service on macOS #28

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Formula/oidc-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@ def install
system "make", "install", "PREFIX=#{prefix}"
end

service do
run [opt_bin/"oidc-agent", "-a", "~/Library/Caches/oidc-agent/oidc-agent.sock", "-d"]
keep_alive true
working_dir var
log_path var/"log/oidc-agent.log"
error_log_path var/"log/oidc-agent.log"
environment_variables PATH: "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/homebrew/bin"
end

def caveats
<<~EOS
To start oidc-agent as a background service now and restart at login:
brew services start oidc-agent
If you don't need a background service, you can run the following instead:
oidc-agent -a ~/Library/Caches/oidc-agent/oidc-agent.sock -d
EOS
end

test do
system "true"
assert_match version.to_s, shell_output("#{bin}/oidc-agent --version")
end
end
Loading