-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpublic.ts
More file actions
43 lines (35 loc) · 1.7 KB
/
public.ts
File metadata and controls
43 lines (35 loc) · 1.7 KB
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
42
43
import { building } from '$app/environment';
import { env } from '$env/dynamic/public';
import { z } from 'zod';
const schema = z.object({
PUBLIC_VERSION: z.optional(z.string()),
PUBLIC_SHA: z.optional(z.string()),
PUBLIC_OIDC_AUTHORITY: z.string(),
PUBLIC_OIDC_CLIENT_ID: z.string(),
PUBLIC_DEFAULT_LOCALE: z.string().default('de'),
PUBLIC_OIDC_ACCOUNT_URL: z.preprocess(
(v) => (v === '' ? undefined : v),
z.string().url().optional()
),
PUBLIC_FEEDBACK_URL: z.optional(z.string()),
PUBLIC_GLOBAL_USER_NOTES_ACTIVE: z.coerce.boolean().default(false),
PUBLIC_MAX_APPLICATION_TEXT_LENGTH: z.coerce.number().default(1200),
PUBLIC_MAX_APPLICATION_SCHOOL_LENGTH: z.coerce.number().default(100),
PUBLIC_MAINTENANCE_WINDOW_START: z.iso.datetime({ offset: true }).optional(),
PUBLIC_MAINTENANCE_WINDOW_END: z.iso.datetime({ offset: true }).optional(),
// Sentry/Bugsink error tracking
PUBLIC_SENTRY_DSN: z.preprocess((v) => (v === '' ? undefined : v), z.string().url().optional()),
PUBLIC_SENTRY_SEND_DEFAULT_PII: z.stringbool().optional(),
// Badge generator URL (optional)
PUBLIC_BADGE_GENERATOR_URL: z.preprocess(
(v) => (v === '' ? undefined : v),
z.string().url().optional()
),
// Documentation URL (optional) - global link to DELEGATOR app documentation
PUBLIC_DOCS_URL: z.preprocess((v) => (v === '' ? undefined : v), z.string().url().optional()),
// Support email for error pages and help requests
PUBLIC_SUPPORT_EMAIL: z.string().email().default('support@dmun.de'),
// Team organization domain (optional) - warn when inviting emails from other domains
PUBLIC_TEAM_ORGANIZATION_DOMAIN: z.string().optional()
});
export const configPublic = building ? ({} as z.infer<typeof schema>) : schema.parse(env);