Documentation
¶
Overview ¶
Package web provides the HTTP server for the Orbit web interface.
Index ¶
- Constants
- func PathSanitizer(next http.Handler) http.Handler
- func SecurityHeaders(next http.Handler) http.Handler
- func ValidateUUID(paramName string) func(http.Handler) http.Handler
- type Config
- type DashboardData
- type ErrorData
- type PhaseView
- type RelatedVariant
- type RepositoryGroup
- type RunDetailData
- type RunSummary
- type Server
- type TemplateData
- type TranscriptData
Constants ¶
const CSSVersion = "4"
CSSVersion is used for cache busting. Bump when CSS changes.
Variables ¶
This section is empty.
Functions ¶
func PathSanitizer ¶
PathSanitizer rejects requests with path traversal attempts. Returns 404 for paths containing ".." to prevent directory traversal.
func SecurityHeaders ¶
SecurityHeaders adds security headers to all responses. Headers added: - X-Content-Type-Options: nosniff - X-Frame-Options: DENY - Referrer-Policy: no-referrer - Content-Security-Policy (for HTML responses only)
Types ¶
type Config ¶
type Config struct {
Port int // Default: 8080
Bind string // Default: "localhost"
Registry *registry.Registry
}
Config holds web server configuration.
type DashboardData ¶
type DashboardData struct {
TemplateData
Repositories []RepositoryGroup
Empty bool
}
DashboardData is passed to dashboard.html.
type ErrorData ¶
type ErrorData struct {
TemplateData
Code int
Message string
}
ErrorData is passed to error.html.
type RelatedVariant ¶
RelatedVariant represents another variant from the same run.
type RepositoryGroup ¶
type RepositoryGroup struct {
Name string
Runs []RunSummary
}
RepositoryGroup groups runs by repository.
type RunDetailData ¶
type RunDetailData struct {
TemplateData
Run *registry.RunEntry
Phases []PhaseView
Duration string
StartedAt string
FinishedAt string
Summary *logs.Summary
Missing bool
HasPostCompletion bool
// Variant-specific fields
IsVariant bool
VariantID int
VariantTotal int
VariantAgent string
VariantBranch string
RelatedVariants []RelatedVariant
}
RunDetailData is passed to run_detail.html.
type RunSummary ¶
type RunSummary struct {
ID string
Name string
Branch string
Status string
StartedAt string
IsVariant bool
VariantAgent string
// contains filtered or unexported fields
}
RunSummary is a summary of a run for the dashboard.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP server for the web interface.
type TemplateData ¶
TemplateData is the base data for all templates.