mirror of
https://github.com/samanhappy/mcphub.git
synced 2026-01-01 20:28:42 -05:00
fix: rename DATABASE_URL to DB_URL for consistency across configurations (#545)
This commit is contained in:
@@ -106,7 +106,7 @@ services:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
- JWT_SECRET=${JWT_SECRET:-your-jwt-secret}
|
||||
- DATABASE_URL=postgresql://mcphub:password@postgres:5432/mcphub
|
||||
- DB_URL=postgresql://mcphub:password@postgres:5432/mcphub
|
||||
volumes:
|
||||
- ./mcp_settings.json:/app/mcp_settings.json:ro
|
||||
- ./servers.json:/app/servers.json:ro
|
||||
@@ -180,7 +180,7 @@ services:
|
||||
- PORT=3000
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-24h}
|
||||
- DATABASE_URL=postgresql://mcphub:${POSTGRES_PASSWORD}@postgres:5432/mcphub
|
||||
- DB_URL=postgresql://mcphub:${POSTGRES_PASSWORD}@postgres:5432/mcphub
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- REDIS_URL=redis://redis:6379
|
||||
volumes:
|
||||
@@ -293,7 +293,7 @@ services:
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- PORT=3000
|
||||
- DATABASE_URL=postgresql://mcphub:password@postgres:5432/mcphub
|
||||
- DB_URL=postgresql://mcphub:password@postgres:5432/mcphub
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/node_modules
|
||||
|
||||
@@ -290,7 +290,7 @@ MCPHub 支持使用 `${VAR_NAME}` 语法进行环境变量替换:
|
||||
"command": "python",
|
||||
"args": ["-m", "db_server"],
|
||||
"env": {
|
||||
"DB_URL": "${NODE_ENV:development == 'production' ? DATABASE_URL : DEV_DATABASE_URL}"
|
||||
"DB_URL": "${NODE_ENV:development == 'production' ? DB_URL : DEV_DB_URL}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ PORT=3000
|
||||
NODE_ENV=development
|
||||
|
||||
# 数据库配置
|
||||
DATABASE_URL=postgresql://username:password@localhost:5432/mcphub
|
||||
DB_URL=postgresql://username:password@localhost:5432/mcphub
|
||||
|
||||
# JWT 配置
|
||||
JWT_SECRET=your-secret-key
|
||||
|
||||
@@ -480,7 +480,7 @@ docker run -d \
|
||||
--name mcphub \
|
||||
-p 3000:3000 \
|
||||
-e NODE_ENV=production \
|
||||
-e DATABASE_URL=postgresql://user:pass@host:5432/mcphub \
|
||||
-e DB_URL=postgresql://user:pass@host:5432/mcphub \
|
||||
-e JWT_SECRET=your-secret-key \
|
||||
mcphub/server:latest
|
||||
|
||||
@@ -504,7 +504,7 @@ docker run -d \
|
||||
--name mcphub \
|
||||
-p 3000:3000 \
|
||||
-e NODE_ENV=production \
|
||||
-e DATABASE_URL=postgresql://user:pass@host:5432/mcphub \
|
||||
-e DB_URL=postgresql://user:pass@host:5432/mcphub \
|
||||
-e JWT_SECRET=your-secret-key \
|
||||
mcphub/server:latest
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ services:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=postgresql://user:pass@db:5432/mcphub
|
||||
- DB_URL=postgresql://user:pass@db:5432/mcphub
|
||||
```
|
||||
````
|
||||
|
||||
@@ -172,7 +172,7 @@ services:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=postgresql://user:pass@db:5432/mcphub
|
||||
- DB_URL=postgresql://user:pass@db:5432/mcphub
|
||||
```
|
||||
|
||||
### 终端命令
|
||||
|
||||
@@ -245,11 +245,11 @@ curl -X POST http://localhost:3000/api/smart-routing/feedback \
|
||||
|
||||
**解决方案:**
|
||||
1. 验证 PostgreSQL 是否正在运行
|
||||
2. 检查 DATABASE_URL 格式
|
||||
2. 检查 DB_URL 格式
|
||||
3. 确保安装了 pgvector 扩展
|
||||
4. 手动测试连接:
|
||||
```bash
|
||||
psql $DATABASE_URL -c "SELECT 1;"
|
||||
psql $DB_URL -c "SELECT 1;"
|
||||
```
|
||||
|
||||
</Accordion>
|
||||
|
||||
@@ -420,7 +420,7 @@ description: '各种平台的详细安装说明'
|
||||
|
||||
```bash
|
||||
# 数据库连接
|
||||
DATABASE_URL=postgresql://mcphub:your_password@localhost:5432/mcphub
|
||||
DB_URL=postgresql://mcphub:your_password@localhost:5432/mcphub
|
||||
|
||||
# 用于嵌入的 OpenAI API
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
@@ -538,10 +538,10 @@ curl -X POST http://localhost:3000/mcp \
|
||||
**数据库连接失败:**
|
||||
```bash
|
||||
# 测试数据库连接
|
||||
psql $DATABASE_URL -c "SELECT 1;"
|
||||
psql $DB_URL -c "SELECT 1;"
|
||||
|
||||
# 检查是否安装了 pgvector
|
||||
psql $DATABASE_URL -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||
psql $DB_URL -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||
```
|
||||
|
||||
**嵌入服务错误:**
|
||||
|
||||
Reference in New Issue
Block a user