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

Conversation

lulf
Copy link

@lulf lulf commented Aug 16, 2023

Summary

Instructions for running gitsign-credential-cache in the background on Mac OS.

Release Note

Documentation

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

tried this but seems to not work

my steps was follow this and after that restart the computer

@lulf
Copy link
Author

lulf commented Aug 16, 2023

@cpanato Interesting, this is working for me, so maybe I have done something more that need to be in the instructions. Did you already remove the gitsign-credential-cache from quarantine or not? xattr -d com.apple.quarantine /path/to/gitsign-credential-cache. Also launchctl list should show if it gets picked up.

@cpanato
Copy link
Member

cpanato commented Aug 17, 2023

@cpanato Interesting, this is working for me, so maybe I have done something more that need to be in the instructions. Did you already remove the gitsign-credential-cache from quarantine or not? xattr -d com.apple.quarantine /path/to/gitsign-credential-cache. Also launchctl list should show if it gets picked up.

the launchctl list shows that

$ launchctl list | grep git
-       78      gitsign-credential-cache

running the command you mentioned does not work looks like

$ xattr -d com.apple.quarantine ~/Library/LaunchAgents/gitsign-credential-cache.plist
xattr: /Users/cpanato/Library/LaunchAgents/gitsign-credential-cache.plist: No such xattr: com.apple.quarantine

when I do the export export GITSIGN_CREDENTIAL_CACHE="$HOME/Library/Caches/sigstore/gitsign/cache.sock"

and try to use I get

error: gpg failed to sign the data:
failed to get identity: error creating RPC socket client: dial unix /Users/cpanato/Library/Caches/sigstore/gitsign/cache.sock: connect: connection refused
Error: failed to get identity: error creating RPC socket client: dial unix /Users/cpanato/Library/Caches/sigstore/gitsign/cache.sock: connect: connection refused

@Dentrax
Copy link
Member

Dentrax commented Mar 20, 2024

Kindly ping here. 🤞 It'd be great to move forward this PR for macOS users!

We (@developer-guy) found also this reference: https://gist.github.com/stand-sure/19d1f3e51746da1d1688b5c90ba65812 - We're able to get this to work:

cat << EOF > ~/Library/LaunchAgents/my.gitsign-credential-cache.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>my.gitsign-credential-cache</string>
    <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>
<<EOF

Then:

launchtl load -w ~/Library/LaunchAgents/my.gitsign-credential-cache.plist
export GITSIGN_CREDENTIAL_CACHE="/Users/<your_username>/Library/Caches/sigstore/gitsign/cache.sock"

/cc @wlynch

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.

3 participants