From 2f2aa1be561b750c23c40750aab0a81cd2be37b3 Mon Sep 17 00:00:00 2001 From: Wilco Date: Mon, 4 Oct 2021 08:44:22 +0200 Subject: [PATCH] Update ngrok documentation for improvmx (#254) * Update ngrok documentation for improvmx * Add placeholder to env example * Fix readme * Fix readme * Clarify readme --- .env.example | 2 ++ .gitignore | 3 +++ README.md | 10 +++++----- config/environments/development.rb | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 9b48baf8..30290fe4 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,5 @@ POSTGRES_USER=alpha_amber_ POSTGRES_PASSWORD= HOST=csvalpha.nl + +NGROK_HOST=.ngrok.io diff --git a/.gitignore b/.gitignore index 804c3f8f..53186734 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +# Ignore activestorage files +/storage diff --git a/README.md b/README.md index 5d2df702..60ea69c5 100644 --- a/README.md +++ b/README.md @@ -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:@/rails/action_mailbox/improvmx/inbound_emails` +4. Add the `NGROK_HOST` to your `.env` file +5. Start the rails server ## Run specs (tests) diff --git a/config/environments/development.rb b/config/environments/development.rb index d25309c1..99e21f44 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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!