Files
ai-video-fullstack/backend/.env.example
Xin Wang e857828fe5 Add WebRTC TURN configuration and related enhancements
- Introduce a new `.env.example` file for environment variable setup, including `PUBLIC_IP`, `TURN_SECRET`, and `TURN_URLS` for WebRTC TURN server configuration.
- Update `docker-compose.yaml` to support TURN server deployment with necessary environment variables and commands.
- Enhance backend configuration and routes to include WebRTC ICE server settings, allowing for STUN/TURN server integration.
- Implement a new service for managing WebRTC ICE server configurations, providing credentials for TURN when configured.
- Modify frontend API to fetch ICE server configurations dynamically, improving support for cross-network voice preview.
2026-07-06 17:45:53 +08:00

43 lines
1.6 KiB
Plaintext

# 复制为 .env 并填入真实值。
# 国产栈走 OpenAI 兼容协议:每类服务给一个 base_url + api_key + 模型名即可。
# ---- LLM:DeepSeek(OpenAI 兼容,直连云端,只需 key) ----
LLM_BASE_URL=https://api.deepseek.com/v1
LLM_API_KEY=sk-your-deepseek-key
LLM_MODEL=deepseek-chat
# ---- STT:SenseVoice / FunASR ----
# 需要本地起一个 OpenAI 兼容的语音转写服务(/v1/audio/transcriptions),
# 例如用 funasr / sherpa-onnx / speaches 包一层。下面填那个服务地址。
STT_BASE_URL=http://localhost:8001/v1
STT_API_KEY=local
STT_MODEL=sensevoice
# ---- TTS:CosyVoice ----
# 同样需要本地起一个 OpenAI 兼容的 TTS 服务(/v1/audio/speech)。
TTS_BASE_URL=http://localhost:8002/v1
TTS_API_KEY=local
TTS_MODEL=cosyvoice
TTS_VOICE=中文女
# ---- Realtime 模式(可选,先不接也行) ----
REALTIME_API_KEY=
REALTIME_MODEL=gpt-realtime
# ---- 数据库(Postgres) ----
# 本地直连;docker compose 里则用 postgres:5432
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
# ---- 服务监听 & 跨域 ----
HOST=0.0.0.0
PORT=8000
# 前端开发地址,允许跨域(公网部署时加上实际前端 origin)
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
# ---- WebRTC TURN(公网跨网语音预览;本地开发留空) ----
# 与 docker compose --profile remote 的 coturn 配套。云安全组需放行 UDP 3478 与 49152-49200。
# PUBLIC_IP 填云主机公网 IP(compose 里给 coturn --external-ip 用,见项目根 .env)。
# TURN_URLS=turn:182.92.86.220:3478?transport=udp,turn:182.92.86.220:3478?transport=tcp
# TURN_SECRET=your-turn-secret
# TURN_CREDENTIAL_TTL=86400