Add env to set smtp

This commit is contained in:
Kuba Orlik 2026-08-14 16:13:46 +02:00
parent 2ae6bef083
commit 4210e52e7e
2 changed files with 22 additions and 1 deletions

View File

@ -16,6 +16,10 @@ import {
MONGO_PORT,
MONGO_USERNAME,
PORT,
SMTP_HOST,
SMTP_LOGIN,
SMTP_PASSWORD,
SMTP_PORT,
} from "./config.js";
import ADMIN_CREDENTIALS from "./default-admin-credentials.js";
import { TheFileManager } from "./file-manager.js";
@ -94,6 +98,16 @@ export default class TheApp extends App {
user: "any",
password: "any",
})
: MAILER === "SMTP"
? new SMTPMailer(
{
host: SMTP_HOST,
port: SMTP_PORT,
user: SMTP_LOGIN,
password: SMTP_PASSWORD,
},
{ secure: false, requireTLS: true }
)
: new LoggerMailer();
async start() {

View File

@ -49,3 +49,10 @@ export const UPLOADS_FS_DIR =
export const MEILISEARCH_MASTER_KEY = process.env.MEILISEARCH_MASTER_KEY || "qwerty";
export const MEILISEARCH_HOST = process.env.MEILISEARCH_HOST || "http://localhost:1098";
export const SCAN_A11Y = false;
export const SMTP_HOST = process.env.SEALIOUS_SMTP_HOST || MAILCATCHER_HOST;
export const SMTP_PORT = parseInt(
process.env.SEALIOUS_SMTP_PORT || MAILCATCHER_SMTP_PORT.toString()
);
export const SMTP_LOGIN = process.env.SEALIOUS_SMTP_LOGIN || "";
export const SMTP_PASSWORD = process.env.SEALIOUS_SMTP_PASSWORD || "";