mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-19 08:28:10 +02:00
fix: use config for turn
This commit is contained in:
parent
17409998d2
commit
4ddb144dd0
4 changed files with 846 additions and 769 deletions
22
ui/src/app/api/config/turn/route.ts
Normal file
22
ui/src/app/api/config/turn/route.ts
Normal 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,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue