@softtynet/zplus-worker
v1.0.33
Published
ZPlus 24/7 Headless Social Automation Worker & AI Omnichannel Sentinel
Readme
@softtynet/zplus-worker
ZPlus 24/7 Headless Automation & Omnichannel Worker Daemon.
🌟 Giới Thiệu (Introduction)
@softtynet/zplus-worker là tiến trình chạy nền độc lập 24/7 cho hệ sinh thái ZPlus Enterprise. Phân hệ chịu trách nhiệm duy trì phiên kết nối mạng xã hội (Zalo, Facebook Messenger, Telegram, WhatsApp...), tiếp nhận tin nhắn và thực thi kịch bản tự động hóa liên tục ngay cả khi người dùng tắt máy tính cá nhân.
- 100% Headless: Chạy trên mọi VPS Linux không cần màn hình hay trình duyệt.
- Bảo Mật SSO / RBAC: Đăng nhập bằng Softty ID, không cần API Key backend.
- Gatekeeper Tự Động: Chỉ Team Owner sở hữu gói Enterprise mới được cấp quyền kích hoạt.
- Ghép Nối 1-Click: Tạo mã ghép nối trực tiếp từ ZPlus Desktop.
🚀 Hướng Dẫn Nhanh (Quickstart)
⭐ Cách 1: Cài Đặt Tự Động 1 Dòng Lệnh Đa Nền Tảng (1-Line Auto Installer - Khuyên Dùng)
🪟 Trên Windows (Windows 10, Windows 11, Windows Server):
Mở PowerShell và chạy:
& { irm https://zplus.softty.net/install.ps1 | iex } -pair "<TOKEN_TỪ_DESKTOP>"Tự động cài Node.js, thiết lập Task Scheduler (
onstart). Mất điện hay khởi động lại máy thì Worker tự động chạy ngầm ngay từ màn hình boot.
🐧 Trên Linux VPS & 🍎 macOS:
Mở Terminal và chạy:
# Cài đặt tự động bằng Systemd/LaunchAgent (Khuyên dùng):
curl -fsSL https://zplus.softty.net/install.sh | bash -s -- --pair="<TOKEN_TỪ_DESKTOP>"
# Hoặc cài đặt tự động bằng Docker Container:
curl -fsSL https://zplus.softty.net/install-docker.sh | bash -s -- --pair="<TOKEN_TỪ_DESKTOP>"Cách 2: Cài Đặt Toàn Cục Bằng NPM & Vận Hành Thủ Công
# Cài đặt qua NPM
npm install -g @softtynet/zplus-worker
# Hoặc chạy trực tiếp qua NPX:
npx @softtynet/zplus-worker helpĐăng nhập cho Worker trên VPS (Không cần Browser)
Cách A: Ghép nối 1-Click từ ZPlus Desktop (Khuyên dùng)
Trên ZPlus Desktop: Vào Cài Đặt $\rightarrow$ Worker & VPS Cluster $\rightarrow$ Bấm Tạo Lệnh Ghép Nối 1-Click Cho VPS và dán lệnh vào VPS:
npx @softtynet/zplus-worker login --pair="<TOKEN_TỪ_DESKTOP>"Cách B: Đăng nhập bằng tài khoản Softty ID qua SSH Terminal
npx @softtynet/zplus-worker login --email="[email protected]" --password="mat_khau_tai_day"Kiểm tra trạng thái xác thực & phân quyền
npx @softtynet/zplus-worker statusKhởi chạy 24/7 với PM2
npm install -g pm2
pm2 start zplus-worker --name "zplus-worker" --time
pm2 save && pm2 startup📖 Bảng Lệnh CLI (Command Cheatsheet)
| Lệnh | Ý nghĩa |
| :----------------------------------- | :------------------------------------------------------------------- |
| zplus-worker help | Hiển thị bảng trợ giúp và các tùy chọn |
| zplus-worker status | Kiểm tra trạng thái đăng nhập, vai trò Owner/Member, gói Enterprise |
| zplus-worker doctor | Chẩn đoán sức khỏe toàn diện: OS, RAM, Cloud API, Cổng Ingress, File |
| zplus-worker health (hoặc ping) | Kiểm tra nhịp tim: Uptime, Nick đang chạy WSS, RAM chiếm dụng |
| zplus-worker logs | Xem trực tiếp live logs tiến trình nền đang chạy (PM2 / Docker) |
| zplus-worker restart | Khởi động lại dịch vụ Worker nền an toàn |
| zplus-worker login | Đăng nhập tài khoản Softty ID |
| zplus-worker login --pair="<CODE>" | Ghép nối 1-Click từ Desktop Client |
| zplus-worker logout | Đăng xuất và xóa phiên lưu trữ trên máy chủ |
| zplus-worker uninstall | Dừng tiến trình PM2/Docker/Systemd và gỡ bỏ Worker an toàn |
| zplus-worker uninstall --purge | Gỡ bỏ hoàn toàn kèm xóa sạch cache, dữ liệu & logs (~/.zplus) |
| zplus-worker (mặc định) | Khởi chạy Worker Daemon 24/7 |
💡 Gỡ cài đặt 1-Click tự động: Bạn cũng có thể chạy lệnh sau trên VPS:
curl -fsSL https://zplus.softty.net/uninstall.sh | bash(hoặc thêm--purgeđể xóa toàn bộ dữ liệu).
⚙️ Biến Môi Trường (Environment Variables)
| Biến | Mặc định | Mô tả |
| :-------------------- | :-------------------------- | :-------------------------------------------- |
| PORT | 8080 | Cổng HTTP Ingress & Healthcheck (/health) |
| WORKER_ID | worker_<pid> | Tên định danh duy nhất của Worker Node |
| TEAM_ID | default | ID của Team sở hữu Worker |
| DATA_DIR | ~/.zplus | Thư mục lưu phiên đăng nhập và cache tin nhắn |
| APPWRITE_ENDPOINT | https://api.softty.net/v1 | URL Appwrite Cloud Backend |
| APPWRITE_PROJECT_ID | 699cfc3100136099c1c1 | Project ID của hệ thống Softty |
📄 Tài Liệu Chi Tiết
Xem tài liệu hướng dẫn vận hành chi tiết từ A đến Z tại:
👉 Hướng Dẫn Vận Hành & Triển Khai Worker 24/7 (docs/02-guides/huong_dan_su_dung_worker.md)
© 2026 SOFTTY.NET COMPANY LIMITED.
