Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused Nodemailer env vars #253

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions docs/DEPLOYMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This document details what is needed to create an environment to run FormSG in AWS.

### Build and run your nodejs app
## Build and run your NodeJS app

```
$ npm install
```bash
npm install
$ npm run build
$ npm start
```
Expand All @@ -25,7 +25,7 @@ As a prerequisite for EB deployment, make sure you have already created your AWS

### Dockerrun.aws.json

```
```json
{
"AWSEBDockerrunVersion": "1",
"Image": {
Expand All @@ -52,7 +52,7 @@ FormSG supports storing of users' Twilio API credentials using AWS Secret Manage

Firstly, name the secret with a unique secret name and store the secret value in the following format:

```
```json
{
"accountSid": "",
"apiKey": "",
Expand Down Expand Up @@ -145,8 +145,6 @@ The following env variables are set in Travis:
| `SES_PASS` | SMTP password. |
| `SES_MAX_MESSAGES` | Nodemailer configuration. Connection removed and new one created when this limit is reached. This helps to keep the connection up-to-date for long-running email messaging. Defaults to `100`. |
| `SES_POOL` | Connection pool to send email in parallel to the SMTP server. Defaults to `38`. |
| `SES_RATE` | Maximum email to send per second, or per `rateDelta` if supplied. |
| `SES_RATEDELTA` | Defines the time measuring period in milliseconds for rate limiting. Defaults to `1000`. |
| `MAIL_FROM` | Sender email address. Defaults to `'[email protected]'`. | |
| `MAIL_SOCKET_TIMEOUT` | Milliseconds of inactivity to allow before killing a connection. This helps to keep the connection up-to-date for long-running email messaging. Defaults to `600000`. |
| `MAIL_LOGGER` | If set to true then logs to console. If value is not set or is false then nothing is logged. |
Expand Down Expand Up @@ -258,9 +256,9 @@ If this feature is enabled, storage mode forms will also support authentication

### Tests

| Variable | Description |
| :--------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `MONGO_BINARY_VERSION` | Version of the Mongo binary used. Defaults to `'latest'` according to [MongoMemoryServer](https://github.com/nodkz/mongodb-memory-server) docs. |
| `PWD` | Path of working directory. |
| `MOCK_WEBHOOK_CONFIG_FILE` | Path of configuration file for mock webhook server |
| `MOCK_WEBHOOK_PORT` | Port of mock webhook server |
| Variable | Description |
| :------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `MONGO_BINARY_VERSION` | Version of the Mongo binary used. Defaults to `'latest'` according to [MongoMemoryServer](https://github.com/nodkz/mongodb-memory-server) docs. |
| `PWD` | Path of working directory. |
| `MOCK_WEBHOOK_CONFIG_FILE` | Path of configuration file for mock webhook server |
| `MOCK_WEBHOOK_PORT` | Port of mock webhook server |
9 changes: 0 additions & 9 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,6 @@ const mailConfig: MailConfig = (function () {
// If set to true, then logs SMTP traffic, otherwise logs only transaction
// events.
debug: String(process.env.MAIL_DEBUG).toLowerCase() === 'true',
// Per second, or per rateDelta if supplied.
rateLimit: process.env.SES_RATE
? Number(process.env.SES_RATE)
: undefined,
// Defines the time measuring period in milliseconds (defaults to 1000)
// for rate limiting.
rateDelta: process.env.SES_RATEDELTA
? Number(process.env.SES_RATEDELTA)
: undefined,
}

transporter = nodemailer.createTransport(options)
Expand Down