Documentation
¶
Overview ¶
Package web is the driving HTTP adapter: it serves the Templ + htmx UI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCSRFToken ¶
func NewCSRFToken() string
NewCSRFToken returns a random per-process CSRF token.
func Secure ¶
Secure rejects requests that did not come from a page served on localhost: the Host and Origin headers must name a loopback host (a DNS-rebinding defence), the browser must not mark the request as coming from another site, and every mutating request must carry the CSRF token in the X-CSRF-Token header or a csrf_token form field.
Types ¶
type Deps ¶
type Deps struct {
// CSRFToken must accompany every mutating request.
CSRFToken string
Review *review.Service
Settings settings.Store
Hub *live.Hub // live updates for open pages
Servers *servers.Service
ThemesDir string // drop-in Themes; may be empty
Metrics *metrics.Collector // optional: the Settings page's Activity panel
// Dev relaxes the Content-Security-Policy for a live-reload proxy.
Dev bool
}
Deps are what the Server serves from.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.