Repository navigation
EN Admin Backend
Andrewkydev edited this page Aug 25, 2026
·
2 revisions
Русский: RU-Admin-Backend
Admin is an optional management backend, not a required part of the bot runtime.
It implements bootstrap v1/v2, principals/RBAC, web grants and sessions, users/chats/plugins/settings, logs/audit/SSE/metrics, declarative UI, Control WebSocket, and durable operations with progress reporting.
server := api.NewWithDependencies(api.Dependencies{
App: app, Store: store, Plugins: app.Plugins(), Logs: stream, Logger: logger,
Auth: verifier, Authorization: policy,
})
if err := server.RegisterPluginModules(app.Plugins()); err != nil {
log.Fatal(err)
}
defer server.Shutdown(context.Background())
log.Fatal(server.Listen("127.0.0.1:8080"))In production, provide Auth, Authorization, durable identity/session repositories, and the required Control/operations dependencies.
- Without
Auth, protected requests fail closed with401 Unauthorized. - For unauthenticated local development, use
api.NewInsecureDevelopmentServer()or setInsecureDevelopmentexplicitly. ItsListenmethod accepts only an explicit loopback host. -
NewHTTPServerandServeHTTPdo not validate the bind address themselves; provide auth or an external network boundary. - The static verifier is suitable only for development and compatibility use.
- Never put web grants, session tokens, or Control tickets in URLs or logs.
- Call
RegisterPluginModulesbefore serving; a registration error is fatal. -
Shutdown(ctx)closes maintenance tasks, operations, Control sockets, and the audit dispatcher.
The admin frontend and demo application are maintained in separate repositories.