An advanced WebSSH solution capable of managing multiple servers (Serv00 nodes) in a distributed Master/Slave architecture.
- Distributed Architecture: Supports Master (Controller) and Slave (Worker) modes.
- Unified Dashboard: View status of all connected nodes (CPU, RAM, Disk, Process) in a single Master dashboard.
- Smart Connection: One-click SSH login to any Slave node using pre-configured credentials.
- System Monitoring: Real-time probe using
psutilto monitor system resources. - Secure Communication: Inter-node communication is secured with a Secret Token.
- Easy Deployment: One-key setup script (
setup.sh) for quick configuration.
- Python 3.7+
- Dependencies:
pip install -r requirements.txt
Run the interactive setup script to configure the node:
bash setup.shFollow the prompts to select master, slave, or standalone mode and configure external URLs and passwords.
The Master node hosts the dashboard and manages the registry of slaves.
python run.py --mode=master \
--port=8888 \
--secret=YOUR_CLUSTER_SECRET \
--auth_password=DASHBOARD_LOGIN_PASSWORD- Access Dashboard:
http://localhost:8888
Slave nodes provide WebSSH access and report system stats to the Master.
python run.py --mode=slave \
--port=8880 \
--secret=YOUR_CLUSTER_SECRET \
--master_url=http://MASTER_IP:8888 \
--external_url=http://SLAVE_IP:8880 \
--ssh_host=localhost \
--ssh_port=22 \
--ssh_user=root \
--ssh_password=root_password--mode: Run mode (master,slave,standalone). Default:standalone.--secret: Shared secret token for verifying slave-master communication.--auth_password: Password for accessing the Master Dashboard.--master_url: URL of the Master node (for Slaves).--external_url: The public-facing URL of this node (used by Master to redirect users).--ssh_*: Pre-configure SSH credentials for Smart Link (Auto-Connect).
The Master Dashboard (/) displays:
- List of online/offline nodes.
- Real-time CPU/RAM/Disk usage.
- "Connect" button for instant WebSSH access to the node.
- Secret Token: Ensure
--secretis complex and consistent across all nodes. - HTTPS: Recommend running behind Nginx with SSL, especially when using Smart Link which passes credentials in URL.
The project includes GitHub Actions workflows for automated maintenance.
- Schedule: Runs every 30 minutes.
- Function: Checks SSH connectivity of all nodes in
SERVERS_JSON. - Alerts: Sends notifications to Telegram if nodes are down.
- Configuration: Requires
SERVERS_JSONandTELEGRAM_JSONsecrets.
- Trigger: Manual (
workflow_dispatch). - Function: Rotates the
--secrettoken across all nodes (Slaves first, then Masters). - Usage:
- Set
SECRET_TOKENin Repository Variables. - Run workflow to automatically update all nodes via SSH and restart PM2 processes.
- Set
- Trigger: Manual (
workflow_dispatch). - Function: Updates the
--auth-passwordfor the Master Dashboard. - Usage:
- Set
MASTER_PASSWORDin Repository Variables. - Run workflow to update the Master node's login password.
- Set
JSON array format for server connection details:
[
{
"host": "1.2.3.4",
"port": 22,
"username": "root",
"password": "ssh_password",
"role": "master",
"path": "/path/to/webssh"
}
]JSON object for Telegram Bot configuration (used by Health Check):
{
"token": "123456789:ABCdefGHIjklMNOpqrsTUVwx_yz",
"chat_id": "987654321"
}This roadmap outlines the next phase of evolution for the WebSSH Cluster, transforming it from a "Server Manager" into a lightweight "PaaS (Platform as a Service)" for Python applications.
Goal: Visualize and manage running applications on all nodes.
- Process List: Dedicated "Apps Manager" page for each node showing PM2 process status, CPU, RAM, and Uptime.
- Process Control: Real-time
Start,Stop,Restart, andDeletecontrols via Cyberpunk UI. - Logs Viewer: Built-in logs panel to view output for any selected application.
Goal: Deploy a repo from GitHub to a specific node with zero terminal interaction.
- Deployment Wizard:
- Input: GitHub Repo URL.
- Input: Branch (default: main).
- Input: Project Name (App name).
- Input: Run Command (e.g.,
python app.py).
- Backend Automation (via SSH):
- Clone:
git clone <repo>to~/domains/<project>. - Install: Auto-detect
requirements.txt(pip) orpackage.json(npm) and install dependencies. - Run: Register with PM2:
pm2 start <cmd> --name <project>.
- Clone:
- Auto-Update: "Pull & Restart" button to update code from the latest commit.
Goal: Automatically assign available ports to new applications.
Context: Ports and Domains are pre-configured/reserved (e.g., via
setup_proxy). The goal is to find an unused one for the new deployment.
- Port Discovery:
- Fetch reserved ports via
devil port list.
- Fetch reserved ports via
- Idle Detection:
- logic: Check which of remaining reserved ports is NOT currently listening (using
sockstatorlsoflogic). - Find the first "Idle" port.
- logic: Check which of remaining reserved ports is NOT currently listening (using
- Assignment:
- Pass this idle port as an environment variable (e.g.,
PORT=12345) to the new PM2 process.
- Pass this idle port as an environment variable (e.g.,
Goal: Automate deployments via GitHub Actions.
- Webhook Endpoint: Create a Master API endpoint to receive GitHub Webhooks.
Special thanks to the following open-source projects that make this possible:
- Tornado: A scalable, non-blocking web server and web framework.
- Paramiko: A native Python SSHv2 protocol implementation.
- psutil: Cross-platform process and system monitoring.
- huashengdun/webssh: The original WebSSH project foundation.
This project is open-sourced software licensed under the MIT license.