From d748706a222de29aabfbc9e0318cb3e8564ebf04 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Thu, 14 Dec 2023 15:31:36 -0500 Subject: [PATCH] Add nodemailer and sendMail function --- default.env | 5 ++++- dist/index.js | 1 + dist/index.js.map | 2 +- dist/mail.js | 48 +++++++++++++++++++++++++++++++++++++++++++++++ dist/mail.js.map | 1 + package-lock.json | 19 +++++++++++++++++++ package.json | 2 ++ scripts/claim.sh | 6 ------ scripts/train.sh | 5 ----- src/index.ts | 2 ++ src/mail.ts | 45 ++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 123 insertions(+), 13 deletions(-) create mode 100644 dist/mail.js create mode 100644 dist/mail.js.map create mode 100644 src/mail.ts diff --git a/default.env b/default.env index e60d4bf..a9b79b4 100644 --- a/default.env +++ b/default.env @@ -1,4 +1,7 @@ YOLO_WEB_URL=http://localhost:3333 DATASETS=./datasets JOB_DELAY=0 -APP_NAME=yolo_web \ No newline at end of file +APP_NAME=yolo_web +MAIL_FROM="" +MAIL_SMTP="" +MAIL_SMTP_PORT=25 \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index c4e88a6..62ac1dd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26,6 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); +require("dotenv/config"); const express_1 = __importDefault(require("express")); const promises_1 = __importDefault(require("fs/promises")); const fs_1 = require("fs"); diff --git a/dist/index.js.map b/dist/index.js.map index 923b25d..2923af5 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA8B;AAE9B,2DAA6B;AAC7B,2BAAsC;AACtC,2BAA4B;AAC5B,+BAA4B;AAC5B,mCAA0C;AAC1C,qCAAmC;AACnC,8DA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AAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/mail.js b/dist/mail.js new file mode 100644 index 0000000..a23547d --- /dev/null +++ b/dist/mail.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sendMail = void 0; +const nodemailer_1 = __importDefault(require("nodemailer")); +const log_1 = require("./log"); +const from = process.env['MAIL_FROM']; +const smtp = process.env['MAIL_SMTP']; +const port = typeof process.env['MAIL_SMTP_PORT'] !== 'undefined' ? 25 : parseInt(process.env['MAIL_SMTP_PORT'], 10); +let transporter = null; +const log = (0, log_1.createLog)('mail'); +if (typeof from !== 'undefined' && from !== null && from !== '' && + typeof smtp !== 'undefined' && smtp !== null && smtp !== '') { + transporter = nodemailer_1.default.createTransport({ + host: smtp, + port, + secure: false, + tls: { rejectUnauthorized: false } + }); +} +async function sendMail(to, subject, body) { + if (transporter !== null) { + try { + await transporter.sendMail({ + from, + to, + subject, + html: body + }); + log.info(`Sent email "${subject}"`); + } + catch (err) { + log.error(`Error sending email "${subject}"`); + log.error(err); + return false; + } + } + else { + log.warn(`Email not configured, not sending "${subject}"`); + return false; + } + return true; +} +exports.sendMail = sendMail; +module.exports = { sendMail }; +//# sourceMappingURL=mail.js.map \ No newline at end of file diff --git a/dist/mail.js.map b/dist/mail.js.map new file mode 100644 index 0000000..dd50630 --- /dev/null +++ b/dist/mail.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mail.js","sourceRoot":"","sources":["../src/mail.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,+BAAkC;AAGlC,MAAM,IAAI,GAAY,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAY,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC/C,MAAM,IAAI,GAAY,OAAO,OAAO,CAAC,GAAG,CAAC,gBAA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AQ,EAAE,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9a90845..648ed8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "mime": "^3.0.0", "multer": "^1.4.5-lts.1", "node-fetch": "^2.7.0", + "nodemailer": "^6.9.7", "sqlite3": "^5.1.6", "triple-beam": "^1.4.1", "uuid": "^9.0.0", @@ -28,6 +29,7 @@ "@types/mime": "^3.0.1", "@types/multer": "^1.4.7", "@types/node-fetch": "^2.6.9", + "@types/nodemailer": "^6.4.14", "@types/sqlite3": "^3.1.8", "@types/uuid": "^9.0.2", "@types/winston": "^2.4.4", @@ -200,6 +202,15 @@ "form-data": "^4.0.0" } }, + "node_modules/@types/nodemailer": { + "version": "6.4.14", + "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.14.tgz", + "integrity": "sha512-fUWthHO9k9DSdPCSPRqcu6TWhYyxTBg382vlNIttSe9M7XfsT06y0f24KHXtbnijPGGRIcVvdKHTNikOI6qiHA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -1688,6 +1699,14 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/nodemailer": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.7.tgz", + "integrity": "sha512-rUtR77ksqex/eZRLmQ21LKVH5nAAsVicAtAYudK7JgwenEDZ0UIQ1adUGqErz7sMkWYxWTTU1aeP2Jga6WQyJw==", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", diff --git a/package.json b/package.json index e8c2673..c1d633b 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@types/mime": "^3.0.1", "@types/multer": "^1.4.7", "@types/node-fetch": "^2.6.9", + "@types/nodemailer": "^6.4.14", "@types/sqlite3": "^3.1.8", "@types/uuid": "^9.0.2", "@types/winston": "^2.4.4", @@ -30,6 +31,7 @@ "mime": "^3.0.0", "multer": "^1.4.5-lts.1", "node-fetch": "^2.7.0", + "nodemailer": "^6.9.7", "sqlite3": "^5.1.6", "triple-beam": "^1.4.1", "uuid": "^9.0.0", diff --git a/scripts/claim.sh b/scripts/claim.sh index bd4c9be..98fdd50 100644 --- a/scripts/claim.sh +++ b/scripts/claim.sh @@ -21,12 +21,6 @@ if [[ "${JSON}" != *"{"* ]]; then exit 1 fi -if [ -f ./scripts/claim_mail.sh ]; then - bash ./scripts/claim_mail.sh "${JSON}" -else - echo "No email script, not sending." -fi - ID=$(echo $JSON | jq -r '.id') bash ./scripts/train.sh "${JSON}" diff --git a/scripts/train.sh b/scripts/train.sh index 80e7625..f74929d 100644 --- a/scripts/train.sh +++ b/scripts/train.sh @@ -103,8 +103,3 @@ rm "${ZIPPATH}" deactivate cd .. -if [ -f ./scripts/completed_mail.sh ]; then - bash ./scripts/completed_mail.sh "${JSON}" -else - echo "No email script, not sending" -fi diff --git a/src/index.ts b/src/index.ts index c18b447..002bf49 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import 'dotenv/config' import express from 'express'; import { Express, Request, Response, NextFunction } from 'express' import fs from 'fs/promises'; @@ -11,6 +12,7 @@ import multer from 'multer'; import { v4 as uuid } from 'uuid'; import { getType } from 'mime'; import { createLog } from './log' +import { sendMail } from './mail'; import type { Logger } from 'winston'; import * as Handlebars from 'handlebars'; diff --git a/src/mail.ts b/src/mail.ts new file mode 100644 index 0000000..1e2135d --- /dev/null +++ b/src/mail.ts @@ -0,0 +1,45 @@ +import nodemailer from 'nodemailer'; +import { createLog } from './log'; +import type { Logger } from 'winston'; + +const from : string = process.env['MAIL_FROM']; +const smtp : string = process.env['MAIL_SMTP']; +const port : number = typeof process.env['MAIL_SMTP_PORT'] !== 'undefined' ? 25 : parseInt(process.env['MAIL_SMTP_PORT'], 10); + +let transporter : nodemailer.Transporter = null; + +const log : Logger = createLog('mail'); + +if (typeof from !== 'undefined' && from !== null && from !== '' && + typeof smtp !== 'undefined' && smtp !== null && smtp !== '') { + transporter = nodemailer.createTransport({ + host: smtp, + port, + secure : false, + tls: { rejectUnauthorized: false } + }); +} + +export async function sendMail (to : string, subject : string, body : string) : Promise{ + if (transporter !== null) { + try { + await transporter.sendMail({ + from, + to, + subject, + html: body + }); + log.info(`Sent email "${subject}"`); + } catch (err) { + log.error(`Error sending email "${subject}"`); + log.error(err); + return false; + } + } else { + log.warn(`Email not configured, not sending "${subject}"`); + return false; + } + return true; +} + +module.exports = { sendMail }; \ No newline at end of file