- update translations

- add mail_from env var
- update docs for swarm deployment
This commit is contained in:
Amruth Pillai
2023-11-22 22:05:54 +01:00
parent da2f4dba60
commit 1580455b3f
59 changed files with 950 additions and 1170 deletions

View File

@ -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

View File

@ -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>" },
};
},
}),

View File

@ -19,6 +19,6 @@ export class MailService {
return Logger.log(options, "MailService#sendEmail");
}
return this.mailerService.sendMail(options);
return await this.mailerService.sendMail(options);
}
}

View File

@ -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"),

View File

@ -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" }