mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 15:31:19 +00:00
Add eslint rule and fix as many issues as possible
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import nodemailer from "nodemailer";
|
||||
import {
|
||||
SMTP_HOST_SENDGRID,
|
||||
SMTP_HOST_GMAIL,
|
||||
SMTP_HOST_MAILGUN,
|
||||
SMTP_HOST_SENDGRID,
|
||||
SMTP_HOST_SOCKETLABS,
|
||||
SMTP_HOST_ZOHOMAIL,
|
||||
SMTP_HOST_GMAIL
|
||||
} from '../variables';
|
||||
import SMTPConnection from 'nodemailer/lib/smtp-connection';
|
||||
import * as Sentry from '@sentry/node';
|
||||
} from "../variables";
|
||||
import SMTPConnection from "nodemailer/lib/smtp-connection";
|
||||
import * as Sentry from "@sentry/node";
|
||||
import {
|
||||
getSmtpHost,
|
||||
getSmtpUsername,
|
||||
getSmtpPassword,
|
||||
getSmtpPort,
|
||||
getSmtpSecure,
|
||||
getSmtpPort
|
||||
} from '../config';
|
||||
getSmtpUsername,
|
||||
} from "../config";
|
||||
|
||||
export const initSmtp = async () => {
|
||||
const mailOpts: SMTPConnection.Options = {
|
||||
host: await getSmtpHost(),
|
||||
port: await getSmtpPort()
|
||||
port: await getSmtpPort(),
|
||||
};
|
||||
|
||||
if ((await getSmtpUsername()) && (await getSmtpPassword())) {
|
||||
mailOpts.auth = {
|
||||
user: await getSmtpUsername(),
|
||||
pass: await getSmtpPassword()
|
||||
pass: await getSmtpPassword(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,31 +37,31 @@ export const initSmtp = async () => {
|
||||
case SMTP_HOST_MAILGUN:
|
||||
mailOpts.requireTLS = true;
|
||||
mailOpts.tls = {
|
||||
ciphers: 'TLSv1.2'
|
||||
ciphers: "TLSv1.2",
|
||||
}
|
||||
break;
|
||||
case SMTP_HOST_SOCKETLABS:
|
||||
mailOpts.requireTLS = true;
|
||||
mailOpts.tls = {
|
||||
ciphers: 'TLSv1.2'
|
||||
ciphers: "TLSv1.2",
|
||||
}
|
||||
break;
|
||||
case SMTP_HOST_ZOHOMAIL:
|
||||
mailOpts.requireTLS = true;
|
||||
mailOpts.tls = {
|
||||
ciphers: 'TLSv1.2'
|
||||
ciphers: "TLSv1.2",
|
||||
}
|
||||
break;
|
||||
case SMTP_HOST_GMAIL:
|
||||
mailOpts.requireTLS = true;
|
||||
mailOpts.tls = {
|
||||
ciphers: 'TLSv1.2'
|
||||
ciphers: "TLSv1.2",
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ((await getSmtpHost()).includes('amazonaws.com')) {
|
||||
if ((await getSmtpHost()).includes("amazonaws.com")) {
|
||||
mailOpts.tls = {
|
||||
ciphers: 'TLSv1.2'
|
||||
ciphers: "TLSv1.2",
|
||||
}
|
||||
} else {
|
||||
mailOpts.secure = true;
|
||||
@@ -75,7 +75,7 @@ export const initSmtp = async () => {
|
||||
.verify()
|
||||
.then((err) => {
|
||||
Sentry.setUser(null);
|
||||
Sentry.captureMessage('SMTP - Successfully connected');
|
||||
Sentry.captureMessage("SMTP - Successfully connected");
|
||||
console.log("SMTP - Successfully connected")
|
||||
})
|
||||
.catch(async (err) => {
|
||||
|
||||
Reference in New Issue
Block a user