fp/services/next/app/config/configs.ts

38 lines
1.4 KiB
TypeScript
Raw Normal View History

2024-11-05 19:48:21 +00:00
2024-12-12 07:23:46 +00:00
if (!process.env.PATREON_CLIENT_ID) throw new Error("PATREON_CLIENT_ID was missing from env");
if (!process.env.PATREON_CLIENT_SECRET) throw new Error('Missing PATREON_CLIENT_SECRET env var');
if (!process.env.KEYCLOAK_CLIENT_ID) throw new Error(`KEYCLOAK_CLIENT_ID missing in env!`);
if (!process.env.KEYCLOAK_CLIENT_SECRET) throw new Error(`KEYCLOAK_CLIENT_SECRET missing in env!`);
if (!process.env.KEYCLOAK_ISSUER) throw new Error(`KEYCLOAK_ISSUER missing in env!`);
if (!process.env.NEXTAUTH_SECRET) throw new Error(`NEXTAUTH_SECRET missing in env!`);
if (!process.env.NEXTAUTH_URL) throw new Error(`NEXTAUTH_URL missing in env!`);
2024-11-05 19:48:21 +00:00
const patreonClientId = process.env.PATREON_CLIENT_ID!
const patreonClientSecret = process.env.PATREON_CLIENT_SECRET!
2024-12-12 07:23:46 +00:00
const keycloakClientId = process.env.KEYCLOAK_CLIENT_ID!
const keycloakClientSecret = process.env.KEYCLOAK_CLIENT_SECRET!
const keycloakIssuer = process.env.KEYCLOAK_ISSUER!
const nextAuthSecret = process.env.NEXTAUTH_SECRET!
const nextAuthUrl = process.env.NEXTAUTH_URL!
2024-11-05 19:48:21 +00:00
2024-12-12 07:23:46 +00:00
export interface ServerConfig {
2024-11-05 19:48:21 +00:00
patreonClientId: string;
patreonClientSecret: string;
2024-12-12 07:23:46 +00:00
keycloakClientId: string;
keycloakClientSecret: string;
keycloakIssuer: string;
nextAuthSecret: string;
nextAuthUrl: string;
2024-11-05 19:48:21 +00:00
}
2024-12-12 07:23:46 +00:00
export const configs: ServerConfig = {
2024-11-05 19:48:21 +00:00
patreonClientId,
patreonClientSecret,
2024-12-12 07:23:46 +00:00
keycloakClientId,
keycloakClientSecret,
keycloakIssuer,
nextAuthSecret,
nextAuthUrl,
}