fix smtp settings

This commit is contained in:
lesion 2022-05-09 20:45:54 +02:00
parent 1a5be46cc6
commit 3d7b0100ff
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 1265 additions and 4 deletions

1262
assets/gancio-events.es.js Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,6 @@ const crypto = require('crypto')
const { promisify } = require('util')
const sharp = require('sharp')
const config = require('../../config')
const pkg = require('../../../package.json')
const generateKeyPair = promisify(crypto.generateKeyPair)
const log = require('../../log')
const locales = require('../../../locales/index')
@ -42,7 +41,7 @@ const defaultSettings = {
{ href: '/about', label: 'about' }
],
admin_email: config.admin_email || '',
smtp: config.smtp || false
smtp: config.smtp || {}
}
/**
@ -185,7 +184,7 @@ const settingsController = {
return sharp(uploadedPath)
.resize(400)
.png({ quality: 90 })
.toFile(baseImgPath + '.png', (err, info) => {
.toFile(baseImgPath + '.png', (err) => {
if (err) {
log.error('[LOGO] ' + err)
}

View file

@ -9,7 +9,7 @@ const locales = require('../../locales')
const mail = {
send (addresses, template, locals, locale) {
locale = locale || settingsController.settings.instance_locale
if (process.env.NODE_ENV === 'production' && (!settingsController.settings.admin_email || !settingsController.settings.smtp)) {
if (process.env.NODE_ENV === 'production' && (!settingsController.settings.admin_email || !settingsController.settings.smtp || !settingsController.settings.smtp.user)) {
log.error(`Cannot send any email: SMTP Email configuration not completed!`)
return
}