feat(服务器): 添加客户端配置生成命令
Add a new command line feature to generate client configuration files.
The command supports generating configs with custom host and port settings.
添加新的命令行功能用于生成客户端配置文件。
该命令支持生成带有自定义主机和端口设置的配置。
Main changes 主要改动:
- Add --gen parameter to generate client configuration
- Create utils/once_cmd.go for one-time command handling
- Add detailed documentation in both English and Chinese
- Implement secure random key generation for AES-256
- Add usage examples and security notes
- 添加 --gen 参数用于生成客户端配置
- 创建 utils/once_cmd.go 用于处理一次性命令
- 添加中英双语详细文档
- 实现 AES-256 的安全随机密钥生成
- 添加使用示例和安全说明
Usage examples 使用示例:
relayapi-server --gen= > config.rai
relayapi-server --gen=example.com:8080 > config.rai
Documentation 文档:
- Add configuration generation guide to docs/configuration.md
- Add Chinese version to docs/configuration_cn.md
- 在 docs/configuration.md 中添加配置生成指南
- 在 docs/configuration_cn.md 中添加中文版本
Breaking changes 破坏性变更:
- DefaultClientConfig now returns error for better error handling
- DefaultClientConfig 现在返回错误以提供更好的错误处理