Commit Graph

543 Commits

Author SHA1 Message Date
千羽
8a74bf5afe refactor: standardize code formatting and linting configuration
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 18:19:31 +09:00
github-actions[bot]
4a0eba117c chore: sync VERSION file with release v1.1.91 [skip ci] 2025-08-07 04:38:47 +00:00
Wesley Liddick
6626d1d32a Merge pull request #208 from kevinconan/main
fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值
2025-08-07 12:38:36 +08:00
Wesley Liddick
097f8d8d38 Merge pull request #206 from AndersonBY/main[skip ci]
fix: Update Claude console User Agent and fix bedrock encryption
2025-08-07 12:38:16 +08:00
KevinLiao
ae7f4e2405 fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值 2025-08-07 12:33:32 +08:00
andersonby
7ea899bd30 feat: add model name normalization for statistics aggregation in Redis and admin routes 2025-08-07 01:35:01 +08:00
andersonby
622c4047e9 fix: update account retrieval logic in BedrockAccountService to handle missing accounts and re-encrypt AWS credentials 2025-08-07 01:10:30 +08:00
andersonby
3dc0b7ff4f fix: improve decryption logic in BedrockAccountService to handle both encrypted and plaintext AWS credentials 2025-08-07 01:02:26 +08:00
andersonby
e553734e42 chore: update user agent version to 1.0.69 in claudeConsoleAccountService and claudeConsoleRelayService 2025-08-07 00:53:14 +08:00
github-actions[bot]
ec0e7671ae chore: sync VERSION file with release v1.1.90 [skip ci] 2025-08-06 16:43:40 +00:00
shaw
e57b98f343 fix: 修复 API Key 创建和编辑时账户绑定冲突问题
- 创建 API Key 时确保 OAuth 和 Console 账户不会同时设置
- 编辑 API Key 时正确清空未使用的账户类型字段
- 使用共享池时清空所有账户绑定

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 00:43:09 +08:00
github-actions[bot]
d6e472e849 chore: sync VERSION file with release v1.1.89 [skip ci] 2025-08-06 15:22:10 +00:00
Wesley Liddick
4bee81fb77 Merge pull request #204 from shinegod/feature/claude-code-client-support
feat: 全面增强 Claude Code 客户端支持与错误处理
2025-08-06 23:21:51 +08:00
Wesley Liddick
f63708cda4 Merge branch 'main' into feature/claude-code-client-support 2025-08-06 23:20:33 +08:00
shinegod
3616245d49 feat: 全面增强 Claude Code 客户端支持与错误处理
## 🚀 新功能
- **智能认证系统**: 根据 API Key 格式自动选择认证方式
  - `sk-ant-*` 开头使用 `x-api-key` 认证(兼容 Anthropic 官方)
  - 其他格式使用 `Authorization: Bearer` 认证(兼容标准 REST API)
- **Claude Code 客户端完整支持**: 新增必需的 API 端点
  - `GET /v1/models` - 返回支持的模型列表
  - `GET /v1/me` - 用户信息端点
  - `GET /v1/organizations/:org_id/usage` - 使用统计查询

## 🔧 修复与优化
- **HTTP 协议合规性**: 修复响应头冲突导致的 502 错误
  - 避免同时发送 `Content-Length` 和 `Transfer-Encoding` 头部
  - 优化响应头过滤机制,确保代理兼容性
- **完全透传错误响应**: 保持上游 API 原始响应格式
  - 透传原始状态码、响应头和内容
  - 移除错误包装,直接转发原始 JSON 格式
  - 支持流式和非流式请求的错误透传
- **流式响应处理优化**:
  - 添加 `validateStatus: () => true` 配置
  - 改进错误处理逻辑,避免异常中断

## 📝 代码质量
- 修复 ESLint 代码规范警告
- 优化敏感头部过滤列表
- 改进调试日志输出

## 🎯 解决的问题
- Claude Code 客户端无法连接(502 Bad Gateway)
- 错误响应被包装而非透传原始格式
- sk-ant-* 格式 API Key 认证失败
- HTTP/2 代理环境下的响应头冲突

##  测试验证
- 本地测试完全透传上游错误响应
- Claude Code 客户端连接测试通过
- 智能认证机制验证成功
- HTTP 协议合规性确认
2025-08-06 14:27:57 +00:00
github-actions[bot]
ffa8b49e9e chore: sync VERSION file with release v1.1.88 [skip ci] 2025-08-06 13:58:29 +00:00
Wesley Liddick
f2474d1b2e Merge pull request #203 from AndersonBY/main
Add AWS bedrock support
2025-08-06 21:58:10 +08:00
andersonby
d8f949fb47 fix: update Bedrock model format check to use includes method for better accuracy 2025-08-06 21:44:03 +08:00
andersonby
79951920ea fix: update placeholder text in AccountForm.vue to correct model name from hiku to haiku 2025-08-06 20:40:59 +08:00
andersonby
9f5db37114 fix: update default model in config.example.js to the latest version 2025-08-06 20:39:54 +08:00
andersonby
5883a60fba Merge upstream changes and resolve conflicts
- Merged latest changes from Wei-Shaw/claude-relay-service
- Resolved conflict in AccountForm.vue to support both Bedrock and improved platform switching logic
- Maintained Bedrock integration while incorporating Gemini pricing improvements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 19:26:31 +08:00
andersonby
657b7b0a05 feat: Add test scripts for Bedrock models and model mapping functionality 2025-08-06 19:23:36 +08:00
github-actions[bot]
829a06f966 chore: sync VERSION file with release v1.1.87 [skip ci] 2025-08-06 10:10:11 +00:00
shaw
b1ea32caba feat: 添加Gemini定价功能和界面优化
- 实现Gemini定价查询服务,支持实时计算token成本
- 改进API Key管理界面,添加模型快速选择功能
- 优化账户表单组件的渲染性能
- 更新Gemini账户服务,增强token刷新和错误处理

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 18:09:43 +08:00
andersonby
9a9a82c86f feat: Add comprehensive Amazon Bedrock integration support
Add complete Amazon Bedrock integration to Claude Relay Service with:

## Core Features
-  Bedrock account management with encrypted AWS credential storage
-  Full request routing to AWS Bedrock with streaming support
-  Integration with unified Claude scheduler system
-  Support for Inference Profiles and Application Inference Profiles
-  Configurable default and small-fast model settings

## Backend Services
- Add bedrockAccountService.js for account management
- Add bedrockRelayService.js for request forwarding
- Integrate Bedrock accounts into unifiedClaudeScheduler.js
- Update admin and API routes to support Bedrock endpoints
- Add comprehensive configuration options to config.example.js

## Frontend Integration
- Complete Vue.js Web UI for Bedrock account management
- Account creation form with AWS credentials and model configuration
- Real-time account status monitoring and statistics
- Edit/update capabilities for existing accounts

## CLI Support
- Interactive CLI commands for Bedrock account operations
- Account creation, listing, updating, and testing
- Status monitoring and connection validation

## Security & Performance
- AES encrypted storage of AWS credentials in Redis
- Support for temporary credentials (session tokens)
- Region-specific configuration support
- Rate limiting and error handling

This integration enables the relay service to support three AI platforms:
1. Claude (OAuth) - Original Claude.ai integration
2. Gemini - Google AI integration
3. Amazon Bedrock - New AWS Bedrock integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 17:41:16 +08:00
github-actions[bot]
d6ba97381d chore: sync VERSION file with release v1.1.86 [skip ci] 2025-08-06 07:34:59 +00:00
Wesley Liddick
79e1955585 Merge pull request #199 from mouyong/dev-local
fix: 修复无法转发 opus 4.1 的问题
2025-08-06 15:34:46 +08:00
mouyong
80c6bed8c2 fix: 修复无法转发 opus 4.1 的问题 2025-08-06 15:26:49 +08:00
github-actions[bot]
a15a6e982e chore: sync VERSION file with release v1.1.85 [skip ci] 2025-08-06 06:19:22 +00:00
shaw
c972ea485d fix: manage.sh在centos上异常的问题 2025-08-06 14:18:56 +08:00
github-actions[bot]
663d2eb8f1 chore: sync VERSION file with release v1.1.84 [skip ci] 2025-08-06 05:50:58 +00:00
shaw
0c1eb3eae2 fix: 修复多个部署和管理脚本问题
- 修复workflow中web-dist分支推送node_modules的问题
  - 添加.gitignore文件排除node_modules
  - 使用git add --all -- ':\!node_modules'命令排除node_modules目录

- 修复scripts/manage.sh脚本问题
  - 移除软链创建时的覆盖询问,默认使用代码中的最新版本
  - 安装时自动给scripts/manage.sh添加执行权限
  - 创建软链时确保目标脚本有执行权限

- 修复CentOS 9系统上服务启动失败的问题
  - 改进systemd服务配置,添加环境变量和日志目录创建
  - 添加systemctl daemon-reload确保配置生效
  - 增加启动状态检查和失败时的npm回退机制

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 13:50:30 +08:00
github-actions[bot]
80bb56a218 chore: sync VERSION file with release v1.1.83 [skip ci] 2025-08-06 02:30:15 +00:00
Wesley Liddick
e9844c4a86 Merge pull request #191 from JinFanZheng/feature/api-key-quick-add-models
feat: add quick add buttons for model restrictions in API Key editor
2025-08-06 10:30:00 +08:00
Wesley Liddick
b3d8d699cc Merge pull request #192 from Kaliscuit/main [skip ci]
fix: change password 404 error
2025-08-06 10:29:35 +08:00
github-actions[bot]
451f760d3d chore: sync VERSION file with release v1.1.82 [skip ci] 2025-08-06 02:27:28 +00:00
shaw
616079b16b fix: 修复 web-dist 分支 README 文件日期变量替换问题
- 移除 heredoc 的单引号,允许变量和命令替换
- 确保 Build Date 能正确显示实际构建时间
- 同时修复了 workflow 和测试脚本中的相同问题

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 10:27:05 +08:00
github-actions[bot]
c8c5a7abb1 chore: sync VERSION file with release v1.1.81 [skip ci] 2025-08-06 02:24:26 +00:00
shaw
1a423d3afd feat: 优化前端构建分发和模型价格更新机制
1. 前端构建分发优化:
   - 修改 GitHub Actions workflow,构建前端后推送到 web-dist 分支
   - 更新 manage.sh 安装脚本,从 web-dist 分支获取预构建文件
   - 解决部分机器无法本地编译前端的问题
   - 添加测试脚本 test-web-dist.sh 验证流程

2. 模型价格更新功能:
   - 添加手动更新模型价格脚本 update-model-pricing.js
   - 新增 npm run update:pricing 命令
   - 在 manage.sh 添加 update-pricing 命令和菜单选项
   - 支持备份、进度显示和统计信息

3. 其他改进:
   - 优化安装流程,减少对 Node.js 环境的依赖
   - 提供多种更新模型价格的方式
   - 改进错误处理和回退机制

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 10:24:03 +08:00
Yuhan Jian
828a8e1c0d fix: change password 404 error
fix: change password 404 error
2025-08-06 10:22:03 +08:00
Van Zheng
9781a39e09 feat: add quick add buttons for model restrictions in API Key editor
- Add quick add buttons for common Claude models including claude-opus-4-1-20250805
- Implement dynamic filtering to hide models already in restriction list
- Add mobile-responsive design with proper text sizing and layout
- Show helpful message when all common models are restricted

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 09:44:26 +08:00
github-actions[bot]
63ba17e02d chore: sync VERSION file with release v1.1.80 [skip ci] 2025-08-06 00:34:42 +00:00
Wesley Liddick
dbf818252a Merge pull request #189 from JinFanZheng/main
feat: add comprehensive Makefile for project management
2025-08-06 08:34:29 +08:00
VanZheng
1e61e7a31d feat: add comprehensive Makefile for project management (#1)
* fix: 修复timeRange=7days时的数据加载和显示问题

## 修复内容

### 后端修复 (src/routes/admin.js)
- 添加 /admin/usage-costs 接口对 period=7days 的支持
- 实现7天时间范围的成本统计,汇总最近7天的daily数据
- 修复时区处理不一致导致的数据过滤错误

### 前端修复 (web/admin-spa/src/stores/dashboard.js)
- 修改 loadDashboardData() 支持动态 timeRange 参数
- 根据时间范围动态调整 usage-costs 查询参数
- 消除硬编码的 period=today 和 period=all

### 前端修复 (web/admin-spa/src/views/ApiKeysView.vue)
- 修正API Key详情统计的period计算逻辑
- 7days时间范围现在正确传递 period=daily 而非 monthly
- 确保列表数据和详情统计使用一致的时间范围

## 解决的问题
- 选择"最近7天"时数据显示不准确或缺失
- API Key详情展开时period参数错误
- 成本统计不跟随时间范围选择变化
- 时区计算不一致导致的边界问题

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add comprehensive Makefile for project management

- Add common development commands (install, setup, dev, start)
- Add frontend build commands (build-web, build-all)
- Add service management with daemon support
- Add Docker deployment commands
- Add CLI management tools shortcuts
- Add maintenance and monitoring commands
- Include Chinese descriptions for better UX

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-06 00:45:28 +08:00
github-actions[bot]
64e828c732 chore: sync VERSION file with release v1.1.79 [skip ci] 2025-08-05 13:41:37 +00:00
Wesley Liddick
fa1e76c044 Merge pull request #188 from mouyong/dev-local
fix: Claude Console转发修复透传参数
2025-08-05 21:41:27 +08:00
mouyong
3ec81aaa3c Merge branch 'main' of github.com:Wei-Shaw/claude-relay-service
* 'main' of github.com:Wei-Shaw/claude-relay-service:
  chore: sync VERSION file with release v1.1.78 [skip ci]
2025-08-05 21:37:52 +08:00
mouyong
e786ba8852 fix: 修复透传参数 2025-08-05 21:37:08 +08:00
github-actions[bot]
cadf98489f chore: sync VERSION file with release v1.1.78 [skip ci] 2025-08-05 11:43:07 +00:00
Wesley Liddick
d756269a6b Merge pull request #187 from mouyong/dev-local
fix: 修复无法获取分组账号问题
2025-08-05 19:42:55 +08:00