How lejianwen/rustdesk-api works
RustDesk API is a Go service with PC-facing APIs, Web Admin endpoints, and a bundled Web Client. The principal flow is a client request routed through Gin middleware and controllers to domain services, which manage users, peers, address books, sharing, OAuth, and audit data. The Web Client configuration endpoint supplies server settings and address-book/share payloads for remote access. The README also documents user/device administration, LDAP and OAuth login, logs, server commands, and internationalization. Edges are limited to relationships demonstrated by excerpts or README statements; unsampled modules are represented only where their role is documented.
Main entry points: service.go Domain services · webClient.go Web client config · http.go HTTP bootstrap · admin Admin API
Components 26
HTTP runtime
- PC API routes
http/router/api.go - Admin routes
http/router/admin.go - Web routes
http/router/router.go - HTTP bootstrap
http/http.go - Request middleware
http/middleware
Identity
- PC API users
http/controller/api/login.go - PC API
http/controller/api - OAuth providers
service/oauth.go - LDAP login
service/ldap.go - Users and tokens
model/user.go
RustDesk data
- Domain services
service/service.go - Peers and address books
model/addressBook.go - Groups and tags
model/group.go - Shares and logs
model/shareRecord.go - Relational database
lib/orm/sqlite.go
Admin and operations
- Admin API
http/controller/admin - Audit and commands
service/audit.go - Translations
global/i18n.go
Web client
- Web client config
http/controller/api/webClient.go - Web client assets
resources/web/js/src/main.ts - Web entry and config
http/controller/web/index.go
Other components
- Web client user
- RustDesk PC client
- Admin user
- OAuth provider
- RustDesk server
Connections 28
- HTTP bootstrap → Request middleware: installs
http/http.go - HTTP bootstrap → Web routes: registers
http/http.go - HTTP bootstrap → Admin routes: registers
http/http.go - HTTP bootstrap → PC API routes: registers
http/http.go - Admin routes → Admin API: routes to
http/router/admin.go - Web routes → Web entry and config: routes to
http/router/router.go - Web routes → Web client assets: serves
http/router/router.go - RustDesk PC client → PC API routes: requests
README.md - Admin user → Admin routes: manages
http/router/admin.go - Web client user → Web routes: opens
http/router/router.go - PC API routes → PC API: dispatches
- PC API → Domain services: uses
- Admin API → Domain services: uses
http/controller/admin/oauth.go - Web client config → Domain services: loads peers
http/controller/api/webClient.go - Web client config → Peers and address books: formats payload
- Web client config → RustDesk server: returns settings
http/controller/api/webClient.go - Domain services → Relational database: persists domain data
- Domain services → Users and tokens: manages
- Domain services → Peers and address books: manages
- Domain services → Groups and tags: manages
- Domain services → Shares and logs: manages
- Admin API → Audit and commands: supports
- PC API users → OAuth providers: authenticates with
- PC API users → LDAP login: authenticates with
- OAuth providers → OAuth provider: authorizes
- Web entry and config → Web client config: configures client
- Web client config → Shares and logs: resolves share
http/controller/api/webClient.go - Admin API → Translations: translates messages
http/controller/admin/oauth.go