chore: bootstrap portal application

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 20:14:31 +02:00
1 parent 90e53e7d56
commit 763098b129
20 files changed
+5703 -1

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import "server-only";
import { z } from "zod";
const serverEnvSchema = z.object({
DATABASE_URL: z.url(),
BETTER_AUTH_SECRET: z.string().min(32),
BETTER_AUTH_URL: z.url(),
IMMICH_BASE_URL: z.url(),
IMMICH_API_KEY: z.string().min(1),
SMTP_HOST: z.string().min(1),
SMTP_PORT: z.coerce.number().int().min(1).max(65_535),
SMTP_USER: z.string().min(1),
SMTP_PASSWORD: z.string().min(1),
SMTP_FROM: z.string().min(1),
LEGAL_IMPRINT_URL: z.url(),
LEGAL_PRIVACY_URL: z.url(),
LEGAL_TERMS_URL: z.url(),
});
export type ServerEnv = z.infer<typeof serverEnvSchema>;
export function parseServerEnv(input: NodeJS.ProcessEnv): ServerEnv;
export function parseServerEnv(
input: Record<string, string | undefined>,
): ServerEnv;
export function parseServerEnv(
input: NodeJS.ProcessEnv | Record<string, string | undefined>,
): ServerEnv {
return serverEnvSchema.parse(input);
}
export const env = parseServerEnv(process.env);