fix: use runtime legal page URLs
This commit is contained in:
1 parent
86dfe8053d
commit
60ef5ddab9
6 files changed
+41
-14
No files matched your search
@@ -7,4 +7,27 @@ describe("parseServerEnv", () => {
|
||||
/IMMICH_API_KEY/,
|
||||
);
|
||||
});
|
||||
|
||||
test("uses the production legal pages when no overrides are configured", () => {
|
||||
const parsed = parseServerEnv({
|
||||
DATABASE_URL: "postgres://portal:secret@portal-db:5432/portal",
|
||||
BETTER_AUTH_SECRET: "test-secret-at-least-thirty-two-characters",
|
||||
BETTER_AUTH_URL: "https://redaktionen.leon-tonhaeuser.de",
|
||||
IMMICH_BASE_URL: "http://immich-server:2283",
|
||||
IMMICH_API_KEY: "test-immich-key",
|
||||
SMTP_HOST: "smtp.example.com",
|
||||
SMTP_PORT: "587",
|
||||
SMTP_USER: "portal@example.com",
|
||||
SMTP_PASSWORD: "test-smtp-password",
|
||||
SMTP_FROM: "portal@example.com",
|
||||
});
|
||||
|
||||
expect(parsed.LEGAL_IMPRINT_URL).toBe(
|
||||
"https://leon-tonhaeuser.de/impressum",
|
||||
);
|
||||
expect(parsed.LEGAL_PRIVACY_URL).toBe(
|
||||
"https://leon-tonhaeuser.de/datenschutz",
|
||||
);
|
||||
expect(parsed.LEGAL_TERMS_URL).toBe("https://leon-tonhaeuser.de/agb");
|
||||
});
|
||||
});
|
||||
+7
-3
@@ -13,9 +13,13 @@ const serverEnvSchema = z.object({
|
||||
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(),
|
||||
LEGAL_IMPRINT_URL: z
|
||||
.url()
|
||||
.default("https://leon-tonhaeuser.de/impressum"),
|
||||
LEGAL_PRIVACY_URL: z
|
||||
.url()
|
||||
.default("https://leon-tonhaeuser.de/datenschutz"),
|
||||
LEGAL_TERMS_URL: z.url().default("https://leon-tonhaeuser.de/agb"),
|
||||
});
|
||||
|
||||
export type ServerEnv = z.infer<typeof serverEnvSchema>;
|
||||
|
||||
Reference in new issue
Block a user