mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Testing mail delivery with a remote SMTP server
This commit is contained in:
parent
1ed338542c
commit
da30001ba8
@ -7,6 +7,7 @@ CLIENT_URI=http://localhost:3000
|
|||||||
MOCKS=false
|
MOCKS=false
|
||||||
SMTP_HOST=
|
SMTP_HOST=
|
||||||
SMTP_PORT=
|
SMTP_PORT=
|
||||||
|
SMTP_IGNORE_TLS=true
|
||||||
SMTP_USERNAME=
|
SMTP_USERNAME=
|
||||||
SMTP_PASSWORD=
|
SMTP_PASSWORD=
|
||||||
|
|
||||||
|
|||||||
@ -6,26 +6,29 @@ const {
|
|||||||
MAPBOX_TOKEN,
|
MAPBOX_TOKEN,
|
||||||
JWT_SECRET,
|
JWT_SECRET,
|
||||||
PRIVATE_KEY_PASSPHRASE,
|
PRIVATE_KEY_PASSPHRASE,
|
||||||
|
SMTP_IGNORE_TLS = true,
|
||||||
SMTP_HOST,
|
SMTP_HOST,
|
||||||
SMTP_PORT,
|
SMTP_PORT,
|
||||||
SMTP_USERNAME,
|
SMTP_USERNAME,
|
||||||
SMTP_PASSWORD,
|
SMTP_PASSWORD,
|
||||||
|
NEO4J_URI = 'bolt://localhost:7687',
|
||||||
|
NEO4J_USERNAME = 'neo4j',
|
||||||
|
NEO4J_PASSWORD = 'neo4j',
|
||||||
|
GRAPHQL_PORT = 4000,
|
||||||
|
CLIENT_URI = 'http://localhost:3000',
|
||||||
|
GRAPHQL_URI = 'http://localhost:4000',
|
||||||
} = process.env
|
} = process.env
|
||||||
|
|
||||||
export const requiredConfigs = { MAPBOX_TOKEN, JWT_SECRET, PRIVATE_KEY_PASSPHRASE }
|
export const requiredConfigs = { MAPBOX_TOKEN, JWT_SECRET, PRIVATE_KEY_PASSPHRASE }
|
||||||
export const smtpConfigs = { SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD }
|
export const smtpConfigs = {
|
||||||
|
SMTP_HOST,
|
||||||
export const neo4jConfigs = {
|
SMTP_PORT,
|
||||||
NEO4J_URI: process.env.NEO4J_URI || 'bolt://localhost:7687',
|
SMTP_IGNORE_TLS,
|
||||||
NEO4J_USERNAME: process.env.NEO4J_USERNAME || 'neo4j',
|
SMTP_USERNAME,
|
||||||
NEO4J_PASSWORD: process.env.NEO4J_PASSWORD || 'neo4j',
|
SMTP_PASSWORD,
|
||||||
}
|
|
||||||
|
|
||||||
export const serverConfigs = {
|
|
||||||
GRAPHQL_PORT: process.env.GRAPHQL_PORT || 4000,
|
|
||||||
CLIENT_URI: process.env.CLIENT_URI || 'http://localhost:3000',
|
|
||||||
GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000',
|
|
||||||
}
|
}
|
||||||
|
export const neo4jConfigs = { NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD }
|
||||||
|
export const serverConfigs = { GRAPHQL_PORT, CLIENT_URI, GRAPHQL_URI }
|
||||||
|
|
||||||
export const developmentConfigs = {
|
export const developmentConfigs = {
|
||||||
DEBUG: process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true',
|
DEBUG: process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true',
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import nodemailer from 'nodemailer'
|
|||||||
import { resetPasswordMail, wrongAccountMail } from './passwordReset/emailTemplates'
|
import { resetPasswordMail, wrongAccountMail } from './passwordReset/emailTemplates'
|
||||||
|
|
||||||
const transporter = () => {
|
const transporter = () => {
|
||||||
const { SMTP_HOST: host, SMTP_PORT: port, SMTP_USERNAME: user, SMTP_PASSWORD: pass } = CONFIG
|
|
||||||
const configs = {
|
const configs = {
|
||||||
host,
|
host: CONFIG.SMTP_HOST,
|
||||||
port,
|
port: CONFIG.SMTP_PORT,
|
||||||
ignoreTLS: true,
|
ignoreTLS: CONFIG.SMTP_IGNORE_TLS,
|
||||||
secure: false, // true for 465, false for other ports
|
secure: false, // true for 465, false for other ports
|
||||||
}
|
}
|
||||||
|
const { SMTP_USERNAME: user, SMTP_PASSWORD: pass } = CONFIG
|
||||||
if (user && pass) {
|
if (user && pass) {
|
||||||
configs.auth = { user, pass }
|
configs.auth = { user, pass }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,9 +27,9 @@ services:
|
|||||||
- uploads:/nitro-backend/public/uploads
|
- uploads:/nitro-backend/public/uploads
|
||||||
command: yarn run dev
|
command: yarn run dev
|
||||||
environment:
|
environment:
|
||||||
- SEND_MAILS=true
|
|
||||||
- SMTP_HOST=mailserver
|
- SMTP_HOST=mailserver
|
||||||
- SMTP_PORT=25
|
- SMTP_PORT=25
|
||||||
|
- SMTP_IGNORE_TLS=true
|
||||||
neo4j:
|
neo4j:
|
||||||
environment:
|
environment:
|
||||||
- NEO4J_AUTH=none
|
- NEO4J_AUTH=none
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user