Documentation
¶
Overview ¶
Package web serves the admin UI: templ pages, the embedded static assets and the security headers every response gets.
Phase 0: the component gallery (/design) and, in dev mode only, the UI prototype on fixture data (prototype*.go).
Index ¶
Constants ¶
View Source
const ContentSecurityPolicy = "default-src 'self'; script-src 'self'; style-src 'self'; " +
"img-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'"
ContentSecurityPolicy is sent with every response (security.md). No inline scripts or styles are possible – templates may only use the global classes.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler returns the admin UI handler with all routes and middleware.
Types ¶
type AppDeps ¶
type AppDeps struct {
Auth *auth.Service
Engine *ca.Engine
Keys *keys.Keyring
Presets *preset.Set
Clock clock.Clock
// TrustedProxies may set X-Forwarded-For (auth.trusted_proxies).
TrustedProxies []netip.Prefix
Demo bool
Tenant string // the tenant of this instance (phase 1: one)
// Settings, TenantAudit and InstanceAudit serve the pages of step 19
// (tenant settings, audit log); nil hides those pages.
Settings *tenant.Store
TenantAudit, InstanceAudit *sql.DB
}
AppDeps are the services of the real UI.
type Options ¶
type Options struct {
// Dev shows the DEV MODE banner on every page and enables the UI
// prototype on fixture data.
Dev bool
Logger *slog.Logger
// App, if set, serves the real UI on the services (phase 1 step 14)
// instead of the gallery; Dev and App are exclusive.
App *AppDeps
}
Options configure the handler.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
Package fixture provides fixed sample data for the UI prototype in dev mode.
|
Package fixture provides fixed sample data for the UI prototype in dev mode. |
|
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
pages
|
|
|
admin
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
authorities
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
certificates
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
design
Package design renders the component gallery at /design: every CSS class of web/styles is shown with realistic sample data (frontend.md).
|
Package design renders the component gallery at /design: every CSS class of web/styles is shown with realistic sample data (frontend.md). |
|
overview
templ: version: v0.3.1070
|
templ: version: v0.3.1070 |
|
Package view holds the types shared by the shell, components and pages: page metadata, the user's appearance preferences, status values and date formatting.
|
Package view holds the types shared by the shell, components and pages: page metadata, the user's appearance preferences, status values and date formatting. |
Click to show internal directories.
Click to hide internal directories.