Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Commit

Permalink
Update to README and Installation doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kehers committed Aug 24, 2018
1 parent 9fbd4fe commit bb6e4b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -31,7 +31,7 @@ Invite other members of your team to your analytics dashboard

## Usage

The easiest way to use Suet is through the managed version at [suet.co](https://suet.co/) (costs as low as $5/month). An alternative option is to set up Suet on your own server. To do this, check out the [installation instructions](http://github.com/suetco/suet/blob/master/docs/installation.md).
The easiest way to use Suet is through the managed version at [suet.co](https://suet.co/) (costs as low as $10/month). An alternative option is to set up Suet on your own server. To do this, check out the [installation instructions](http://github.com/suetco/suet/blob/master/docs/installation.md).

## Staying up to date

Expand All @@ -43,6 +43,6 @@ You can submit an issue at [github.com/suetco/suet/issues](http://github.com/sue

## Copyright/Licence

Copyright (c) 2017 Opeyemi Obembe. Released under the [GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.txt).
Copyright (c) 2018 Opeyemi Obembe. Released under the [GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.txt).

If you use Suet for more than one Mailgun domain, make money from any of your domains, want email support or just want to support development, consider purchasing a [licence for $70/year](https://pay.paddle.com/checkout/515197).
17 changes: 13 additions & 4 deletions docs/installation.md
Expand Up @@ -13,14 +13,20 @@ It is assumed you have MongoDB installed already. If not, [install MongoDB](http
- Run `git clone https://github.com/kehers/suet` in the directory or just download and unzip right in
- Run `npm install`

Next, you will need to update the environment variables. There is a `.env.example` file that contains the needed variables. Open the file, edit the variables and rename the file to `.env`.
Next, you will need to update the environment variables. There is a `.env.example` file that contains the needed variables. Open the file, edit the variables and rename the file to `.env`.

The email variables (prefixed with `EMAIL_`) are used to send password recovery emails. (Suet uses [Mailgun’s API](https://documentation.mailgun.com/en/latest/quickstart-sending.html#how-to-start-sending-email) to send emails instead of normal SMTP). The Slack variables (prefixed with `SLACK_`) are used to sign in Slack accounts that should be connected to the Mailgun domains for notifications. (See [Connecting Slack](#connecting-slack))

The environment variables are:

- `HOST` (The IP or web address your application will be located at, without the trailing slash e.g. http://suet.some.paas)
- `SESSION_KEY` (Random string to encrypt session cookies)
- `AES_KEY` (Random string used for API key encryption in the database. It is important you don’t change this key once set as already encrypted keys will not be decryptable)
- `DB_NAME` (Name of your MongoDB database e.g suet)
- `DB_URL` (URL of your MongoDB database e.g mongodb://localhost/suet)
- `ES_HOST` (Elasticsearch IP or web address)
- `ES_AUTH` (_httpAuth_ value for your Elasticsearch)
- `BS_KEY` (Bugsnag key for error reporting. Signup for a free account at bugsnag.com and get a key)
- `EMAIL_FROM` (The sender identification for the email. Format “Name \<email>” e.g. Suet \<no-reply@suet.co>)
- `EMAIL_DOMAIN` (The Mailgun domain you want to send emails from)
- `EMAIL_KEY` (The API key of the domain above. Login to your Mailgun account and click the domain to get the domain API key)
Expand All @@ -30,12 +36,16 @@ The environment variables are:

Once set (and file renamed to `.env`), you can start Suet with `node app.js` or in your favourite way.

### Upgrading to v2

One important change to version 2 is that API keys are encrypted (AES, 256, CTR) in the DB. If you are upgrading from v1, you need to run `node upgrades/v2.js` to encrypt existing keys in your database. Don’t forget that once this is done, you shouldn’t change your `AES_KEY` any longer as already encrypted keys will not be decryptable.

### Webhook Setup

You need to setup a [webhook](http://mailgun-documentation.readthedocs.io/en/latest/api-webhooks.html) that Mailgun will send events to. The recommended option is to use [Google Cloud HTTP function](https://cloud.google.com/functions/docs/writing/http). It is highly scalable especially if you send lots of mails.
You need to setup a [webhook](http://mailgun-documentation.readthedocs.io/en/latest/api-webhooks.html) that Mailgun will send events to. (Here is a post on [working with Mailgun webhooks](http://obem.be/2017/09/08/working-with-mailgun-webhooks.html)). The recommended option is to use [Google Cloud HTTP function](https://cloud.google.com/functions/docs/writing/http). It is highly scalable especially if you send lots of mails.

> Q: Why not AWS API gateway + Lambda?
> A: Mailgun uses the content-type multipart/form-data to send some event data and this content-type is not supported by AWS API gateway (yet).
If microservices is not your thing or just can't go through the stress, there is a webhook endpoint available at `[host]/webhook`.
Expand Down Expand Up @@ -75,4 +85,3 @@ You can connect [Slack](https://slack.com/) to Suet to be able to receive compla
- Activate Incoming Webhooks in the next page (toggle the switch to `On`) then go back to previous page.
- Scroll down to `App Credentials` and copy your Client ID and Client Secret.
- Use the credentials as your Slack environment variables.

0 comments on commit bb6e4b2

Please sign in to comment.