Inspired by a feature I use on kraken.com.
Allow users to specify a PGP Public Key that will be used to encrypt emails sent to that user.
This repository contains a rails application that will gpg encrypt emails sent to users if they have a public key specified.
Key technologies used:
- rails 6
- mail-gpg
Other notable technologies used:
- mailgun
- devise 4
- pg
The following describes the steps needed to get this repository running on heroku.
git clone git@github.com:z2e3r40o/rails-with-gpg.git
- Create a free dyno at heroku.com. Enable hobby dev postgres add on. Enable starter mailgun add on
- Edit line 21 of
config/application.rb
so thathost = 'insert url to your heroku instance here'
. heroku login
git push heroku main:master
- Register new user at https://your-app-name-here.herokuapp.com/users/sign_up using your actual email
- Set your public key at https://your-app-name-here.herokuapp.com/users/edit
- Add the email you registered with to the
Authorized Users
section of mailgun - Navigate to https://your-app-name-here.herokuapp.com/example_email/index
- Check inbox for encrypted email
- Gemfile
- app/mailers/user_mailer.rb
- add_public_key_to_users.rb
- app/views/devise/registrations/edit.html.erb
- application.rb
- example_email_controller
- Not receiving email? Check
heroku logs
. - Something else? File an issue and I will try to answer.