connector-go is the runtime daemon used by CPanel for Docker lifecycle, console I/O, files, schedules, metrics, and SFTP.
- Repo: https://github.com/mihai209/Connector
- License: MIT
- Go 1.22+
- Docker engine + Docker CLI
- Linux host
- Optional host tools for archive extraction:
unziptargzip/gunzipbzip2xz
cd /home/mihai/Desktop/cpanel/connector-go
go mod tidy
go build -o cpanel-connector-go ./CONNECTOR_CONFIG=/etc/cpanel-connector/config.json \
VOLUMES_PATH=/var/lib/cpanel/volumes \
./cpanel-connector-go- Connector authentication over WebSocket
- Panic-safe WS handler dispatch (runtime recover + stack log)
- Docker create/start/stop/restart/kill/delete
- Live console stream + command execution (stdin)
- Console command throttling per server (anti-flood)
- File ops:
- list/read/write
- create folder
- rename/delete/chmod
- download
- unarchive in background (
extract_archive)
- Per-server schedule actions
- Runtime metrics + heartbeat
- Runtime health endpoint:
GET /healthz - Runtime readiness endpoint:
GET /readyz(503 when WS to panel is down) - SFTP service with panel-backed auth
{
"panel": {
"url": "https://panel.example.com",
"allowedUrls": ["https://panel.example.com"]
},
"api": {
"allowedOrigins": ["https://panel.example.com"]
},
"connector": {
"id": 1,
"token": "REPLACE_WITH_CONNECTOR_TOKEN",
"name": "node-1"
},
"sftp": {
"host": "0.0.0.0",
"port": 8312,
"directory": "/var/lib/cpanel/volumes",
"hostKeyPath": "/etc/cpanel-connector/sftp_host_rsa.key"
},
"transfers": {
"downloadLimit": 0,
"allowedDownloadHosts": [
"github.com",
"raw.githubusercontent.com",
"codeload.github.com",
"objects.githubusercontent.com",
"mohistmc.github.io",
"api.modrinth.com",
"cdn.modrinth.com",
"modrinth.com"
]
},
"docker": {
"network": {
"name": "cpanel_nw",
"network_mode": "cpanel_nw",
"driver": "bridge",
"interface": "172.18.0.1",
"dns": [],
"enable_icc": true,
"network_mtu": 1500
}
}
}docker.network.dns is optional:
[](or omitted): inherit Docker daemon/host DNS (recommended default)- explicit values: force those resolvers in runtime/install containers
"auto"/"host"/"inherit": alias for inherit mode
transfers.allowedDownloadHosts is an SSRF safety allowlist for remote file downloads.
Only exact hosts from this list are allowed (http/https only).
./cpanel-connector-go --updateChecks: https://github.com/mihai209/Connector/releases
/etc/systemd/system/cpanel-connector-go.service
[Unit]
Description=CPanel Connector (Go)
After=network-online.target docker.service
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/etc/cpanel-connector
Environment=CONNECTOR_CONFIG=/etc/cpanel-connector/config.json
Environment=VOLUMES_PATH=/var/lib/cpanel/volumes
ExecStart=/etc/cpanel-connector/cpanel-connector-go
Restart=always
RestartSec=3
User=root
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now cpanel-connector-go
sudo systemctl status cpanel-connector-go- Panel controls if SFTP is enabled/disabled.
- SFTP username format is per server (
username.random5). - SFTP password is the panel account password.
- Connector fails fast if auth token is invalid.
connector-go este daemon-ul runtime folosit de CPanel pentru Docker lifecycle, consola, fisiere, schedule-uri, metrici si SFTP.
- Repo: https://github.com/mihai209/Connector
- Licenta: MIT
- Go 1.22+
- Docker engine + Docker CLI
- Host Linux
- Optional, utilitare host pentru extract arhive:
unziptargzip/gunzipbzip2xz
cd /home/mihai/Desktop/cpanel/connector-go
go mod tidy
go build -o cpanel-connector-go ./CONNECTOR_CONFIG=/etc/cpanel-connector/config.json \
VOLUMES_PATH=/var/lib/cpanel/volumes \
./cpanel-connector-go- Autentificarea connector-ului pe WebSocket
- Docker create/start/stop/restart/kill/delete
- Stream live de consola + executie comenzi (stdin)
- Operatii fisiere:
- list/read/write
- create folder
- rename/delete/chmod
- download
- unarchive in background (
extract_archive)
- Actiuni schedule per server
- Metrici runtime + heartbeat
- Serviciu SFTP cu autentificare validata de panel
Foloseste exemplul din sectiunea English de mai sus.
./cpanel-connector-go --updateVerifica release-urile din: https://github.com/mihai209/Connector/releases
Foloseste serviciul din sectiunea English de mai sus.
- Panel-ul controleaza daca SFTP este activ sau nu.
- Username-ul SFTP este per server (
username.random5). - Parola SFTP este parola contului din panel.
- Connector-ul da fail fast daca token-ul de autentificare devine invalid.