38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
|
|
|
|
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!`);
|
|
|
|
|
|
const patreonClientId = process.env.PATREON_CLIENT_ID!
|
|
const patreonClientSecret = process.env.PATREON_CLIENT_SECRET!
|
|
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!
|
|
|
|
export interface ServerConfig {
|
|
patreonClientId: string;
|
|
patreonClientSecret: string;
|
|
keycloakClientId: string;
|
|
keycloakClientSecret: string;
|
|
keycloakIssuer: string;
|
|
nextAuthSecret: string;
|
|
nextAuthUrl: string;
|
|
}
|
|
|
|
export const configs: ServerConfig = {
|
|
patreonClientId,
|
|
patreonClientSecret,
|
|
keycloakClientId,
|
|
keycloakClientSecret,
|
|
keycloakIssuer,
|
|
nextAuthSecret,
|
|
nextAuthUrl,
|
|
} |