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
// GitStacks deploys stacks from Git repositories (#37); nil disables them.
GitStacks *gitstacks.Service
// GitAuto handles webhooks of Git stacks (#38); nil answers 501.
GitAuto *gitstacks.Auto
// Webhooks are the incoming webhooks (#85, #91); nil answers 501.
Webhooks *webhooks.Service
// ImageUpdates checks images for newer registry digests (#53); nil disables it.
ImageUpdates api.ImageUpdates
// AutoUpdates is the log of automatic updates (#54); nil disables it.
AutoUpdates api.AutoUpdates
// TrustedProxies are reverse proxies whose X-Forwarded-* headers are honored (#112).
TrustedProxies []netip.Prefix
// ACME serves certificates from an ACME CA (#113); nil when not configured.
ACME *tlsutil.ACME
// Notifications stores notification channels and Notifier sends through them (#86); nil
// disables them.
Notifications api.NotificationStore
Notifier *notify.Service
// Audit records and serves the audit log (#79); nil disables it.
Audit *audit.Recorder
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"`
// ACME describes ACME certificates when configured (#113).
ACME *tlsutil.ACMEStatus `json:"acme,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.