docs: 文档修改优化
This commit is contained in:
1 parent
7cd5b4fb66
commit
609698be81
5 files changed
+178
-97
No files matched your search
+1
-1
@@ -19,5 +19,5 @@ WORKDIR /app
|
||||
COPY --from=backend-builder /app/backend/license-manager .
|
||||
COPY --from=frontend-builder /app/frontend/dist ./static
|
||||
COPY backend/configs/config.example.yaml ./config.yaml
|
||||
EXPOSE 8080
|
||||
EXPOSE 18888
|
||||
CMD ["./license-manager"]
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
## 项目概述
|
||||
|
||||
软件授权管理平台是一个独立的软件授权管理系统,为IoT平台等软件系统提供授权码生成、分发、验证和管理服务。支持在线和离线两种授权模式,基于硬件绑定的授权机制确保安全性。
|
||||
软件授权管理平台是一个独立的软件授权管理系统,为软件系统提供授权码生成、分发、验证和管理服务。支持在线和离线两种授权模式,基于硬件绑定的授权机制确保安全性。
|
||||
|
||||
## 核心功能
|
||||
|
||||
@@ -21,34 +21,38 @@
|
||||
## 技术栈
|
||||
|
||||
- **前端**:Vue.js 3+ 配合现代化UI组件
|
||||
- **后端**:Go 1.23+ 使用Gorilla Mux路由和Logrus日志
|
||||
- **数据库**:PostgreSQL 12+ / MySQL 12+
|
||||
- **后端**:Go 1.23+ 使用Gin框架、GORM、Viper配置和Logrus日志
|
||||
- **数据库**:PostgreSQL 12+ / MySQL 8+
|
||||
- **配置**:YAML格式配置文件
|
||||
- **部署**:Docker、单机部署或系统服务
|
||||
|
||||
## API接口
|
||||
|
||||
```
|
||||
POST /api/validate - 授权验证
|
||||
POST /api/activate - 授权激活
|
||||
POST /api/heartbeat - 心跳上报
|
||||
GET /api/license/{code} - 授权信息查询
|
||||
GET /api/customers - 客户列表API
|
||||
GET /tools/{tool} - 工具下载
|
||||
```
|
||||
|
||||
## 安全与性能
|
||||
|
||||
- **安全特性**:HMAC-SHA256签名,硬件指纹绑定,HTTPS传输加密
|
||||
- **性能表现**:支持100+并发用户,API响应时间<2秒
|
||||
- **可靠性**:完善的错误处理和日志记录
|
||||
- **安全特性**:
|
||||
- JWT身份认证和授权机制
|
||||
- HMAC-SHA256签名验证
|
||||
- 硬件指纹绑定防盗版
|
||||
- HTTPS传输加密
|
||||
- 多语言错误信息支持(中/英/日)
|
||||
|
||||
- **性能表现**:
|
||||
- **高并发**:Go原生协程支持,理论支持10,000+并发连接
|
||||
- **低延迟**:API平均响应时间 < 50ms
|
||||
- **内存优化**:Go GC优化,内存占用 < 100MB
|
||||
- **数据库连接池**:支持连接复用,最大化数据库性能
|
||||
|
||||
- **可靠性**:
|
||||
- 完善的错误处理和多语言错误信息
|
||||
- 结构化日志记录和监控
|
||||
- 自动数据库迁移
|
||||
- 优雅关闭和资源清理
|
||||
|
||||
## 安装部署
|
||||
|
||||
```bash
|
||||
# 克隆项目
|
||||
git clone <repository-url>
|
||||
cd license-manager
|
||||
git clone https://github.com/cedar-v/license-manager.git
|
||||
cd license-manager/backend/cmd
|
||||
|
||||
# 构建应用
|
||||
go build -o license-manager
|
||||
@@ -64,16 +68,79 @@ cp config.example.yaml config.yaml
|
||||
## Docker部署
|
||||
|
||||
```bash
|
||||
# 构建Docker镜像
|
||||
# 构建Docker镜像(多阶段构建,包含前后端)
|
||||
docker build -t license-manager .
|
||||
|
||||
# 创建配置文件
|
||||
cp backend/configs/config.example.yaml config.yaml
|
||||
# 编辑 config.yaml 配置数据库等信息
|
||||
|
||||
# 使用Docker运行
|
||||
docker run -p 8080:8080 -v $(pwd)/config.yaml:/app/config.yaml license-manager
|
||||
docker run -d \
|
||||
--name license-manager \
|
||||
-p 18888:18888 \
|
||||
-v $(pwd)/config.yaml:/app/config.yaml \
|
||||
license-manager
|
||||
|
||||
# 查看运行状态
|
||||
docker logs license-manager
|
||||
|
||||
# 健康检查
|
||||
curl http://localhost:18888/health
|
||||
```
|
||||
|
||||
### Docker Compose部署(推荐)
|
||||
|
||||
```yaml
|
||||
# docker-compose.yml
|
||||
version: '3.8'
|
||||
services:
|
||||
license-manager:
|
||||
build: .
|
||||
ports:
|
||||
- "18888:18888"
|
||||
volumes:
|
||||
- ./config.yaml:/app/config.yaml
|
||||
environment:
|
||||
- GIN_MODE=release
|
||||
restart: unless-stopped
|
||||
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root@123
|
||||
MYSQL_DATABASE: license_manager
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
```
|
||||
|
||||
## 开源许可证
|
||||
|
||||
本项目采用GNU通用公共许可证v3.0 - 详见[LICENSE](LICENSE)文件。
|
||||
本项目采用 **GNU General Public License v3.0 (GPL-3.0)** 开源许可证。
|
||||
|
||||
### 许可证说明
|
||||
|
||||
- **自由使用**:您可以自由地使用、学习、修改和分发本软件
|
||||
- **开源要求**:如果您分发修改版本,必须同样开源并采用GPL-3.0许可证
|
||||
- **版权保护**:使用本软件的衍生作品必须保留原始版权声明
|
||||
- **无担保**:软件按"现状"提供,不提供任何明示或暗示的担保
|
||||
|
||||
### 商业使用
|
||||
|
||||
- 允许商业使用,但衍生作品必须同样开源
|
||||
- 如需专有许可证或商业支持,请联系项目维护者
|
||||
|
||||
### 许可证全文
|
||||
|
||||
详细许可证条款请查看项目根目录的 [LICENSE](LICENSE) 文件,或访问:
|
||||
https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
+88
-11
@@ -21,8 +21,8 @@ License Manager is an independent software licensing platform that provides lice
|
||||
## Technical Stack
|
||||
|
||||
- **Frontend**: Vue.js 3+ with modern UI components
|
||||
- **Backend**: Go 1.23+ with Gorilla Mux router and Logrus logging
|
||||
- **Database**: PostgreSQL 12+ / MySQL 12+
|
||||
- **Backend**: Go 1.23+ with Gin framework, GORM, Viper configuration and Logrus logging
|
||||
- **Database**: PostgreSQL 12+ / MySQL 8+
|
||||
- **Configuration**: YAML format configuration files
|
||||
- **Deployment**: Docker, single machine, or system service
|
||||
|
||||
@@ -39,16 +39,31 @@ GET /tools/{tool} - Tool download
|
||||
|
||||
## Security & Performance
|
||||
|
||||
- **Security**: HMAC-SHA256 signing, hardware fingerprint binding, HTTPS encryption
|
||||
- **Performance**: Supports 100+ concurrent users with <2s API response time
|
||||
- **Reliability**: Comprehensive error handling and logging
|
||||
- **Security Features**:
|
||||
- JWT authentication and authorization
|
||||
- HMAC-SHA256 signature verification
|
||||
- Hardware fingerprint binding for anti-piracy
|
||||
- HTTPS transport encryption
|
||||
- Multi-language error message support (Chinese/English/Japanese)
|
||||
|
||||
- **Performance**:
|
||||
- **High Concurrency**: Go native goroutines support, theoretically supports 10,000+ concurrent connections
|
||||
- **Low Latency**: Average API response time < 50ms
|
||||
- **Memory Optimized**: Go GC optimization, memory usage < 100MB
|
||||
- **Database Connection Pool**: Connection reuse for maximum database performance
|
||||
|
||||
- **Reliability**:
|
||||
- Comprehensive error handling with multi-language error messages
|
||||
- Structured logging and monitoring
|
||||
- Automatic database migrations
|
||||
- Graceful shutdown and resource cleanup
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone <repository-url>
|
||||
cd license-manager
|
||||
git clone https://github.com/cedar-v/license-manager.git
|
||||
cd license-manager/backend/cmd
|
||||
|
||||
# Build the application
|
||||
go build -o license-manager
|
||||
@@ -64,16 +79,78 @@ cp config.example.yaml config.yaml
|
||||
## Docker Deployment
|
||||
|
||||
```bash
|
||||
# Build Docker image
|
||||
# Build Docker image (multi-stage build with frontend and backend)
|
||||
docker build -t license-manager .
|
||||
|
||||
# Create configuration file
|
||||
cp backend/configs/config.example.yaml config.yaml
|
||||
# Edit config.yaml to configure database and other settings
|
||||
|
||||
# Run with Docker
|
||||
docker run -p 8080:8080 -v $(pwd)/config.yaml:/app/config.yaml license-manager
|
||||
docker run -d \
|
||||
--name license-manager \
|
||||
-p 18888:18888 \
|
||||
-v $(pwd)/config.yaml:/app/config.yaml \
|
||||
license-manager
|
||||
|
||||
# Check running status
|
||||
docker logs license-manager
|
||||
|
||||
# Health check
|
||||
curl http://localhost:18888/health
|
||||
```
|
||||
|
||||
## License
|
||||
### Docker Compose Deployment (Recommended)
|
||||
|
||||
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
|
||||
```yaml
|
||||
# docker-compose.yml
|
||||
version: '3.8'
|
||||
services:
|
||||
license-manager:
|
||||
build: .
|
||||
ports:
|
||||
- "18888:18888"
|
||||
volumes:
|
||||
- ./config.yaml:/app/config.yaml
|
||||
environment:
|
||||
- GIN_MODE=release
|
||||
restart: unless-stopped
|
||||
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root@123
|
||||
MYSQL_DATABASE: license_manager
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
```
|
||||
|
||||
## Open Source License
|
||||
|
||||
This project is licensed under the **GNU General Public License v3.0 (GPL-3.0)**.
|
||||
|
||||
### License Description
|
||||
|
||||
- **Free Use**: You are free to use, study, modify, and distribute this software
|
||||
- **Open Source Requirement**: If you distribute modified versions, they must also be open source under GPL-3.0 license
|
||||
- **Copyright Protection**: Derivative works using this software must retain the original copyright notice
|
||||
- **No Warranty**: The software is provided "as is" without any express or implied warranty
|
||||
|
||||
### Commercial Use
|
||||
|
||||
- Commercial use is permitted, but derivative works must also be open source
|
||||
- For proprietary licensing or commercial support, please contact the project maintainers
|
||||
|
||||
### Full License Text
|
||||
|
||||
For detailed license terms, please see the [LICENSE](LICENSE) file in the project root directory, or visit:
|
||||
https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -19,30 +19,6 @@ license-manager/
|
||||
└── bin/ # 编译产物目录
|
||||
```
|
||||
|
||||
## 后端目录 (backend/)
|
||||
|
||||
```
|
||||
backend/
|
||||
├── cmd/ # 应用程序入口
|
||||
│ └── main.go # 主程序入口文件
|
||||
├── internal/ # 内部包(不对外暴露)
|
||||
│ ├── api/ # API路由和控制器
|
||||
│ ├── config/ # 配置管理
|
||||
│ ├── models/ # 数据模型定义
|
||||
│ ├── service/ # 业务逻辑层
|
||||
│ ├── repository/ # 数据访问层
|
||||
│ └── middleware/ # HTTP中间件
|
||||
├── pkg/ # 可重用的公共包
|
||||
├── configs/ # 配置文件目录
|
||||
│ ├── config.yaml # 生产环境配置
|
||||
│ └── config.example.yaml # 配置模板文件
|
||||
├── migrations/ # 数据库迁移脚本
|
||||
├── scripts/ # 后端专用脚本
|
||||
├── tools/ # 硬件信息获取工具
|
||||
├── go.mod # Go模块依赖
|
||||
└── go.sum # Go依赖校验
|
||||
```
|
||||
|
||||
## 前端目录 (frontend/)
|
||||
|
||||
```
|
||||
|
||||
@@ -119,47 +119,8 @@
|
||||
- 客户管理、授权生成、授权列表和详情页面
|
||||
- 系统仪表盘、用户登录页面
|
||||
|
||||
### 6.2 RESTful API接口
|
||||
- `POST /api/validate` - 授权验证
|
||||
- `POST /api/activate` - 授权激活
|
||||
- `POST /api/heartbeat` - 心跳上报
|
||||
- `GET /api/license/{code}` - 授权信息查询
|
||||
- `GET /api/customers` - 客户列表API
|
||||
- `GET /tools/{tool}` - 工具下载
|
||||
|
||||
### 6.3 数据格式
|
||||
- 统一JSON格式数据交换
|
||||
- 统一错误响应格式
|
||||
- 支持数据分页和筛选
|
||||
|
||||
## 7. 项目交付物
|
||||
|
||||
### 7.1 软件交付
|
||||
- 完整源代码(前后端)
|
||||
- 编译后的可执行文件
|
||||
- Docker镜像文件
|
||||
- 数据库初始化脚本
|
||||
|
||||
### 7.2 文档交付
|
||||
- 部署安装文档
|
||||
- API接口文档
|
||||
- 用户操作手册
|
||||
- 系统架构文档
|
||||
|
||||
### 7.3 工具交付
|
||||
- 硬件信息获取工具(Windows/Linux)
|
||||
- 客户端SDK示例
|
||||
- 配置文件模板
|
||||
|
||||
## 8. 开发计划
|
||||
|
||||
### 8.1 开发阶段
|
||||
1. **架构设计**(1周):技术选型、数据库设计、API设计
|
||||
2. **核心功能**(3周):客户管理、授权生成、验证API
|
||||
3. **Web界面**(2周):前端页面开发、交互逻辑
|
||||
4. **测试部署**(1周):功能测试、性能测试、部署验证
|
||||
|
||||
### 8.2 质量保证
|
||||
- 单元测试覆盖率 > 80%
|
||||
- 接口测试和性能测试
|
||||
- 安全性测试和代码审查
|
||||
Reference in new issue
Block a user