- Replace the `config.py` module with a new `settings.py` to streamline environment variable management, focusing on database, CORS, and TURN settings. - Update references throughout the backend codebase to use the new `settings` module instead of the deprecated `config`. - Modify the `.env.example` file to reflect the new configuration approach, indicating that model provider credentials should be maintained separately. - Enhance the `AssistantConfig` model to clarify the source of runtime connection information, ensuring it is injected from model resources rather than relying on defaults from the environment. - Introduce new user scripts for audio and video management in the Tampermonkey environment, enhancing WebRTC capabilities.
21 lines
1020 B
Plaintext
21 lines
1020 B
Plaintext
# 复制为 .env 并填入真实值。
|
|
# 模型接入配置不再放在 .env;请在 model_resources 中维护 apiUrl/modelId/apiKey 等字段。
|
|
# 开发环境可先执行 `make db-seed`,再到前端「组件 / 模型」里替换真实密钥。
|
|
|
|
# ---- 数据库(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
|