No description
  • Rust 55%
  • TypeScript 13.3%
  • JavaScript 13.2%
  • Python 9%
  • C 4.5%
  • Other 4.8%
Find a file
2026-07-02 17:42:50 +03:00
agent Fix: install.sh совместимость с Debian 12+ (externally-managed-environment) 2026-06-03 20:25:00 +03:00
backend Fix: убрать фильтр по parent_tenant_id — колонка удалена миграцией 2026-07-01 21:36:05 +03:00
downloads Feat: обновить docker-compose для добавления монтирования папки downloads и добавить скрипт сборки rustdesk-launcher.exe 2026-06-20 07:40:26 +03:00
frontend Fix: Add User — заменить недопустимую роль 'user' на 'viewer/helpdesk/admin' 2026-07-02 17:42:50 +03:00
heartbeat Fix: install-windows.bat в ASCII+CRLF — убираем проблему с кодировкой русского текста 2026-07-01 16:55:40 +03:00
installer Feat: лимиты по плану и grace period 2026-06-28 00:27:42 +03:00
landing Fix: добавить terms.html и privacy.html в Dockerfile лендинга 2026-07-01 11:43:56 +03:00
launcher Feat: добавить поддержку установки heartbeat агента на macOS и обновить интерфейсы для выбора ОС 2026-06-25 13:31:23 +03:00
memory Feat: добавлены документы для домена проекта и верификации email 2026-06-26 14:17:53 +03:00
webclient Fix: увеличить таймаут автоподключения до 2s, добавить auto-password из URL 2026-07-01 09:45:52 +03:00
.gitignore Chore: добавить игнорирование папки rdpro в .gitignore 2026-07-02 11:22:25 +03:00
docker-compose.yml Fix: убрать volume mount heartbeat (файлы уже в образе через COPY) 2026-07-01 16:51:50 +03:00
Dockerfile Feat: SQLite → PostgreSQL + Alembic миграции (Этап 0) 2026-06-26 10:37:58 +03:00
FORK_PLAN.md Docs: план форка RustDesk с поддержкой multi-server адресной книги 2026-06-30 15:36:06 +03:00
migrate_sqlite_to_pg.py Feat: добавить скрипт для миграции данных из SQLite в PostgreSQL 2026-06-26 10:47:49 +03:00
README.md Initial release: RustDesk Manager 2026-06-03 09:41:53 +03:00
README.ru.md Docs: обновить URL в README.ru.md на реальный адрес 2026-06-03 22:09:45 +03:00
SAAS_PLAN.md Plan: добавить этап Web-клиента; убрать rustdesk-web из docker-compose 2026-07-01 10:34:23 +03:00

RustDesk Manager

A self-hosted admin panel that aggregates machines from multiple isolated RustDesk (hbbs) servers into one interface.

Architecture

┌─────────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│   Admin Browser     │────▶│  Central Server  │◀────│  hbbs sync agent │
│  (admin panel UI)   │     │  FastAPI + React  │     │  (on each CT)    │
└────────┬────────────┘     │  Docker :8080     │     └──────────────────┘
         │ localhost:19999  └──────────────────┘
         ▼
┌─────────────────────┐
│  Local Launch Agent │
│  (on admin's PC)    │
└─────────────────────┘

Quick Start

1. Deploy the central server

git clone <repo>
cd rustdesk-manager

# Set a strong password
export ADMIN_PASSWORD=your-strong-password
export SECRET_KEY=$(openssl rand -hex 32)

docker compose up -d

Open http://your-server:8080 — log in with admin / your password.

2. Add a company

  1. Click Add Company in the top-right
  2. Fill in: company name, HBBS host, HBBR host, and optionally the public key
  3. Choose a color for easy identification

3. Get a sync token

  1. Click the gear icon next to your company in the sidebar
  2. Click Generate New — copy the token (shown only once!)
  3. Note the install command shown below the token

4. Install the sync agent on each RustDesk CT

SSH into the machine running hbbs and run:

# Download agent files from the server
curl -O http://your-server:8080/agent/hbbs_agent.py
curl -O http://your-server:8080/agent/install.sh

# Install with your settings
CENTRAL_URL=http://your-server:8080 \
SYNC_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
bash install.sh

The agent will start syncing immediately. Machines appear in the admin panel within 30 seconds.

5. Install the local launch agent on your computer

cd launcher
pip install flask flask-cors
python main.py

Keep this running. Click Connect on any machine to launch RustDesk directly.

For permanent installation, see launcher/README.md.


Project Structure

rustdesk-manager/
├── backend/              FastAPI application
│   ├── main.py           App entrypoint, auth, seed data
│   ├── models.py         SQLAlchemy models
│   ├── database.py       DB engine + session
│   ├── routers/
│   │   ├── companies.py  CRUD for companies
│   │   ├── machines.py   List all machines
│   │   ├── sync.py       Sync endpoint + token generation
│   │   └── connect.py    Connect endpoint
│   ├── requirements.txt
│   └── Dockerfile
├── frontend/             React 18 + Vite + TypeScript + Tailwind
│   ├── src/
│   │   ├── App.tsx       Main app + login
│   │   ├── api.ts        API client + helpers
│   │   └── components/   Sidebar, MachinesTable, modals
│   ├── package.json
│   └── vite.config.ts
├── agent/                hbbs sync agent
│   ├── hbbs_agent.py     Reads hbbs DB, POSTs to central server
│   ├── install.sh        Systemd service installer
│   └── README.md
├── launcher/             Local launch agent
│   ├── main.py           Flask HTTP server on localhost:19999
│   ├── build.sh          PyInstaller build script
│   └── README.md
├── Dockerfile            Multi-stage: builds React → copies into Python image
├── docker-compose.yml
└── data/                 SQLite database (created automatically)

API Reference

All /api/* endpoints require HTTP Basic auth (admin / ADMIN_PASSWORD).
The /api/sync endpoint uses Bearer token auth instead.

Method Endpoint Description
GET /api/companies List all companies
POST /api/companies Create company
PUT /api/companies/{id} Update company
DELETE /api/companies/{id} Delete company
GET /api/companies/{id}/machines List machines for a company
POST /api/companies/{id}/sync-token Generate sync token
GET /api/machines List all machines
POST /api/sync Receive machine list (Bearer token auth)
POST /api/connect Get launch payload for a machine
GET /api/stats Total companies + machines count

Environment Variables

Variable Default Description
ADMIN_PASSWORD admin HTTP Basic auth password
SECRET_KEY changeme-... Application secret key
DB_PATH /app/data/db.sqlite SQLite database path

Development

# Backend
cd backend
pip install -r requirements.txt
DB_PATH=./dev.sqlite ADMIN_PASSWORD=dev uvicorn main:app --reload

# Frontend (in another terminal)
cd frontend
npm install
npm run dev

Frontend dev server at http://localhost:5173 proxies /api to http://localhost:8000.


Notes

  • IP display: hbbs stores IPs as ::ffff:1.2.3.4. The UI automatically strips the IPv6 prefix.
  • Last seen: Uses created_at from the hbbs database (first registration time). The OSS version of hbbs does not record live connection timestamps.
  • Sync token: Stored in the database. Generate a new one to revoke the old one (old tokens remain valid — delete them from the DB if needed).
  • No online/offline status: hbbs OSS does not write connection state to the database. Only "Last seen" (registration time) is shown.