mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
- update translations
- add mail_from env var - update docs for swarm deployment
This commit is contained in:
@ -25,6 +25,7 @@ export const configSchema = z.object({
|
||||
CHROME_URL: z.string().url(),
|
||||
|
||||
// Mail Server
|
||||
MAIL_FROM: z.string().includes("@").default("noreply@localhost"),
|
||||
SMTP_URL: z.string().url().startsWith("smtp://").optional(),
|
||||
|
||||
// Storage
|
||||
|
||||
@ -14,6 +14,7 @@ const emptyTransporter = nodemailer.createTransport({});
|
||||
MailerModule.forRootAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService<Config>) => {
|
||||
const from = configService.get("MAIL_FROM");
|
||||
const smtpUrl = configService.get("SMTP_URL");
|
||||
|
||||
if (!smtpUrl) {
|
||||
@ -24,8 +25,8 @@ const emptyTransporter = nodemailer.createTransport({});
|
||||
}
|
||||
|
||||
return {
|
||||
defaults: { from },
|
||||
transport: smtpUrl || emptyTransporter,
|
||||
defaults: { from: "Reactive Resume <noreply@rxresu.me>" },
|
||||
};
|
||||
},
|
||||
}),
|
||||
|
||||
@ -19,6 +19,6 @@ export class MailService {
|
||||
return Logger.log(options, "MailService#sendEmail");
|
||||
}
|
||||
|
||||
return this.mailerService.sendMail(options);
|
||||
return await this.mailerService.sendMail(options);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ import { StorageService } from "./storage.service";
|
||||
MinioModule.registerAsync({
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService<Config>) => ({
|
||||
useSSL: false,
|
||||
endPoint: configService.getOrThrow<string>("STORAGE_ENDPOINT"),
|
||||
port: configService.getOrThrow<number>("STORAGE_PORT"),
|
||||
region: configService.get<string>("STORAGE_REGION"),
|
||||
|
||||
@ -102,7 +102,7 @@ export class StorageService implements OnModuleInit {
|
||||
const extension = type === "resumes" ? "pdf" : "jpg";
|
||||
const storageUrl = this.configService.get<string>("STORAGE_URL");
|
||||
const filepath = `${userId}/${type}/${filename}.${extension}`;
|
||||
const url = `${storageUrl}/${this.bucketName}/${filepath}`;
|
||||
const url = `${storageUrl}/${filepath}`;
|
||||
const metadata =
|
||||
extension === "jpg"
|
||||
? { "Content-Type": "image/jpeg" }
|
||||
|
||||
Reference in New Issue
Block a user