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

Automatically find gpg-agent socket path #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

forsberg
Copy link

Adds code that uses the gpgconf command to find the gpg-agent socket path. The old behaviour is kept, it's only if the call to agent.Dial has the empty string as filename argument that the code will try to find the socket automatically.

Tested on Ubuntu bionic.

Also made a few minor changes to the README, and made travis builds work even on forks. In addition, created a script for running the tests locally.

Please point out any go-related beginners mistakes, it's my first go code :-)

Script:

- Starts gpg-agent with correct directory (testdata/gnupg)
- Sets GNUPGHOME for other gnupg programs to find the right directory.
- Runs go test, adding any arguments from the runtests.sh commandline.
If no GPG-agent socket path was given to Dial, try to find
socket path by running the gpgconf program.
@prep
Copy link
Owner

prep commented Feb 17, 2019

Hey Erik,

Apologies for the late reply and thank you for your PR 👍 If this is indeed your first time writing Go, then you're off to a great start!

I'd be happy to merge your PR, with the exception of runtests.sh script and the stuff that references it. I prefer to keep those kinds of scripts out of the repo, but if they're now required to run the tests I'd rather spend some more time on making the tests more sane to their environment, than to adjust the environment to insane requirements on the tests 😉

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