Skip to content

Commit

Permalink
Update ngrok documentation for improvmx (#254)
Browse files Browse the repository at this point in the history
* Update ngrok documentation for improvmx

* Add placeholder to env example

* Fix readme

* Fix readme

* Clarify readme
  • Loading branch information
wilco375 authored Oct 4, 2021
1 parent 4852ed8 commit 2f2aa1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ POSTGRES_USER=alpha_amber_<env>
POSTGRES_PASSWORD=<password>

HOST=csvalpha.nl

NGROK_HOST=<subdomain>.ngrok.io
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@

# Ignore master key for decrypting credentials and more.
/config/master.key

# Ignore activestorage files
/storage
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ $ EDITOR="subl --wait" bundle exec rails credentials:edit
$ EDITOR="code --wait" bundle exec rails credentials:edit
```

## Run mailgun locally
To test the mailgun endpoint you can setup mailgun to forward mail to your local machine. To do this you should follow the following steps.
## Run ImprovMX locally
To test the ImprovMX endpoint you can setup ImprovMX to forward mail to your local machine. To do this you should follow the following steps.

1. Install [ngrok](https://ngrok.com/download)
2. Run ngrok with `./ngrok http 3000`
3. Add a mailgun catch-all route with as action 'store and notify' to `ngrok-address`/mailgun
4. Get the [mailgun API key](https://app.mailgun.com/app/domains/csvalpha.nl)
5. Start the rails server `MAILGUN_API_KEY='key_here' bundle exec rails s`
3. Add an ImprovMX email address that forwards to `https://actionmailbox:<action_mailbox-ingress-password>@<ngrok-address>/rails/action_mailbox/improvmx/inbound_emails`
4. Add the `NGROK_HOST` to your `.env` file
5. Start the rails server


## Run specs (tests)
Expand Down
3 changes: 3 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
# Refer the Ember/UI of the Alpha website
config.action_mailer.default_url_options = { scheme: 'http', host: 'localhost', port: 4200 }

# Allow access to the api via ngrok
config.hosts << ENV['NGROK_HOST'] if ENV['NGROK_HOST']

# Run Sidekiq inline
require 'sidekiq/testing'
Sidekiq::Testing.inline!
Expand Down

0 comments on commit 2f2aa1b

Please sign in to comment.