Preface¶
When developing agents with DeepSeek Harness, if a BT Panel (bt.cn) Linux management panel is deployed on the server, every ops operation requires navigating to the web UI or running commands manually over SSH. BT Panel does expose public API endpoints, but they require separate key configuration and signature handling. When an agent calls them directly, it often runs into IP verification, session verification, and other issues.
The dsh-baota-panel plugin lets you integrate one or more BT Panel instances into DSH using a single API key. The Host side runs inside the DSH main process, responsible for calling the BT Panel API and exposing 13 tools. The Client side runs inside the DSH Web UI, providing a sidebar dashboard and a settings entry point.
Plugin Architecture¶
This plugin is a DSH bundle that operates in two halves:
| Half | Runs In | What It Does |
|---|---|---|
| Host | DSH main process (Node) | Signs requests with md5(request_time + md5(api_key)) timestamps to call the BT Panel API directly, exposes 13 agent tools, and pushes read-only data to the frontend via typert Remote |
| Client | DSH Web UI (React) | Sidebar panel entry + status dashboard + settings page |
The sidebar entry is registered through DSH’s sidebar.panellist slot (id baota), the central panel uses the main slot (key baota), and the settings page uses settings.section (id baota).
Multi-Panel Support¶
The plugin supports managing multiple BT Panel instances. Each panel has its own address, API key, security entrance, and certificate policy, and can be added or removed from the settings page.
Each panel configuration includes:
- Display name
- Panel address (root address with port, without security entrance)
- API key
- Security entrance (optional)
- Verify TLS certificate (boolean)
In the settings page you can:
- Add a panel
- Remove a panel
- Select one for editing
- Set it as the current panel (a switch dropdown appears at the top of the sidebar dashboard)
- Toggle the “Show in Sidebar” switch
Changes are saved instantly—there is no save button. Input fields are written on a 0.45-second debounce or on blur. The panel list is stored in the plugin’s own state file at ~/.dsh/baota-panel/state.json, written atomically, with no plugin restart and no full page reload required.
All tools accept an optional panel parameter (panel id or name); when omitted, the current panel is used. The bt_panels tool lists all configured panels.
Sidebar Dashboard¶
The sidebar panel provides a real-time status dashboard, including:
- CPU usage (with core count)
- Memory usage
- System load
- Real-time network throughput
- Disk partition usage (bytes / percentage)
- Website list (id, name, path, running status, type)
- Database list
- Installed services (nginx / MySQL / PHP versions and status)
One-click refresh is supported. If any data source fails, it reports the error individually without blanking the entire page.
Settings Page¶
The “BT Panel” section in the settings page is used to manage the panel list. Each panel shows its name, panel address, API key (leave blank to keep unchanged), security entrance, and a “Verify TLS” toggle. The “Show in Sidebar” toggle controls whether the sidebar entry is visible.
The panel list is stored in the plugin’s own state file at ~/.dsh/baota-panel/state.json. The showInSidebar field is also in this file; changes take effect after a page refresh.
Agent Tools¶
The plugin provides 13 agent tools (all except bt_panels/bt_config/bt_selftest accept a panel parameter):
| Tool | What It Does |
|---|---|
bt_panels |
List configured panels (id, name, host, whether fully configured) |
bt_system |
Overview / disk / load / network / software stack / raw system info |
bt_site |
List, create, start/stop, delete, access logs, query/change PHP version, domain list/add/remove, SSL status/disable, force HTTPS toggle, rewrite template, create backup, backup list |
bt_database |
List, create, delete, change password, create/list backups, running status, MySQL users, error log / slow log, access sources |
bt_ftp |
List, create, delete, change password, enable/disable |
bt_file |
Directory browse, read, write, mkdir, delete, directory size, permissions/ownership |
bt_crontab |
List, add, delete, view single entry, execution log |
bt_service |
Software stack list, restart/reload service, reload panel web, free memory |
bt_logs |
Panel operation logs |
bt_firewall |
Firewall rules (this route on the local panel requires a browser session) |
bt_config |
Add/remove/modify panels, switch current panel, sidebar toggle |
bt_selftest |
Diagnostics: self-test via the same Remote gateway chain a browser would use |
bt_api |
Fallback: call any panel API action directly |
Installation & Activation¶
In DSH, go to Plugins → Add Plugin and select this repository’s directory (or the package directory after a pnpm install).
Open Settings → BT Panel, click “Add Panel”, fill in the panel address and API key, then click “Set as Current”. For multiple panels, repeat this step.
A “BT Panel” entry will appear in the sidebar, with a panel switcher in the top-right corner of the dashboard. To hide it, turn off “Show in Sidebar”—the entry disappears but all tools remain available.
You can also install via command line:
git clone <this repo> dsh-baota-panel
# Then add C:\path\to\dsh-baota-panel in the DSH plugin page
Configuration Example¶
Plugin configuration example (YAML):
- id: dsh-baota-panel
name: dsh-baota-panel
config:
panels:
- id: main
name: 主面板
panelUrl: 'https://panel.example.com:4439' # Root address with port, no security entrance
apiKey: 'your-api-key-here'
securityEntrance: '' # Optional, e.g. ghostxx
verifyTls: false # Panels typically use self-signed certs
- id: backup
name: 备用面板
panelUrl: 'https://203.0.113.10:8888'
apiKey: 'another-panel-key'
verifyTls: false
activePanel: main
showInSidebar: true
requestTimeoutMs: 20000
BT Panel-Side Configuration¶
Three things must be done on the panel side:
- Enable the API: Panel → Settings → Panel Settings → API Interface → Enable, then copy the API key.
- Register the IP whitelist: In the same “IP Whitelist” field, add the public outbound IP of the machine running DSH (or use
*to allow all). If not registered, the panel returnsIP verification failed, your access IP is [x], and the plugin passes this message verbatim to the user. - Prevent the panel from treating the request as a spider: The panel’s
is_spider()function willabort(404)on non-browser User-Agents. This plugin uses a fixed browser UA.
Known Limitations¶
Verified against BT Panel for Linux 13.2.0:
- The API lives at the root path:
https://host:port/system?action=.... Appending the security entrance to the URL triggers a “security entrance verification failed” error; the entrance is only checked as a Referer on a few routes (firewall, panel logs)—fill it intosecurityEntranceto handle that. /firewalland/logsonly serve logged-in browser sessions in some versions; API calls will return the panel’s own “security entrance verification failed” page.bt_firewallreports the error as-is;bt_logsfalls back to/data?action=getData&table=logs.- Website/database/log lists use the generic data endpoint
/data?action=getData&table=sites|databases|logs, not/site?action=GetSiteList(the latter returns “invalid parameter” on this version). - The service list comes from
GetConcifInfo(webserver / mysql / php setup + status); the panel does not expose a systemd list usable via the API. - Sensitive fields like
mysql_rootare never exposed:GetConcifInforeturns the MySQL root password, but the plugin only extracts software-stack fields—the password never enters tool results or the frontend. - File reads are capped at 200,000 characters per call; for larger files, use
bt_apito read in chunks manually. - Panel versions vary significantly: tools internally try multiple action names for the same operation in sequence, and if all fail, the panel’s raw error is returned; use
bt_apito specify the exact action.
Security & Permissions¶
The API key is stored in the profile’s plugin configuration (consistent with how the panel itself stores its key in api.json). To avoid plaintext on disk, you can reset the key in the panel, enter it only in the settings page, and reset it again after use.
The plugin does not log in to the panel, does not proxy panel web pages, and only calls the panel API; what it can do is entirely determined by the panel API’s permissions.
bt_site delete, bt_database delete, bt_file delete, and bt_service restart are write operations—confirm the target before calling them.
Use Cases¶
Ideal for users who already use BT Panel and want to perform ops operations directly within a DeepSeek Harness agent. The plugin runs with the current dsh process permissions; review the source code and license before installing.
Closing¶
Take control of your BT Panel with an API key and let your agent manage the server directly. Plugin repository: https://github.com/ghost-xx/dsh-baota-panel