From 7683d7d123de9a168fe6917a977ca30ebb9c81fe Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 16 Aug 2023 13:10:41 +0200 Subject: [PATCH] docs: add instructions for setting up gitsign credential cache on Mac OS Signed-off-by: Ulf Lilleengen --- cmd/gitsign-credential-cache/README.md | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/cmd/gitsign-credential-cache/README.md b/cmd/gitsign-credential-cache/README.md index 4c99b5c9..d49bd843 100644 --- a/cmd/gitsign-credential-cache/README.md +++ b/cmd/gitsign-credential-cache/README.md @@ -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 + + + + + KeepAlive + + Label + gitsign-credential-cache + LimitLoadToSessionType + + Aqua + Background + LoginWindow + StandardIO + System + + ProgramArguments + + /opt/homebrew/bin/gitsign-credential-cache + + RunAtLoad + + StandardErrorPath + /opt/homebrew/var/log/gitsign-credential-cache.log + StandardOutPath + /opt/homebrew/var/log/gitsign-credential-cache.log + + +``` + +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)