new perms and fix email
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-26 09:31:08 +03:30
parent be6e4a8d32
commit 77783549fa
8 changed files with 265 additions and 35 deletions
+26 -20
View File
@@ -5,27 +5,33 @@ import { MailerAsyncOptions } from "@nestjs-modules/mailer/dist/interfaces/maile
export function mailerConfig(): MailerAsyncOptions {
return {
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
transport: {
host: configService.getOrThrow<string>("SMTP_HOST"),
port: configService.getOrThrow<number>("SMTP_PORT"),
secure: true,
auth: {
user: configService.getOrThrow<string>("SMTP_USER"),
pass: configService.getOrThrow<string>("SMTP_PASS"),
},
},
defaults: {
from: configService.getOrThrow<string>("MAIL_FROM"),
},
useFactory: (configService: ConfigService) => {
const port = Number(configService.getOrThrow<number>("SMTP_PORT"));
// 465 = implicit TLS; 587 = STARTTLS (required by zone-mta behind Traefik)
const secure = port === 465;
template: {
dir: process.cwd() + "/src/modules/templates/email",
adapter: new HandlebarsAdapter(),
options: {
strict: true,
return {
transport: {
host: configService.getOrThrow<string>("SMTP_HOST"),
port,
secure,
requireTLS: !secure,
auth: {
user: configService.getOrThrow<string>("SMTP_USER"),
pass: configService.getOrThrow<string>("SMTP_PASS"),
},
},
},
}),
defaults: {
from: configService.getOrThrow<string>("MAIL_FROM"),
},
template: {
dir: process.cwd() + "/src/modules/templates/email",
adapter: new HandlebarsAdapter(),
options: {
strict: true,
},
},
};
},
};
}