Repository navigation
Conversation
…tegration Eliminate the intermediary node agent layer and have Console call hbbs/hbbr management APIs directly. The server registry is now stored in the database with a CRUD API instead of a static RUSTDESK_NODES environment variable, allowing nodes to be added or removed without a backend restart. Key changes: - Add ServerNode entity (role, name, url, managementToken, status) and ServerBanPolicy entity for persistent ban policy storage - Add migration 1790985600002 creating server_nodes and server_ban_policies tables for both SQLite and MySQL - Rewrite ServerManagementService to call hbbs/hbbr management APIs directly using the registered node's URL and token, removing the ConfigService dependency on RUSTDESK_NODES - Add ban fan-out: PUT /api/servers/bans distributes policy to all registered nodes and reports per-node applied/pending synchronization - Add ServerHealthService with @interval(30000) polling each server's /v1/status and updating the status column - Add servers.manage permission for server registry CRUD operations - Remove agent/ directory (app.mjs, docker.mjs, index.mjs, schema.json, Dockerfile, tests) and the agent-build CI job - Remove Docker socket mount from the integrated deployment; Console reaches hbbs/hbbr management ports over the internal Docker network - Remove container lifecycle endpoints (start/stop/restart/apply) and Docker log endpoint; container orchestration is handled by the deployment layer - Update integrated Compose to remove the rustdesk-agent service - Update CI workflow to remove agent tests and agent image build - Update docs and environment examples for the new architecture
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the intermediary node agent layer with direct Console-to-server API integration. Console now calls hbbs/hbbr management APIs directly, eliminating the agent process, Docker socket mount, and container recreation logic.
Motivation
PR #396 introduced a three-layer architecture: Console → Node Agent → Docker → hbbs/hbbr. The agent was a pure middleman for most operations (status, config, peers, sessions, bans), adding a network hop and failure point with no value. It required Docker socket access (equivalent to host root), used a static
RUSTDESK_NODESenvironment variable for node configuration, and could not natively support the 1 hbbs + n hbbr topology across multiple hosts.Changes
ServerNodeentity (server_nodestable) with UUID primary key, role (hbbs/hbbr), name, management API URL, and management token. URLs and tokens useselect: falseto prevent accidental credential exposure. Nodes are managed via CRUD API — no restart needed to add or remove servers.ServerBanPolicyentity (server_ban_policiestable) as the single source of truth.PUT /api/servers/bansfans out to all registered nodes and reports per-nodeapplied/pendingsynchronization.ServerManagementServicecalls hbbs/hbbr/v1/*endpoints directly using the registered node's URL and Bearer token. No agent hop.ServerHealthServicewith@Interval(30000)polls each server's/v1/statusand updates thestatus(online/offline/degraded) andlastCheckedAtcolumns.servers.managefor server registry CRUD operations.agent/directory (app.mjs, docker.mjs, index.mjs, schema.json, Dockerfile, tests),RUSTDESK_NODESenv var, Docker socket mount, container lifecycle endpoints (start/stop/restart/apply), Docker log endpoint, agent-build CI job.1790985600002-AddServerNodescreatesserver_nodesandserver_ban_policiestables for both SQLite and MySQL.API
/api/serversservers.view,servers.manage/api/servers/:idservers.manage/api/servers/:id/peersservers.view/api/servers/:id/sessionsservers.view/api/servers/:id/sessions/:uuidservers.disconnect/api/servers/:id/configservers.config/api/servers/bansservers.banTopology
The create endpoint enforces at most 1 hbbs node and at most 100 total nodes, matching the 1 APIServer + 1 hbbs + n hbbr client constraint.
CI scope
Removed the
agent-buildjob and thenode --test agent/*.test.mjsstep from the test job. Backend tests cover the direct-connect service, ban fan-out, topology enforcement, and permission requirements. No local compilation, application execution, or tests were performed.Companion pull requests