Documentation
¶
Overview ¶
Package server implements the nerdui HTTP API and serves the web UI.
Index ¶
Constants ¶
const APIPrefix = "/api/"
APIPrefix is the path prefix of API routes subject to the default-deny check.
const ContentSecurityPolicy = "default-src 'self'; script-src 'self'; " +
"style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; " +
"connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'"
ContentSecurityPolicy restricts the UI to its own origin. Inline styles are allowed because Mantine sets style attributes; scripts are only loaded from the embedded bundle.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Auth provides sessions and the authentication endpoints (required).
Auth *auth.Service
// Authorizer decides per-action access; defaults to authz.AdminOnly (ADR-0009).
Authorizer authz.Authorizer
// Environments are the managed containerd hosts (required).
Environments *environment.Registry
// UI is the compiled frontend. When nil, the UI is not served.
UI fs.FS
// Jobs runs long operations (#126); when nil, a manager is created (tests).
Jobs *jobs.Manager
// EventHistory serves recorded events (#65); nil when recording is disabled.
EventHistory api.EventHistory
// DisableExec turns off the web terminal (#15).
DisableExec bool
// Settings stores per-environment settings (#176); nil disables them.
Settings api.Settings
// Stacks finds compose stacks (#24); nil disables them.
Stacks *stacks.Service
// ImageUpdates checks images for newer registry digests (#53); nil disables it.
ImageUpdates api.ImageUpdates
Logger *slog.Logger
}
Config configures the HTTP server.
type VersionResponse ¶
type VersionResponse struct {
Nerdui version.Info `json:"nerdui"`
Runtime *runtime.Versions `json:"runtime,omitempty"`
Error string `json:"error,omitempty"`
}
VersionResponse is returned by GET /api/v1/version. Keep in sync with api/openapi.yaml. Build information (including the AGPL source link) is public; runtime details are only returned to callers allowed to perform system:read.