mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 04:06:43 +02:00
Platform-Repo (Code/mana/) reserviert 3065 für mana-media; um Doppel- Belegung zu vermeiden wandert mana-events (Public-RSVP / Event-Sharing) auf 3115. Neuer Port-Block 311x ist unbenutzt und gehört strukturell neben mana-mail (3042) bzw. die anderen 30xx Service-Ports. Berührt jeden harden-coded 3065-Default — Server-Config, Webapp-Config, SSR-Routes (rsvp/[token], status), Playwright-Webserver-Setup, e2e-Spec. PUBLIC_MANA_EVENTS_URL in .env.development zieht beide Variablen mit. PORT_SCHEMA.md trägt jetzt den Wechsel mit Datum + Begründung — zukünftiges Ich soll nicht raten warum der Port aus der 30xx-Reihe ausschert. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
/**
|
|
* Application configuration loaded from environment variables.
|
|
*/
|
|
|
|
export interface Config {
|
|
port: number;
|
|
databaseUrl: string;
|
|
manaAuthUrl: string;
|
|
cors: {
|
|
origins: string[];
|
|
};
|
|
rateLimit: {
|
|
// Max public RSVP submissions per token per hour
|
|
rsvpPerTokenPerHour: number;
|
|
// Hard cap on total RSVPs per token
|
|
rsvpMaxPerToken: number;
|
|
};
|
|
// External service URLs for event discovery
|
|
manaResearchUrl: string;
|
|
manaLlmUrl: string;
|
|
// Platform API key (optional — provider gracefully skips when unconfigured)
|
|
meetupApiKey: string | null;
|
|
}
|
|
|
|
export function loadConfig(): Config {
|
|
const requiredEnv = (key: string, fallback?: string): string => {
|
|
const value = process.env[key] || fallback;
|
|
if (!value) throw new Error(`Missing required env var: ${key}`);
|
|
return value;
|
|
};
|
|
|
|
return {
|
|
port: parseInt(process.env.PORT || '3115', 10),
|
|
databaseUrl: requiredEnv(
|
|
'DATABASE_URL',
|
|
'postgresql://mana:devpassword@localhost:5432/mana_platform'
|
|
),
|
|
manaAuthUrl: requiredEnv('MANA_AUTH_URL', 'http://localhost:3001'),
|
|
cors: {
|
|
origins: (process.env.CORS_ORIGINS || 'http://localhost:5173').split(','),
|
|
},
|
|
rateLimit: {
|
|
rsvpPerTokenPerHour: parseInt(process.env.RSVP_RATE_LIMIT || '60', 10),
|
|
rsvpMaxPerToken: parseInt(process.env.RSVP_MAX_PER_TOKEN || '500', 10),
|
|
},
|
|
manaResearchUrl: process.env.MANA_RESEARCH_URL || 'http://localhost:3068',
|
|
manaLlmUrl: process.env.MANA_LLM_URL || 'http://localhost:3025',
|
|
meetupApiKey: process.env.MEETUP_API_KEY || null,
|
|
};
|
|
}
|