mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
right before packages, env, db, and auth refactor
removing env validation, moving db and auth to each app
This commit is contained in:
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const toolsEnvSchema = z.object({
|
||||
// Node
|
||||
NODE_ENV: z.enum(["development", "production", "test"]),
|
||||
ANALYZE: z.string().optional(),
|
||||
NEXT_RUNTIME: z.enum(["nodejs", "edge"]).optional(),
|
||||
|
||||
// Public
|
||||
NEXT_PUBLIC_SITE_URL: z.url().default("http://localhost:3000"),
|
||||
NEXT_PUBLIC_MARBLE_API_URL: z.url(),
|
||||
|
||||
// Server
|
||||
DATABASE_URL: z
|
||||
.string()
|
||||
.startsWith("postgres://")
|
||||
.or(z.string().startsWith("postgresql://")),
|
||||
|
||||
BETTER_AUTH_SECRET: z.string(),
|
||||
UPSTASH_REDIS_REST_URL: z.url(),
|
||||
UPSTASH_REDIS_REST_TOKEN: z.string(),
|
||||
CLOUDFLARE_ACCOUNT_ID: z.string(),
|
||||
R2_ACCESS_KEY_ID: z.string(),
|
||||
R2_SECRET_ACCESS_KEY: z.string(),
|
||||
R2_BUCKET_NAME: z.string(),
|
||||
});
|
||||
|
||||
export type ToolsEnv = z.infer<typeof toolsEnvSchema>;
|
||||
|
||||
export const toolsEnv = toolsEnvSchema.parse(process.env);
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const envSchema = z.object({
|
||||
const webEnvSchema = z.object({
|
||||
// Node
|
||||
NODE_ENV: z.enum(["development", "production", "test"]),
|
||||
ANALYZE: z.string().optional(),
|
||||
@@ -29,6 +29,6 @@ const envSchema = z.object({
|
||||
MODAL_TRANSCRIPTION_URL: z.url(),
|
||||
});
|
||||
|
||||
export type Env = z.infer<typeof envSchema>;
|
||||
export type WebEnv = z.infer<typeof webEnvSchema>;
|
||||
|
||||
export const env = envSchema.parse(process.env);
|
||||
export const webEnv = webEnvSchema.parse(process.env);
|
||||
Reference in New Issue
Block a user