The previous null‑ish coalescing treated empty strings as a valid value, which could result in an invalid path. Switching to logical OR keeps the precedence (config > env) but now falls back to the default `claude`
- Add LOG_LEVEL configuration option to control logging verbosity
- Update UI to include LOG_LEVEL dropdown in settings
- Fix logging inconsistency between environment variables and config file
- Unify logging configuration to use config file settings
- Maintain separate logging systems for different purposes:
* Server-level logs (HTTP requests, API calls) using pino in ~/.claude-code-router/logs/
* Application-level logs (routing decisions, business logic) in ~/.claude-code-router/claude-code-router.log
- Update documentation with accurate logging system information
- Add detailed information about dual logging systems in README.md and README_zh.md
- Improve type safety and validation in ConfigProvider
Co-authored-by: qwen-cli <https://github.com/QwenLM/qwen-code>
- Add interpolateEnvVars function to support $VAR_NAME and ${VAR_NAME} syntax
- Apply interpolation to config after JSON5 parsing in readConfigFile()
- Enables secure API key management without hardcoding in config.json
- Supports nested objects and arrays for comprehensive interpolation
- Maintains backward compatibility with existing configurations
Example usage in config.json:
{
"OPENAI_API_KEY": "$OPENAI_API_KEY",
"Providers": [
{
"name": "openai",
"api_key": "$OPENAI_API_KEY"
}
]
}
- Include /api/restart endpoint in access control checks alongside /api/config endpoints
- Ensure restart endpoint properly validates API key authentication
- This fixes the issue where 'Save and Restart' fails with 403 error in UI
This commit introduces a new authentication mechanism for the web UI.
Instead of requiring a pre-configured API key, a temporary API key is
generated based on the system's UUID. This key is passed to the UI
as a URL parameter and used for API requests.
Changes:
- Added a new utility to get the system UUID and generate a temporary API key.
- Modified the `ccr ui` command to generate and pass the temporary API key.
- Updated the authentication middleware to validate the temporary API key.
- Adjusted the frontend to use the temporary API key from the URL.
- Added a dedicated endpoint to test API access without modifying data.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Modified the backupConfigFile function to automatically clean up old backups,
keeping only the 3 most recent backup files. This prevents the config directory
from accumulating excessive backup files over time.
The implementation:
- Creates timestamped backups as before
- After each new backup, scans for existing backups
- Sorts backups by timestamp (newest first)
- Deletes all but the 3 most recent backups
- Gracefully handles cleanup errors with warnings
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add fallback mechanism for service startup with default config
- Implement config file backup before saving
- Add robust validation for config data in UI components
- Improve error handling and user feedback in UI
- Fix potential null/undefined access in provider and router components
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
When the PORT was not specified in the config file, the status command
would show "undefined" for the port. This fix ensures that the default
port 3456 is displayed instead, matching the actual behavior of the
service which uses 3456 as the default port.
Fixes the issue where `ccr status` shows undefined for port when not
configured explicitly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created separate build script to handle both CLI and UI building
- Added automatic UI dependency installation
- Copy built UI artifacts to dist directory
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add API_TIMEOUT_MS to config.example.json with default value of 600000ms
- Update README.md and README_zh.md to document the new configuration option
- Modify codeCommand.ts to use the configured timeout value instead of hardcoded 600000ms
- Default to 10 minutes (600000ms) if not set in config