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

#187: [Tools] Add experimental pinentry application #250

Merged
merged 10 commits into from
Aug 30, 2024

Conversation

mcdope
Copy link
Owner

@mcdope mcdope commented Aug 11, 2024

This adds an experimental pinentry application.

Requirements:
[ ] File ~/.pamusb-pinentry.env, containing the following:
[ ] PINENTRY_PASSWORD=yourGpgKeyPassword
[ ] PINENTRY_FALLBACK_APP=/path/to/fallback/pinentry (eg /usr/bin/pinentry-gnome3 or whatever you're using right now)
[ ] Configure GPG to use this application by setting it in ~/.gnupg/gpg-agent.conf. To do so add pinentry-program /path/to/pamusb-pinentry

Note: This MR is work-in-progress

@mcdope mcdope added the enhancement New feature or request label Aug 11, 2024
@mcdope mcdope self-assigned this Aug 11, 2024
@mcdope mcdope linked an issue Aug 11, 2024 that may be closed by this pull request
@DhruvaSambrani
Copy link

update-alternatives is an ubuntu/debian specific thing, iiuc

@mcdope
Copy link
Owner Author

mcdope commented Aug 23, 2024 via email

@DhruvaSambrani
Copy link

Only change is

diff --git a/tools/pamusb-pinentry b/usr/bin/pamusb-pinentry
index 091270c..14878db 100755
--- a/tools/pamusb-pinentry
+++ b/usr/bin/pamusb-pinentry
@@ -19,7 +19,7 @@ import os
 import subprocess
 import getpass
 from dotenv import load_dotenv
-load_dotenv("~/.pamusb-pinentry.env")
+load_dotenv(os.path.expanduser("~/.pamusb-pinentry.env"))
 
 pinentryPassword = os.getenv('PINENTRY_PASSWORD')
 fallbackPinentryApp = os.getenv('PINENTRY_FALLBACK_APP')

Also wouldn't it be better to put the .pamusb-pinentry.env file into the ~/.pamusb folder?

@mcdope
Copy link
Owner Author

mcdope commented Aug 23, 2024 via email

@DhruvaSambrani
Copy link

The pinentry application works, but the PKGBUILD (and other building stuff) needs to be updated probably?

@mcdope
Copy link
Owner Author

mcdope commented Aug 30, 2024 via email

@DhruvaSambrani
Copy link

DhruvaSambrani commented Aug 30, 2024

enabling is obviously left to the user, i agree. Just checked the pkgbuild, and it works fine, even if the update-alternatives fails, so all good!

Edit: Ah i see the || exit 0 now, so it doesn't fail. LGTM now. Also sorry for the delay!

@mcdope mcdope merged commit 8ffa54b into master Aug 30, 2024
9 checks passed
@mcdope mcdope deleted the issue-187-add-pinentry-tool branch August 30, 2024 17:11
@mcdope
Copy link
Owner Author

mcdope commented Aug 30, 2024

Yeah, exactly. Guess it will still yield a visible error on systems not having it, but it wont cause any issues.

Thanks for your help with this.

Btw, not sure you have noticed: but the script is attributed to you and your name is now in AUTHORS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Replacing pinentry to with pam_usb
2 participants