-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
2,422 additions
and
2,143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ language: node_js | |
|
||
node_js: | ||
- 16 | ||
|
||
env: | ||
global: PATH=/opt/python/3.7.1/bin:$PATH | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,13 +56,13 @@ root | |
|
||
```js | ||
// .env | ||
TWILIO_NUMBER = ""; | ||
TWILIO_ACCOUNT_SID = ""; | ||
TWILIO_AUTH_TOKEN = ""; | ||
SERVICE_SID = ""; | ||
VERIFICATION_SERVICE_SID = ""; | ||
SLACK_WEBHOOK = ""; | ||
POSTGRES_URI = ""; | ||
TWILIO_NUMBER = ''; | ||
TWILIO_ACCOUNT_SID = ''; | ||
TWILIO_AUTH_TOKEN = ''; | ||
SERVICE_SID = ''; | ||
VERIFICATION_SERVICE_SID = ''; | ||
SLACK_WEBHOOK = ''; | ||
POSTGRES_URI = ''; | ||
``` | ||
|
||
5. Create a folder called `security` in the project's top-level directory. Inside of the `security` folder, create two files `email.js` and `sysadmin.js`. These files will store variables related to the email notification service and system admin setup respectively. | ||
|
@@ -82,10 +82,10 @@ root | |
```js | ||
// email.js | ||
module.exports = { | ||
host: "smtp.gmail.com", | ||
host: 'smtp.gmail.com', | ||
port: 465, | ||
username: "[email protected]", | ||
password: "belugas", | ||
username: '[email protected]', | ||
password: 'belugas', | ||
}; | ||
``` | ||
|
||
|
@@ -94,8 +94,8 @@ module.exports = { | |
```js | ||
// sysadmin.js | ||
module.exports = { | ||
phone: "", | ||
email: "", | ||
phone: '', | ||
email: '', | ||
}; | ||
``` | ||
|
||
|
@@ -115,11 +115,11 @@ For now, the sign up function will create a System Admin user. | |
|
||
```js | ||
// .env.js | ||
MY_PHONE_NUMBER = "your mobile number"; | ||
TWILIO_ACCOUNT_SID = "code from your console"; | ||
TWILIO_AUTH_TOKEN = "token from your console"; | ||
SERVICE_SID = "code from notify service instance"; | ||
VERIFICATION_SERVICE_SID = "code from verify service instance"; | ||
MY_PHONE_NUMBER = 'your mobile number'; | ||
TWILIO_ACCOUNT_SID = 'code from your console'; | ||
TWILIO_AUTH_TOKEN = 'token from your console'; | ||
SERVICE_SID = 'code from notify service instance'; | ||
VERIFICATION_SERVICE_SID = 'code from verify service instance'; | ||
``` | ||
|
||
4. Verification service was created [here](https://www.twilio.com/console/verify/services); code length and serviceSID can be taken from your Twilio account console. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,4 +116,4 @@ | |
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
*/ | ||
|
||
import { Request, Response, NextFunction } from 'express'; | ||
import nodemailer from "nodemailer"; | ||
import email from "../../security/email"; | ||
import nodemailer from 'nodemailer'; | ||
import email from '../../security/email'; | ||
import { ApiController, ServerError } from '../../types'; | ||
|
||
// create transporter object to make sure these values are filled out in email.js | ||
|
@@ -26,7 +26,7 @@ const apiController: ApiController = { | |
const { email, containerName, time, date, stopped } = req.body; | ||
let emailBody; | ||
|
||
if (stopped === "true") { | ||
if (stopped === 'true') { | ||
emailBody = ` | ||
<h2>Alert: ${containerName} has stopped!</h2> | ||
<h3>Container <b>${containerName}</b> stopped running at <b>${time}</b> on <b>${date}</b>.</h3> | ||
|
@@ -47,9 +47,9 @@ const apiController: ApiController = { | |
} | ||
|
||
const mailDetails = { | ||
from: "[email protected]", | ||
from: '[email protected]', | ||
to: email, | ||
subject: "Docketeer: Container Issue", | ||
subject: 'Docketeer: Container Issue', | ||
html: `${emailBody}`, | ||
}; | ||
|
||
|
@@ -62,7 +62,7 @@ const apiController: ApiController = { | |
return next({ | ||
log: `Error in apiController sendEmailAlert: ${err}`, | ||
message: { | ||
err: "An error occured creating new user in database. See apiController.sendEmailAlert.", | ||
err: 'An error occured creating new user in database. See apiController.sendEmailAlert.', | ||
}, | ||
}); | ||
}); | ||
|
@@ -73,9 +73,9 @@ const apiController: ApiController = { | |
const { email, username, password } = req.body; | ||
|
||
const mailDetails = { | ||
from: "[email protected]", | ||
from: '[email protected]', | ||
to: email, | ||
subject: "Docketeer: Account Details", | ||
subject: 'Docketeer: Account Details', | ||
html: ` | ||
<h1>Welcome to Docketeer</h1> | ||
<p>We are so excited to have you onboard!</p> | ||
|
@@ -96,7 +96,7 @@ const apiController: ApiController = { | |
return next({ | ||
log: `Error in apiController signupEmail: ${err}`, | ||
message: { | ||
err: "An error occured creating new user in database. See apiController.signupEmail.", | ||
err: 'An error occured creating new user in database. See apiController.signupEmail.', | ||
}, | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.