feat: add env var to allow invalid SSL certs
This commit is contained in:
@@ -17,6 +17,7 @@ SMTP_USER=
|
|||||||
SMTP_PASSWORD=
|
SMTP_PASSWORD=
|
||||||
EMAIL_FROM= # e.g. "Kan <hello@mail.kan.bn>"
|
EMAIL_FROM= # e.g. "Kan <hello@mail.kan.bn>"
|
||||||
SMTP_SECURE= # set to "false" to use port 587
|
SMTP_SECURE= # set to "false" to use port 587
|
||||||
|
SMTP_REJECT_UNAUTHORIZED= # set to "false" to accept invalid certs
|
||||||
|
|
||||||
# Switch email features off entirely (optional)
|
# Switch email features off entirely (optional)
|
||||||
NEXT_PUBLIC_DISABLE_EMAIL=
|
NEXT_PUBLIC_DISABLE_EMAIL=
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ services:
|
|||||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
||||||
- SMTP_SECURE=${SMTP_SECURE}
|
- SMTP_SECURE=${SMTP_SECURE}
|
||||||
- EMAIL_FROM=${EMAIL_FROM}
|
- EMAIL_FROM=${EMAIL_FROM}
|
||||||
|
- SMTP_REJECT_UNAUTHORIZED=${SMTP_REJECT_UNAUTHORIZED}
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
- NOVU_API_KEY=${NOVU_API_KEY}
|
- NOVU_API_KEY=${NOVU_API_KEY}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ services:
|
|||||||
- SMTP_USER=${SMTP_USER}
|
- SMTP_USER=${SMTP_USER}
|
||||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
||||||
- EMAIL_FROM=${EMAIL_FROM}
|
- EMAIL_FROM=${EMAIL_FROM}
|
||||||
|
- SMTP_REJECT_UNAUTHORIZED=${SMTP_REJECT_UNAUTHORIZED}
|
||||||
|
|
||||||
# Disable email features entirely (optional)
|
# Disable email features entirely (optional)
|
||||||
- NEXT_PUBLIC_DISABLE_EMAIL=${NEXT_PUBLIC_DISABLE_EMAIL}
|
- NEXT_PUBLIC_DISABLE_EMAIL=${NEXT_PUBLIC_DISABLE_EMAIL}
|
||||||
|
|||||||
@@ -16,7 +16,17 @@ const emailTemplates: Record<Templates, React.FC> = {
|
|||||||
const transporter = nodemailer.createTransport({
|
const transporter = nodemailer.createTransport({
|
||||||
host: process.env.SMTP_HOST,
|
host: process.env.SMTP_HOST,
|
||||||
port: Number(process.env.SMTP_PORT),
|
port: Number(process.env.SMTP_PORT),
|
||||||
secure: process.env.SMTP_SECURE !== "false",
|
secure:
|
||||||
|
process.env.SMTP_SECURE === undefined
|
||||||
|
? true
|
||||||
|
: process.env.SMTP_SECURE?.toLowerCase() === "true",
|
||||||
|
tls: {
|
||||||
|
// do not fail on invalid certs
|
||||||
|
rejectUnauthorized:
|
||||||
|
process.env.SMTP_REJECT_UNAUTHORIZED === undefined
|
||||||
|
? true
|
||||||
|
: process.env.SMTP_REJECT_UNAUTHORIZED?.toLowerCase() === "true",
|
||||||
|
},
|
||||||
...(process.env.SMTP_USER &&
|
...(process.env.SMTP_USER &&
|
||||||
process.env.SMTP_PASSWORD && {
|
process.env.SMTP_PASSWORD && {
|
||||||
auth: {
|
auth: {
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
"SMTP_USER",
|
"SMTP_USER",
|
||||||
"SMTP_PASSWORD",
|
"SMTP_PASSWORD",
|
||||||
"SMTP_SECURE",
|
"SMTP_SECURE",
|
||||||
|
"SMTP_REJECT_UNAUTHORIZED",
|
||||||
"NEXT_PUBLIC_KAN_ENV",
|
"NEXT_PUBLIC_KAN_ENV",
|
||||||
"NEXT_PUBLIC_WHITE_LABEL_HIDE_POWERED_BY",
|
"NEXT_PUBLIC_WHITE_LABEL_HIDE_POWERED_BY",
|
||||||
"STRIPE_SECRET_KEY",
|
"STRIPE_SECRET_KEY",
|
||||||
|
|||||||
Reference in New Issue
Block a user