fix: use config for turn

This commit is contained in:
Abhishek Kumar 2025-12-22 14:06:17 +05:30
parent 17409998d2
commit 4ddb144dd0
4 changed files with 846 additions and 769 deletions

View file

@ -0,0 +1,22 @@
/*
Route to provide TURN server configuration at runtime.
This allows OSS users to configure TURN servers via docker-compose.yaml
environment variables, since NEXT_PUBLIC_* keys are injected at build time.
*/
import { NextResponse } from 'next/server';
export async function GET() {
const host = process.env.TURN_HOST || '';
const username = process.env.TURN_USERNAME || '';
const password = process.env.TURN_PASSWORD || '';
// Only return enabled: true if all required fields are set
const enabled = !!(host && username && password);
return NextResponse.json({
enabled,
host,
username,
password,
});
}