[WIP] Encrypt mail with pgp
Based on this feature Request and some Issues I started working on encrypted Email Support.
Fixes #3853 (closed) and #3471 (moved)
ToDo List:
-
Sending PGP signed messages. -
PGP can be enabled in the admin interface. -
PGP signing can be enabled in the admin interface. -
PGP passphrase can be configured in the admin interface. -
User can upload a personal public PGP Key. -
User can specify if they want to receive encrypted mails. -
PGP Fingerprint is visible on the Profile page. -
When clicking on the fingerprint, the RAW PGP Key is shown. -
Admin can remove a users PGP Key -
Admin can see and change a users PGP settings. -
Decrypt mails send to the GitLab server (Reply by email feature) -
Write Tests -
Cleanup Code -
Make the servers PGP Key available in the web interface (e.g. in the Help selection) -
Write documentation
For these changes to work fully, GnuPG must be installed on the system. Also two new Gems are required gpgme and mail-gpg.
PS: This is the first time I am developing something in Ruby/Rails, so your feedback is really appreciated!
Merge request reports
Activity
I think that settings should now be stored in the db and configured by the UI so you might want to look into that part. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/application_setting.rb might be a starting point for it.
I also wonder if there is possibly some overlap between signed emails and signed commits which is another feature I've seen being requested. Perhaps this could be written in such a way to be easily extended to support signed commits?
As signed commits are already supported by git (using git commit -S or setting the commit.gpgsign config variable). If the key is included in the users settings, it shouldn't be difficult to add the option for the -S flag to commits, merges and tags done via the web UI, I think. Should be a good extension of this after the email task is done and merged in.
Edited by username-removed-322826Yeah, that was what I was getting at, something that the UI can use to validate and work with signed commits / tags.
For reference here are a couple of feedback items in the old system I found:
Making signed commits through the WebUI is a bad idea. Because to make a signature, the private key must be available in the keyring of the server. And my private key is something I would never "publish".
Checking signed commits/pushes/tags or sending encryped messages however only requires the public key. And once the public key is uploaded, showing and validating signatures with
git log --show-signature
is easy.mentioned in commit 529e89b0
mentioned in commit 6c9c6da0
mentioned in commit 3bb453d5