Documentation
¶
Overview ¶
Package app wires configuration, storage, auth primitives and HTTP handlers into a runnable server, and implements the rdpanel command line.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Config *config.Config
Log *slog.Logger
DB *db.DB
Store *store.Store
AEAD *crypto.AEAD
JWT *auth.ClientJWT
Hasher *auth.Hasher
Limiter *auth.Backoff
Registry *prometheus.Registry
SPA *web.SPA
// Events is the in-process pub/sub behind /api/v1/events.
Events *events.Bus
// EventsAuth authenticates SSE streams (panel sessions, set by the admin
// API wiring). nil denies every stream.
EventsAuth events.Authenticator
// HBBS is the hbbs/hbbr integration (presence, admin channel, reconciler).
HBBS HBBS
// Kicks queues admin "disconnect" requests delivered by client heartbeats;
// shared by the client API (Take) and the admin API (Kick).
Kicks *clientapi.MemKickQueue
// TOTP verifies second factors; it implements clientapi's TOTPVerifier
// (Enrolled/Verify) for the client /api/login tfa step.
TOTP *adminapi.TOTPService
// Mail sends e-mail codes and password reset links (internal/mailauth).
Mail *mailauth.Service
// StartedAt is when New ran (About page uptime).
StartedAt time.Time
// Updates is the cached GitHub release check (nil when
// RDPANEL_UPDATE_CHECK=false).
Updates *updatecheck.Checker
// Telemetry holds the login / client-token / audit counters.
Telemetry *metrics.Panel
// contains filtered or unexported fields
}
App holds every long-lived dependency. There are no package-level singletons; handlers receive what they need through their package's Deps.
func New ¶
New opens the database (applying migrations), loads keys and builds the App. Call Close when done.
func (*App) Handler ¶
Handler builds the root HTTP handler:
/healthz, /metrics /api/v1/admin/* panel API (stream B) /api/v1/events SSE (stream C) /api/* RustDesk client API (stream A) /* embedded SPA
type HBBS ¶
type HBBS struct {
Presence *presence.Poller
Control *control.Client
Reconciler *reconcile.Reconciler
// RelayStats samples hbbr "usage" for the relay metrics.
RelayStats *relaystats.Poller
}
HBBS groups the hbbs/hbbr integration. Fields are nil when the integration is disabled (RDPANEL_HBBS_ENABLED=false); Control/Reconciler are also nil when the configured addresses are not loopback (the admin channel only accepts loopback peers).