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

docs: add instructions for setting up gitsign credential cache on Mac OS #364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions cmd/gitsign-credential-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,53 @@ After that you can enable and start socket service
systemctl --user enable --now gitsign-credential-cache.socket
```

### Launchd agent

To configure gitsign-credential-cache to run in the background on login in Mac OS, create a launchd config in `~/Library/LaunchAgents/gitsign-credential-cache.plist` with the following content:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>gitsign-credential-cache</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
<string>Background</string>
<string>LoginWindow</string>
<string>StandardIO</string>
<string>System</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/gitsign-credential-cache</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/gitsign-credential-cache.log</string>
<key>StandardOutPath</key>
<string>/opt/homebrew/var/log/gitsign-credential-cache.log</string>
</dict>
</plist>
```

The agent will be automatically enabled on next login. To launch the agent, run:

```sh
launchctl start gitsign-credential-cache
```

Configure your shell potining to the cache:

```sh
export GITSIGN_CREDENTIAL_CACHE="$HOME/Library/Caches/sigstore/gitsign/cache.sock"
```

### Forwarding cache over SSH

(Requires gitsign >= v0.5)
Expand Down