feat: 实现ChatGPT Codex路由器的核心功能

- 添加完整的项目基础结构,包括配置、类型定义和常量
- 实现OAuth认证流程和令牌管理
- 开发请求转换和响应处理逻辑
- 添加SSE流处理和ChatCompletions API转换
- 实现模型映射和提示指令系统
- 包含Docker部署配置和快速启动文档
- 添加自动登录功能和测试脚本
This commit is contained in:
mars
2026-01-07 10:51:54 +08:00
commit 0dd6fe2c7d
45 changed files with 8286 additions and 0 deletions

32
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,32 @@
version: '3.8'
services:
chatgpt-codex-router:
build:
context: .
dockerfile: docker/Dockerfile
container_name: chatgpt-codex-router
ports:
- "3000:3000"
- "1455:1455"
volumes:
- ./data:/app/data
- ./logs:/app/logs
- ./config.json:/app/.chatgpt-codex-router/config.json:ro
environment:
- PORT=3000
- LOG_LEVEL=info
- NODE_ENV=production
restart: unless-stopped
healthcheck:
test: ["CMD", "bun", "run", "-e", "fetch('http://localhost:3000/health').then(r => process.exit(r.ok ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
- chatgpt-router-network
networks:
chatgpt-router-network:
driver: bridge