feat: initial commit - Go + CGO captcha recognition service
Build and Deploy / build-frontend (push) Failing after 2s
Build and Deploy / build-backend (push) Has been skipped
Build and Deploy / build-docker (push) Has been skipped
Build and Deploy / deploy (push) Has been skipped

Features:
- Go + CGO ONNX/OpenCV wrapper for high performance
- SQLite (default) / MySQL database support
- Optional Redis caching
- JWT authentication system
- Multiple captcha recognition APIs:
  - OCR text recognition
  - Slider captcha matching
  - Image similarity comparison
  - Rotation captcha detection
  - Object detection
- React frontend with install wizard
- Docker and docker-compose support
- Gitea CI/CD pipeline

Project structure:
- cmd/server: Main entry point
- internal/: Core business logic
- pkg/onnx: ONNX Runtime CGO wrapper
- pkg/opencv: OpenCV CGO wrapper
- web/: React frontend
- deploy/: Deployment configs
- scripts/: Utility scripts
This commit is contained in:
2026-07-16 08:56:38 +00:00
commit 524c404194
32 changed files with 2971 additions and 0 deletions
+91
View File
@@ -0,0 +1,91 @@
# AntiCaptcha
基于 Go + CGO 的高性能验证码识别服务,支持多种验证码类型识别。
## 功能特性
- **验证码识别**:OCR、滑块、旋转验证码、目标检测等
- **多数据库支持**SQLite(默认)、MySQL 可选
- **可选 Redis**:用于缓存和会话管理
- **RESTful API**:标准化接口设计
- **Web 管理界面**React 前端
- **Docker 部署**:一键容器化部署
## 快速开始
### 环境要求
- Go 1.22+
- OpenCV 4.x
- ONNX Runtime 1.16+
- Node.js 18+ (前端构建)
### 安装依赖
```bash
# Ubuntu/Debian
apt install libopencv-dev libonnxruntime-dev
# macOS
brew install opencv onnxruntime
# Windows (vcpkg)
vcpkg install opencv4 onnxruntime
```
### 编译运行
```bash
# 克隆项目
git clone https://git.viaeon.com/admin/AntiCaptcha
cd AntiCaptcha
# 下载 Go 依赖
go mod download
# 编译
go build -o anticaptcha ./cmd/server
# 运行
./anticaptcha
```
### Docker 部署
```bash
docker build -t anticaptcha .
docker run -d -p 6688:6688 -v ./data:/app/data anticaptcha
```
## 项目结构
```
.
├── cmd/
│ ├── server/ # 主服务入口
│ └── install/ # 安装向导
├── internal/
│ ├── captcha/ # 验证码识别核心
│ ├── config/ # 配置管理
│ ├── database/ # 数据库操作
│ ├── handler/ # HTTP 处理器
│ ├── middleware/ # 中间件
│ ├── model/ # 数据模型
│ └── service/ # 业务逻辑
├── pkg/
│ ├── onnx/ # ONNX Runtime CGO 封装
│ ├── opencv/ # OpenCV CGO 封装
│ └── utils/ # 工具函数
├── web/ # React 前端
├── deploy/ # 部署配置
├── models/ # ONNX 模型文件
└── scripts/ # 脚本工具
```
## API 文档
启动服务后访问 `/docs` 查看完整 API 文档。
## License
MIT