1. Tool
Traffic Tool
  • Traffic Tool Docs
    • Tổng Quan
    • Buisness | Logic
      • Hệ thống được tạo ra để làm gì?
      • Tạo chiến dịch như thế nào?
      • Xử lý sự cố thường gặp
      • Báo cáo bảo mật tự động
      • Tổng hợp báo cáo như thế nào?
    • Project
      • ADMIN
        • Tổng quan
        • Hướng dẫn sử dung
          • Đăng Nhập & Xác Thực Hai Bước
          • HOME TRAFFIC & KILL TRAFFIC
          • CLICK ADS
          • REPORT SITE
          • Thống Kê Hệ Thống
          • Thống Kê Hàng Ngày
          • Tìm Kiếm Tự Động
          • Trung Tâm Báo Cáo
          • Quản Lý Tài Khoản
          • Quản Lý Server
          • Quản Lý Proxy
          • Quản Lý Gói Proxy
          • Quản Lý Nhà Cung Cấp Proxy
          • Quản Lý Backup Proxy
          • Quản Lý Tài Khoản Google
          • User Guide
        • Architecture
          • Setup Guide
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs and Monitoring
        • Deployment
          • Local
          • Staging
          • Production
        • Bussiness | Logic
          • 1. Thống kê hàng ngày (Daily Statistics)
          • 2. Thống kê hệ thống (System Statistics)
          • 3. Tìm kiếm tự động (Automated Discovery)
          • 4. Trung tâm Báo cáo (Report Center)
          • 5. Quản lý tài khoản (Account Management)
          • 6. Quản lý Hệ thống (System Management)
          • 7. Quản lý tài khoản Google (Google Account Management)
      • API
        • Tổng quan
        • Architecture
          • Setup Guide
          • Database Schema
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs and Monitoring
        • Deployment
          • Local
          • Staging
          • Production
        • API Interface
          • 🔑 Identity & Session
            • Đăng nhập hệ thống (Login)
            • Đăng ký tài khoản mới (Public)
            • Lấy danh sách người dùng (Phân trang)
            • Admin tạo người dùng mới
            • Lấy thông tin cá nhân hiện tại
            • Khởi tạo bảo mật 2FA
            • Xác thực mã OTP
            • Chi tiết người dùng theo ID
            • Cập nhật thông tin người dùng
            • Xóa tài khoản người dùng
            • Đổi mật khẩu
            • Kiểm tra Cấu hình Thông báo Telegram Toàn hệ thống
            • Bật/Tắt Thông báo Telegram Toàn cục
          • 📁 Campaign Management
            • Danh sách Chiến dịch Toàn cầu
            • Khởi tạo Chiến dịch Mới
            • Chi tiết Chiến dịch
            • Cập nhật Chiến dịch
            • Xóa Chiến dịch
            • Tắt/Mở Chiến dịch (Hàng loạt)
            • Dữ liệu Hình mẫu SEO (Negative SEO)
          • ⚙️ Project Mechanics
            • Danh sách Dự án (Projects List)
            • Khởi tạo Kịch bản Mô phỏng
            • Lấy chi tiết cấu hình Dự án
            • Cập nhật Kịch bản chạy
            • Xóa Dự án
            • Chỉnh sửa Hàng loạt (Bulk)
            • Bật/Tắt Dự án
          • 👤 Profile Management
            • Danh sách Vân tay số (Profiles Data)
            • Tạo Hồ sơ Đơn lẻ (Tạo Vân tay mới)
            • Nhập kho Tài khoản Email (Bulk Import)
            • Chi tiết Session/Cookies
            • Chỉnh sửa Hồ sơ/Ghi chú
            • Xóa Vân tay số và Dữ liệu Local
            • Mở khóa Captcha/Trạng thái Blocked
            • Tra cứu Kho Profile Khả dụng
            • Báo cáo Sức khỏe Kho Tài Khoản
          • 🦾 Worker Interface
            • Đăng ký Khởi tạo Node (Handshake)
            • Nhịp Tim Khảo Sát Tình Trạng (Heartbeat)
            • Nhận Cấu hình Bypass & Hệ thống
            • Kéo (PULL) Nhiệm vụ Traffic SEO
            • Báo cáo Sự cố Node (Crash Report)
          • 📊 Report: Execution
            • Kéo Công việc Báo cáo (Worker Pull)
            • Quản lý Giám sát Nhiệm vụ (Task Dashboard)
            • Bắn Lại Báo Cáo Thất Bại (Manual Retry)
          • 📊 Report: Discovery
            • Danh sách Tên miền Chờ Xử Lý (Discovery Pool)
            • Nhập Mục Tiêu Thủ Công (Manual Insert)
            • Kích hoạt Heuristic Scanner (Cào tự động)
            • Chi tiết Bằng Chứng (Evidence Data)
            • Dán nhãn Vi Phạm / Cập nhật Screenshot
            • Loại Bỏ Mục Tiêu
            • Duyệt Yêu Cầu (Approve to Execution)
          • 📊 Report: Platforms Configuration
            • Truy vấn Danh sách Nền tảng Đối tác (Vendor)
            • Tạo Nền tảng Vendor Báo cáo Mới
            • Bật/Tắt Trang báo cáo theo Loại
            • Cập nhật Metadata Trang
            • Xóa Trang Báo Cáo
            • Lấy Cài đặt LLM cho Vendor cụ thể
            • Cập nhật Cài đặt Tạo mẫu LLM
            • Lấy Cấu hình Schema Biểu mẫu cho Vendor
            • Cập nhật Yêu cầu Trường Biểu mẫu
          • 📊 Report: Email Automation
            • Danh sách SMTP/Mailer Server
            • Thêm kết nối SMTP Mới
            • Nhật ký Nhiệm vụ Gửi Mail (Email Log)
            • Phân tích Tỉ lệ Chuyển đổi (Email Delivery Analytics)
          • 🌐 Global Proxies
            • Danh sách Kho Proxy Phân trang (Proxy Pool)
            • Thêm mới Tuyến IP (Bulk Import)
            • Cập nhật Thông tin máy chủ Proxy
            • Xóa Proxy (Thu hồi tài nguyên)
            • Kích hoạt Xoay vòng (Rotate IP) Cưỡng bức
          • 📈 System Intelligence
            • Báo cáo Luồng Bảo mật Hợp nhất (Colossal Report)
            • Bản Đồ Lưu Lượng GeoIP (Heatmap)
          • 🪝 Webhook Integrations
            • Callback Hoàn tất Gói Lưu lượng SEO (Traffic Node)
            • Callback Thông báo Hoàn tất Bắn Report AI
      • Tool
        • Tổng quan
        • Architecture
          • Setup Guide
          • System Architecture
          • Code Structure
          • Environment & Configuration
          • Logs And Monitoring
          • Database Schema
        • Deployment
          • Local
          • Staging
          • Production
        • API interface
          • Tasks
            • Lấy tasks có phân trang và lọc
            • Xóa tất cả tasks
            • Get all tasks
            • Cập nhật một task
            • Xóa một task theo ID
            • Get all tasks
          • Group task
            • Tạo nhiều task groups
            • Lấy tất cả task groups
            • Xóa tất cả task groups
            • Xóa một task group theo ID
            • Endpoint /api/task-traffics/
            • Test parse proxy string
            • Endpoint /api/task-traffics/
          • Test
            • Mock proxy endpoint cho development
            • Mock profile endpoint cho development
            • Endpoint /api/test
            • Endpoint /api/test/account-stats
            • Endpoint /api/test/session-recommendation
            • Endpoint /api/test/check-browser
            • Endpoint /api/test/clear-browser-sessions
          • Proxies
            • Lấy tất cả proxy records
            • Tạo proxy record mới
            • Xóa tất cả proxies
            • Get all proxies
            • Xóa một proxy theo ID
            • Reset proxy process counter
            • Get all proxies
            • Get all proxies
          • Report Platforms
            • Submit report to multiple platforms
            • Submit report to specific platform
            • Get available platforms
            • Get platform statistics
            • Health check
          • Reports
            • Create a new report
            • Create a new report
            • Get report by ID
            • Get report by ID
            • Get report statistics
            • Get report groups
            • Get report groups
            • Get report group
            • Add report to group
            • Bulk add reports to group
            • Get report group statistics
            • Get analytics data
            • Get platform success rates
            • Get reports by platform
            • Get reports by group
            • Create test reports in bulk
            • Tạo PC report CSV
            • Lấy PC report JSON
            • Lấy report tasks
            • Giám sát report tasks
            • Report tasks đang hoạt động
            • Chi tiết report task
            • Thống kê reports
            • Dữ liệu biểu đồ reports
            • Lấy danh sách report sites
            • Tạo report site
            • Thống kê sites
            • Toggle site enabled/disabled
            • Toggle tất cả sites
            • Toggle sites theo type
            • Cập nhật hàng loạt AI prompts
            • Cập nhật site
            • Xóa site
            • Lấy cấu hình đầy đủ của site
            • Lấy AI prompt của site
            • Cập nhật AI prompt của site
            • Lấy GPT config của site
            • Cập nhật GPT config
            • Lấy response config của site
            • Cập nhật response config
            • Lấy security vendors đang bật
            • Phân tích keywords
            • Top keywords
            • Thống kê analytics
            • PC report dashboard
            • Lấy report domains
            • Thêm report domain
            • Chi tiết report domain
            • Thống kê hàng ngày
            • Cập nhật hàng loạt reports
          • Test Report
            • Test Microsoft report submission
            • Test AdGuard report submission
            • Test Google Ads report submission
            • Test Spamhaus report submission
            • Test ESET report submission
            • Test multi-platform report submission
            • Get available platforms
          • ESET Test
            • Simple test
            • Minimal POST test
            • Generate ESET report content
            • Get sample test data
            • Test form filling
            • Test full form submission
          • Spamhaus Test
            • Simple test
            • Minimal POST test
            • Generate Spamhaus report content
            • Get sample test data
            • Test Spamhaus form filling
            • Test full Spamhaus form submission
          • Report Scheduler
            • Get report scheduler statistics
            • Process ad detection result
            • Submit a scheduled report
            • Start report scheduler
            • Stop report scheduler
            • Get scheduler status
            • Process scheduled reports
            • Test browser session (non-headless)
            • Test report submission (non-headless)
          • Comprehensive Analytics
            • Get comprehensive dashboard analytics
            • Get overview statistics
            • Get brand-wise statistics
            • Get daily statistics
            • Get platform success rates
            • Get account performance
            • Get summary report
          • Search
            • Tạo nhiều search tasks
            • Lấy tổng số search tasks
          • Report Tasks
            • Tạo report tasks cho một domain
            • Tạo report tasks trực tiếp (hỗ trợ profileCountry và domainType rõ ràng)
            • Tạo report tasks cho nhiều domains cùng lúc
            • Tạo email-based report tasks
            • Lấy report task PENDING tiếp theo
            • Cập nhật status của report task
            • Lấy danh sách platforms có sẵn
            • Thống kê report tasks
            • Kích hoạt thực thi thủ công
          • Monitor
            • Thông tin tài nguyên hệ thống
          • System
            • Hello World
            • Health check
            • Đọc file log từ xa
            • Monitor worker status
          • Auth
            • Đăng nhập
            • Đăng ký tài khoản
          • User Management
            • Danh sách users có phân trang
            • Tạo user mới (Admin only)
            • Lấy tất cả users (không phân trang)
            • Lấy thông tin profile của user hiện tại
            • Tạo QR code TOTP cho 2FA
            • Xác thực TOTP để bật 2FA
            • Lấy user theo ID
            • Cập nhật thông tin user
            • Xóa user
            • Đổi mật khẩu user
          • Campaign Management
            • Danh sách campaigns có phân trang
            • Tạo campaign mới
            • Lấy tất cả campaigns
            • Thống kê tổng hợp campaigns
            • Xuất campaigns ra Excel
            • Lấy dữ liệu Negative SEO
            • Xuất dữ liệu Negative SEO ra Excel
            • Xuất Negative SEO theo IDs
            • Lấy dữ liệu Home Traffic
            • Xuất Home Traffic ra Excel
            • Xuất Home Traffic theo IDs
            • Lấy báo cáo campaigns (Public)
            • Lấy tất cả báo cáo campaigns (Public)
            • Lấy chi tiết campaign
            • Cập nhật campaign
            • Xóa campaign
            • Lấy campaigns đã fired theo type
          • Server Management
            • Danh sách servers có phân trang
            • Tạo server mới
            • Lấy tất cả servers
            • Lấy servers từ MongoDB
            • Báo cáo hiệu suất server
            • Thống kê health check
            • Thống kê task monitor
            • Lịch sử lỗi server
            • Thống kê lỗi server
            • Thay đổi trạng thái server
            • Xóa nhiều servers
            • Lấy server theo ID
            • Cập nhật server
            • Xóa server
            • Báo cáo servers (Public)
          • Project Management
            • Lấy tất cả projects
            • Tạo project mới
            • Lấy projects theo campaign
            • Cập nhật dữ liệu traffic
            • Cập nhật nhiều projects
            • Xóa nhiều projects
            • Lấy project theo ID
            • Cập nhật project
            • Cập nhật state của project
            • Cập nhật status của project
            • Tính lại chi tiết project
          • Task Management
            • Worker yêu cầu tasks
            • Reset task creation
          • Proxy Management
            • Danh sách proxies
            • Tạo proxy mới
            • Xóa tất cả proxies
            • Xuất proxies ra Excel
            • Tải template Excel mẫu
            • Tạo nhiều proxies
            • Import proxies từ Excel
            • Import từ tất cả providers
            • Xóa nhiều proxies
            • Lấy proxy theo ID
            • Cập nhật proxy
            • Xóa proxy
            • Toggle trạng thái proxy
          • Backup Proxy
            • Lấy danh sách backup proxies
            • Tạo backup proxy
            • Xóa nhiều backup proxies
            • Import từ Proxifly
            • Chạy health check
            • Lấy backup proxy theo ID
            • Cập nhật backup proxy
            • Xóa backup proxy
            • Test backup proxy
          • Proxy Providers
            • Lấy danh sách proxy providers
            • Tạo proxy provider
            • Xóa nhiều providers
            • Lấy provider theo ID
            • Cập nhật provider
            • Xóa provider
          • Proxy Packages
            • Lấy danh sách proxy packages
            • Tạo proxy package
            • Xóa nhiều packages
            • Lấy package theo ID
            • Cập nhật package
            • Xóa package
          • Profiles
            • Lấy profiles khả dụng (Public)
            • Lấy profile ngẫu nhiên (Public)
            • Danh sách profiles có phân trang
            • Phân tích profiles
            • Health check profiles
            • Tạo profile session
            • Lấy profile session
            • Cập nhật profile session
            • Xóa profile session
            • Đánh dấu profile đã dùng
            • Cập nhật nhiều profiles
            • Tạo nhiều profiles
            • Dọn dẹp sessions hết hạn
            • Dọn dẹp toàn diện
            • Tạo profile mới
            • Lấy profile theo ID
            • Cập nhật profile
            • Xóa profile
            • Thống kê profile
            • Sessions của profile (phân trang)
            • Report tasks của profile
            • Domains đã report bởi profile
            • Tasks theo domain của profile
            • Reset cooldown của profile
            • Test kết nối profile
            • Reset số lần đăng nhập thất bại
            • Ghi nhận đăng nhập thất bại
          • Keywords
            • Danh sách keywords
            • Tạo keyword mới
            • Xuất keywords ra Excel
            • Xác nhận fire keyword
            • Reset tất cả keywords
            • Lấy keyword theo ID
            • Cập nhật keyword
            • Xóa keyword
            • Reset keyword
            • Cập nhật status keyword
            • Kết quả SERP của keyword
          • Dashboard
            • Dữ liệu tổng hợp dashboard
            • Thống kê hệ thống
            • Thống kê traffic theo ID
            • Dữ liệu bảng biểu đồ traffic
            • Xuất báo cáo ra Excel
            • Lấy dữ liệu báo cáo
            • Cập nhật hàng loạt dashboard
            • Tính lại chi tiết projects (Admin only)
          • System Settings
            • Toggle Telegram notifications
            • Trạng thái Telegram notification
          • Activity Logs
            • Lấy activity logs
          • Locations
            • Lấy tất cả locations
            • Tạo location mới
            • Lấy location theo ID
            • Cập nhật location
            • Xóa location
          • Evidence
            • Kiểm tra evidence tồn tại
            • Kiểm tra evidence hàng loạt
            • Lấy evidence mới nhất
          • Files
            • Upload file
            • Download file
          • Server Hourly Reports
            • Lấy server hourly reports
          • Task Logs
            • Lấy task logs
          • Webhooks - Proxy
            • Lấy proxy cho task (Worker webhook)
            • Lấy proxies có thể rotate (Worker webhook)
            • Báo cáo kết quả proxy rotation (Worker webhook)
            • Lấy backup proxy (Worker webhook)
          • Webhooks - Profile
            • Lấy profiles (admin view, webhook)
            • Lấy profile ngẫu nhiên (Worker webhook)
            • Profiles khả dụng (webhook)
            • Lấy profile session (webhook)
            • Tạo profile session (webhook)
            • Đánh dấu profile đã dùng (webhook)
            • Lấy profile tags (webhook)
            • Lấy tất cả profile sessions (webhook)
          • Webhooks - Task
            • Cập nhật kết quả thực thi task (Worker webhook)
          • Webhooks - Search
            • Báo cáo domains đã click (webhook)
            • Lấy clicked domains (webhook)
            • Báo cáo domains (webhook)
            • Third party callback (webhook)
          • Webhooks - Logs
            • Lấy file logs (webhook)
            • Xóa nội dung log (webhook)
            • Kiểm tra IP address (webhook)
          • Webhooks - Keyword
            • Gửi kết quả SERP keyword (webhook)
          • Webhooks - Report
            • Cập nhật trạng thái report task (webhook)
          • Webhooks - CocCoc Token
            • Lấy CocCoc tokens (webhook)
            • Lock CocCoc token (webhook)
            • Unlock CocCoc token (webhook)
    • Schemas
      • LoginRequest
      • UpdateTask
      • WorkerStatus
      • StandardResponse
      • UserResponseDto
      • CreateTaskGroupRequest
      • HealthResponse
      • UserModel
      • CreateProxy
      • ErrorResponse
      • Pagination
      • CreateUserRequest
      • ReportTaskCreation
      • ErrorResponseFull
      • BulkDeleteRequest
      • UpdateUserRequest
      • CreateEmail
      • MessageResponse
      • UserResponse
      • PagingInfo
      • CreateMultipleSearchRequest
      • TrafficType
      • CampaignResponse
      • ProfileModel
      • CreateMultipleReportRequest
      • ServerResponse
      • CreateProfileRequest
      • UpdateReportStatusRequest
      • Task
      • BulkImportProfileReq
      • TestProxyRequest
      • TaskGroup
      • ProxyResponse
      • UpdateProfileRequest
      • CreateTask
      • UpdateTaskBody
      • KeywordResponse
      • CampaignModel
      • CreateSearch
      • TaskPaginatedResponse
      • LocationResponse
      • CreateCampaignRequest
      • ProxyTestResult
      • UpdateCampaignRequest
      • CreateReportTaskBody
      • BulkUpdateCampaignStatusReq
      • CreateEmailReportTaskBody
      • NegativeSeoData
      • BatchReportTaskItem
      • CreateProjectRequest
      • CreateReportTaskResponse
      • UpdateProjectRequest
      • BatchReportTaskResponse
      • ProjectModel
      • BulkUpdateProjectRequest
      • ReportTask
      • WorkerHandshakeRequest
      • UpdateReportTaskStatusBody
      • WorkerHandshakeResponse
      • UpdateReportTaskStatusResponse
      • WorkerHeartbeatPayload
      • PlatformsListResponse
      • WorkerGlobalSettings
      • ReportTaskStatsResponse
      • TaskPullRequest
      • ExecuteReportTaskResponse
      • WorkerFatalLog
      • CreateSearchTask
      • TaskModel
      • Proxy
      • TaskUpdateDto
      • CreateProxyBody
      • ReportTaskModel
      • CreateProxyResponse
      • ReportTaskResult
      • ResetProcessResponse
      • PCReportResponse
      • MonitorResponse
      • ReportSiteItem
      • CreateReportSiteRequest
      • TestProxyResponse
      • GPTConfig
      • TestProfileResponse
      • ResponseConfig
      • ReportDomainsResponse
      • ReportDomainItem
      • AddReportDomainRequest
      • UpdateReportDomainRequest
      • BulkUpdateDashboardRequest
      • ProxyModel
      • CreateProxyRequest
      • UpdateProxyRequest
      • SMTPServerConfig
      • EmailTaskLog
      • GeoLocation
      • CampaignConfigs
      • ProjectAttribute
      • TaskTrafficType
      • ReportTaskItem
      • SummaryStats
      • DailyStats
      • BrandStats
      • ProfileStats
      • FieldConfig
  1. Tool

Tổng quan

Tools V2 Worker Engine — Tổng Quan#

Tools V2 là Worker Engine tự động hóa hai nghiệp vụ chính: tạo traffic trình duyệt thực và gửi báo cáo bảo mật tự động đến hơn 100 nền tảng toàn cầu.
Không có giao diện người dùng. Hoạt động như một worker nền, liên tục nhận lệnh từ Go API Backend, thực thi tác vụ trên Chrome thực (Puppeteer + Bun), rồi gửi kết quả về. Toàn bộ quá trình diễn ra tự động sau khi cấu hình.
Xây dựng bằng Bun + TypeScript + Elysia + Puppeteer, chạy trên cổng 3005. Có thể deploy nhiều instance trên nhiều máy chủ — mỗi instance tự đăng ký với Go API qua SERVER_ID và nhận task tự động, không cần cấu hình thêm.

Các nhóm chức năng chính#

Tạo traffic thực — Mở Chrome thật, tìm kiếm từ khóa, click quảng cáo hoặc kết quả tự nhiên, ở lại trang đủ lâu. Hỗ trợ 5 loại flow: Google Ads, CocCoc Ads, Organic Search (Google/CocCoc), Kill (Negative SEO), Home Traffic (Direct).
Gửi báo cáo bảo mật — Tự động điền form báo cáo vi phạm trên 100+ nền tảng (browser-based) hoặc gửi email đến địa chỉ abuse (email-based). Nội dung do GPT-4o-mini tạo ra theo prompt riêng của từng nền tảng.
Chống phát hiện bot — 11 lớp stealth kỹ thuật: xóa navigator.webdriver, patch navigator/plugins, spoof WebGL/Audio fingerprint, disable WebRTC, ghost cursor (Bezier), random timing, proxy rotation, browser profiles, geolocation matching, resource blocking, timezone spoofing.
Tự phục hồi — Khi server crash, tất cả task đang PROCESSING được reset về PENDING khi khởi động lại. Task bị kẹt quá 20 phút tự động được reset bởi cron job.
Giám sát từ xa — Endpoint GET / trả về snapshot trạng thái (số Chrome đang chạy, task đang xử lý, proxy đang dùng). Endpoint GET /logs cho phép đọc log từ xa mà không cần SSH.

Bussiness | Logic#

Tài liệu nghiệp vụ mô tả các tính năng mà Tools V2 thực thi — từ góc nhìn người vận hành.
1. Thống kê hàng ngày — Tools V2 là nguồn tạo ra dữ liệu traffic. Mỗi lượt click thành công được ghi nhận theo giờ và hiển thị trên màn hình này.
2. Thống kê hệ thống — Tools V2 thực thi 3 loại chiến dịch: Click Ads (tiêu hao ngân sách đối thủ), Negative SEO (tăng bounce rate), Traffic Tự Nhiên (cải thiện SEO). Kết quả từng domain được cập nhật sau mỗi lượt thực thi.
3. Tìm kiếm tự động — Tools V2 thực hiện tìm kiếm thực tế trên Google/CocCoc, bóc tách toàn bộ kết quả SERP (URL, rank, loại ads/organic) và gửi về API qua webhook. Cron job quét lại mỗi 30 phút.
4. Trung tâm Báo cáo — Tools V2 nhận report task, lấy AI prompt từ API, gọi GPT-4o-mini tạo nội dung, điền form hoặc gửi email, giải CAPTCHA tự động, chụp ảnh bằng chứng và gửi kết quả về.
6. Quản lý Hệ thống — Tools V2 nhận proxy từ API qua webhook, thực hiện xoay IP khi được yêu cầu và báo cáo kết quả xoay về. Proxy được phân bổ sao cho không có hai task nào dùng cùng proxy cùng lúc.
7. Quản lý tài khoản Google — Tools V2 nhận profile từ API, dùng cookie/localStorage đã lưu để đăng nhập không cần nhập lại, lưu session data sau mỗi lần dùng, báo cáo đăng nhập thất bại về API.

Architecture#

Tài liệu kỹ thuật cho developer làm việc với Tools V2 Worker Engine.
System Architecture — Kiến trúc phân tầng 4 lớp (api/ → services/ → utils/ → config/), CronTaskGroup singleton điều phối traffic (polling mỗi giây, staggered launch 3 giây/browser), ReportTaskCron singleton điều phối báo cáo (1 task đồng thời, 30 phút giữa các lần), luồng dữ liệu end-to-end từ nhận task đến gửi kết quả.
Code Structure — Cây thư mục đầy đủ: api/ (task-group, report-tasks, proxy, search, monitor, screenshot), services/ (ai, browser, captcha, profiles, report-tasks, email, evidence, screenshot, google-accounts, webhook, zing-proxy), utils/browser_manager/ (11 stealth files, ghost-cursor, geolocation, device, session-manager).
Environment & Configuration — Biến môi trường: API_HOST, API_KEY, WEBHOOK_API_KEY, SERVER_ID, giới hạn đồng thời (CRON_TASK_LIMIT, BROWSER_LIMIT_PER_PROCESS, CRON_REPORT_LIMIT), cấu hình Anti-Captcha, OpenAI (GPT-4o-mini), DigitalOcean Spaces, Cloudinary, SMTP.
Logs And Monitoring — Log tổ chức theo service và ngày (storage/log/{service}/{YYYY-MM-DD}/{level}.log). Endpoint GET /logs?filePath=... đọc log từ xa. Error categorizer tự động phân loại lỗi: NETWORK_TIMEOUT, PROXY_ERROR, CAPTCHA_DETECTED, BOT_DETECTED, BROWSER_CRASH.
Database Schema — Schema MongoDB nội bộ của Tools V2: task_groups (TaskGroupStatus: PENDING=0, PROCESSING=1, COMPLETED=2), proxies (Status: PENDING→COMPLETED, rotation logic, domain_blocks), search (keyword ranking tasks), report_tasks (ReportPlatform enum 100+ values, ReportType: EMAIL_BASED/BROWSER_BASED). Tách biệt hoàn toàn với MongoDB của Go API.

Deployment#

Local — Chạy Tools V2 trên máy local với bun run dev. Cần khởi động MongoDB riêng qua Docker Compose (docker compose up -d). Cấu hình API_HOST trỏ đến Go API local, BROWSER_LIMIT_PER_PROCESS=1 để tiết kiệm RAM.
Staging — Pipeline GitLab tự động: SSH vào server, git pull, docker compose up --build -d. Build trực tiếp trên server, mất 5–10 phút (tải Bun, cài packages, tải Chrome).
Production — Deploy trên Linux server (Ubuntu 22.04 LTS). Cần cài thư viện hệ thống cho Chrome. Cấu hình BROWSER_LIMIT_PER_PROCESS dựa trên RAM server (mỗi Chrome ~300MB, server 16GB chạy được ~28-30 instance). Rollback bằng cách đổi tag image.

API Interface#

Tài liệu chi tiết từng endpoint của Tools V2, được nhóm theo chức năng.
🖥️ System — Giám sát trạng thái worker, health check, đọc log từ xa.
Trạng thái tổng quan worker — GET / trả về snapshot: số Chrome đang chạy (browserSessionRunning), task đang xử lý (task.totalProcessRunning), giới hạn cấu hình (task.maxProcess), proxy processes đang chạy. Endpoint quan trọng nhất để giám sát worker.
Health check — GET /health trả về status: "ok", thời gian server, uptime. Go API Backend gọi mỗi 30 giây — không phản hồi 3 lần liên tiếp → worker bị đánh dấu offline.
Đọc file log từ xa — GET /logs?filePath=... đọc log mà không cần SSH. Format path: {service}/{YYYY-MM-DD}/{level}.log. Các service: task-group-cron, cron_proxy, report-task-cron, browser_manager.
📦 Group Task — Tạo và quản lý task groups (đơn vị công việc traffic).
Tạo nhiều task groups — POST /api/task-traffics/multiple — Go API đẩy traffic tasks xuống worker. Body là mảng 2 chiều, mỗi task group chứa nhiều tasks với cấu hình traffic_type (method, only_ads, is_kill, organic_engine, links), traffic_device, device_os, geolocation, page_view. Xác định flow: method=0 → Home Traffic, method=1+only_ads=true → Ads, method=1+is_kill=true → Kill, method=1+engine=2 → CocCoc.
Lấy danh sách task groups — GET /api/task-traffics — Xem toàn bộ hàng đợi. Mỗi task group có status (PENDING=0, PROCESSING=1, COMPLETED=2), proxy đang dùng, user_agent, geolocation.
Xóa tất cả task groups — DELETE /api/task-traffics — Reset hoàn toàn hàng đợi. Thao tác không thể hoàn tác, chỉ dùng khi worker bị kẹt vòng lặp lỗi.
✅ Tasks — Xem và cập nhật kết quả từng phiên Chrome.
Lấy tasks có phân trang và lọc — GET /api/tasks — Filter theo status, project_id, result_status (1=SUCCESS, -1=ERROR, -2=NOT_FOUND, -3=CAPTCHA). Xem rank (thứ hạng SERP), ip_public, execution_time, screenshot_url.
Cập nhật một task — PUT /api/tasks/:id — Worker gọi để lưu kết quả: result_status, rank, ip_public, execution_time, screenshot_url, user_agent.
🌐 Proxies — Quản lý proxy pool nội bộ của Tools V2.
Lấy tất cả proxy records — GET /api/proxies — Mỗi proxy có vòng đời: PENDING (cần rotate) → COMPLETED (sẵn sàng dùng). Xem rotate_url, ip_public, domain_blocks, retry_count.
Reset proxy process counter — POST /api/proxies/reset — Reset bộ đếm khi worker bị crash và counter bị stuck, ngăn proxy mới được xử lý.
📊 Report Tasks — Tạo và quản lý report tasks cho từng domain.
Tạo report tasks cho một domain — POST /api/report-tasks/create — Tạo tasks báo cáo domain đến các tổ chức bảo mật. Chỉ định domain, platforms (mảng ReportPlatform enum), proxyUrl, profileUrl, priority. Mặc định dùng 14 browser-based platforms.
Tạo email-based report tasks — POST /api/report-tasks/create-email — Tạo tasks gửi email trực tiếp đến Kaspersky, Bitdefender, OpenPhish, 80+ nền tảng khác. Cần profile có Gmail App Password.
Lấy report task PENDING tiếp theo — GET /api/report-tasks/next — Worker gọi để lấy task tiếp theo. Sau khi lấy, task chuyển sang IN_PROGRESS. Chỉ 1 task đồng thời, bắt buộc chờ 30 phút giữa các lần.
Cập nhật status của report task — PUT /api/report-tasks/:id — Worker báo cáo kết quả: COMPLETED hoặc FAILED kèm screenshot URL bằng chứng.
Kích hoạt thực thi thủ công — POST /api/report-tasks/trigger — Kích hoạt cron job ngay lập tức, không cần chờ lịch tự động. Dùng khi cần xử lý tasks khẩn cấp.
Lấy report tasks — GET /api/report-tasks — Lấy danh sách report tasks. Endpoint PUBLIC.
Thống kê reports — GET /api/report-tasks/stats — Thống kê tổng hợp: tổng tasks, tỷ lệ thành công/thất bại, phân loại theo platform. Endpoint PUBLIC.
📋 Report Sites — Quản lý cấu hình nền tảng báo cáo.
Lấy danh sách report sites — GET /api/report-sites — Lấy danh sách 100+ nền tảng được cấu hình. Endpoint PUBLIC.
Toggle tất cả sites — POST /api/report-sites/toggle-all — Bật/tắt tất cả sites cùng lúc.
Cập nhật hàng loạt AI prompts — PUT /api/report-sites/bulk-prompts — Cập nhật AI prompts cho nhiều sites cùng lúc.
PC report dashboard — GET /api/report-sites/pc-dashboard — Lấy dữ liệu PC report cho dashboard. Endpoint PUBLIC.
🔍 Search — Tạo và quản lý search tasks để quét thứ hạng từ khóa.
Tạo nhiều search tasks — POST /api/search/multiple — Tạo tasks quét thứ hạng từ khóa. Mỗi task mở Chrome, tìm kiếm và trả về danh sách kết quả kèm thứ hạng (ads[] và search[]). Hỗ trợ Google VN, Google quốc tế, CocCoc.
📸 Report Platforms — Gửi báo cáo đến các nền tảng bảo mật.
Submit report to multiple platforms — Gửi báo cáo đến nhiều nền tảng cùng lúc.
Get available platforms — Lấy danh sách nền tảng báo cáo đang được hỗ trợ (100+ platforms, chia browser-based và email-based).
Get platform statistics — Thống kê tỷ lệ thành công/thất bại theo từng nền tảng.
📡 Monitor — Giám sát tài nguyên hệ thống.
Thông tin tài nguyên hệ thống — GET /api/monitor — Snapshot CPU, RAM, Disk, số Chrome instances, giới hạn cấu hình. Nếu used_session gần bằng total_session, worker đang full capacity.
🪝 Webhooks — Các endpoint webhook luôn PUBLIC, không cần auth.
Lấy proxy cho task — Worker gọi để lấy proxy phù hợp cho task. LUÔN PUBLIC.
Báo cáo kết quả proxy rotation — Worker báo cáo kết quả sau khi rotate proxy. LUÔN PUBLIC.
Lấy profile ngẫu nhiên — Worker lấy profile ngẫu nhiên đang khả dụng để thực thi task. LUÔN PUBLIC.
Cập nhật kết quả thực thi task — Worker gọi sau khi hoàn thành task để báo cáo kết quả. LUÔN PUBLIC.
Gửi kết quả SERP keyword — Worker gửi kết quả SERP của keyword. LUÔN PUBLIC.
Cập nhật trạng thái report task — Cập nhật trạng thái report task. LUÔN PUBLIC.
Lock/Unlock CocCoc token — Lock token để sử dụng độc quyền, unlock để trả về pool. LUÔN PUBLIC.
Modified at 2026-03-31 04:02:18
Previous
Callback Thông báo Hoàn tất Bắn Report AI
Next
Setup Guide
Built with