From c9d98a8e8c3f7b5667c90c110ac4d931072e8d56 Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Wed, 2 Oct 2024 23:57:55 -0400 Subject: [PATCH] added smpt vars to environment --- server/environment.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/server/environment.ts b/server/environment.ts index 65c38a34..c5808645 100644 --- a/server/environment.ts +++ b/server/environment.ts @@ -21,6 +21,19 @@ const environmentSchema = z.object({ .string() .transform((val) => parseInt(val, 10)) .pipe(z.number()), + EMAIL_SMTP_HOST: z.string().optional(), + EMAIL_SMTP_PORT: z + .string() + .optional() + .transform((val) => { + if (val) { + return parseInt(val, 10); + } + return val; + }) + .pipe(z.number().optional()), + EMAIL_SMTP_USER: z.string().optional(), + EMAIL_SMTP_PASS: z.string().optional(), }); const environment = { @@ -32,6 +45,10 @@ const environment = { path.join("config"), EXTERNAL_PORT: (process.env.EXTERNAL_PORT as string) || "3000", INTERNAL_PORT: (process.env.INTERNAL_PORT as string) || "3001", + EMAIL_SMTP_HOST: process.env.EMAIL_SMTP_HOST as string, + EMAIL_SMTP_PORT: process.env.EMAIL_SMTP_PORT as string, + EMAIL_SMTP_USER: process.env.EMAIL_SMTP_USER as string, + EMAIL_SMTP_PASS: process.env.EMAIL_SMTP_PASS as string, }; const parsedConfig = environmentSchema.safeParse(environment);