-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.ts
41 lines (36 loc) · 936 Bytes
/
env.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import path from "node:path";
import dotenv from "@dotenvx/dotenvx";
import * as v from "valibot";
dotenv.config();
const Env = v.looseObject({
ARCHIVES_DATABASE_URL: v.pipe(
v.string(),
v.url(),
v.regex(/^postgresql:\/\/.*?sslmode=disable$/),
),
DOCUMENTS_DATABASE_URL: v.pipe(
v.string(),
v.url(),
v.regex(/^postgresql:\/\/.*?sslmode=disable$/),
),
MEDIA_DATABASE_URL: v.pipe(
v.string(),
v.url(),
v.regex(/^postgresql:\/\/.*?sslmode=disable$/),
),
TGOV_DATABASE_URL: v.pipe(
v.string(),
v.url(),
v.regex(/^postgresql:\/\/.*?sslmode=disable$/),
),
TRANSCRIPTION_DATABASE_URL: v.pipe(
v.string(),
v.url(),
v.regex(/^postgresql:\/\/.*?sslmode=disable$/),
),
CHROMIUM_PATH: v.optional(v.string()),
OPENAI_API_KEY: v.string(),
TMP_DIR: v.optional(v.string(), "." + path.sep + "tmp"),
});
const env = v.parse(Env, process.env);
export default env;