From 136171c4d15178e13288cb274ebde90a3cce9570 Mon Sep 17 00:00:00 2001 From: Nick Ferraro Date: Mon, 2 Oct 2017 12:33:21 -0700 Subject: [PATCH] fix(setup): Include MailHog setup instructions With the changes to passwordless account creation, contributors are unable to create an account locally. MailHog spins up a local SMPT server that can catch all outgoing emails, allowing contributors to successfully create accounts and see any other emails generated locally. Closes #15838 --- CONTRIBUTING.md | 9 +++++++++ server/datasources.development.js | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 server/datasources.development.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad948db625..7d2d24fbf7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,6 +38,7 @@ Working on your first Pull Request? You can learn how from this *free* series [H | Prerequisite | Version | | ------------------------------------------- | ------- | | [MongoDB](http://www.mongodb.org/downloads) | `~ ^3` | +| [MailHog](https://github.com/mailhog/MailHog) | `~ ^1` | | [Node.js](http://nodejs.org) | `~ ^6` | | npm (comes with Node) | `~ ^3` | @@ -189,6 +190,14 @@ Note: Not all keys are required, to run the app locally, however `MONGOHQ_URL` i You can leave the other keys as they are. Keep in mind if you want to use more services you'll have to get your own API keys for those services and edit those entries accordingly in the .env file. +Next you should setup MailHog, a local SMTP mail server that will catch all the outgoing freeCodeCamp messages generated locally. How you start up MailHog is dependent upon your OS, but here's an example for MacOS with Brew. + +```bash +brew services start mailhog +``` + +To access your MailHog inbox, open your browser and navigate to [http://localhost:8025](http://localhost:8025). For any other questions related to MailHog or for instructions on custom configurations, check out the [MailHog](https://github.com/mailhog/MailHog) repository. + Now you will need to start MongoDB, and then seed the database, then you can start the application: ```bash diff --git a/server/datasources.development.js b/server/datasources.development.js new file mode 100644 index 0000000000..90ee290f06 --- /dev/null +++ b/server/datasources.development.js @@ -0,0 +1,18 @@ +module.exports = { + mail: { + connector: 'mail', + transport: { + type: 'smtp', + host: 'localhost', + secure: false, + port: 1025, + tls: { + rejectUnauthorized: false + } + }, + auth: { + user: 'test', + pass: 'test' + } + } +};