Moved mail env vars to single uri var

This commit is contained in:
Keith Irwin 2023-05-01 13:44:49 -06:00
parent c3058c44ba
commit d8c9063ac5
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
3 changed files with 4 additions and 21 deletions

View File

@ -13,8 +13,7 @@ SALES_EMAIL="sales@example.com"
CONTACT_EMAIL="contact@example.com"
# Mailserver
MAIL_SERVER="example.com"
MAIL_PORT="25"
MAIL_URI="smtps://username:password@example.com:587"
CONTACT_MAIL_FROM="Company Contact <noreply@example.com>"
SALES_MAIL_FROM="Company Sales <noreply@example.com>"
BUGS_MAIL_FROM="Company Bug Reports <noreply@example.com>"

View File

@ -43,13 +43,10 @@ services:
- API_PORT=${API_PORT}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- SALES_EMAIL=${SALES_EMAIL}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_URI=${MAIL_URI}
- CONTACT_MAIL_FROM=${CONTACT_MAIL_FROM}
- SALES_MAIL_FROM=${SALES_MAIL_FROM}
- BUGS_MAIL_FROM=${BUGS_MAIL_FROM}
- MAIL_USER=${MAIL_USER}
- MAIL_PASS=${MAIL_PASS}
- MONEROPAY_URL=${MONEROPAY_URL}
volumes:
- "/etc/timezone:/etc/timezone:ro"
@ -71,10 +68,7 @@ services:
- STRIPE_SEC=${STRIPE_SEC}
- STRIPE_LISTENER_PORT=${STRIPE_LISTENER_PORT}
- SALES_EMAIL=${SALES_EMAIL}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USER=${MAIL_USER}
- MAIL_PASS=${MAIL_PASS}
- MAIL_URI=${MAIL_URI}
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "./_src:/app/_src"

View File

@ -1,14 +1,4 @@
'use strict'
require('dotenv').config()
module.exports = require('nodemailer').createTransport({
host: process.env.MAIL_SERVER,
port: process.env.MAIL_PORT,
auth: {
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASS,
},
tls: {
rejectUnauthorized: false,
},
})
module.exports = require('nodemailer').createTransport(process.env.MAIL_URI)