Documentation
¶
Overview ¶
Package httpserver serves the single control-plane port (ADR-021, instance-config §2.1 AKERDOCK_PORT).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthOnly ¶
func HealthOnly(health HealthCheck, logger *slog.Logger) http.Handler
HealthOnly is the handler of pure worker/scheduler modes: the port serves nothing but /api/v1/health (instance-config §6.1 step 6).
func Robots ¶
Robots answers /robots.txt for the whole control-plane port, before the request can reach the SPA — whose catch-all serves index.html for unknown paths, so a missing robots.txt would come back as HTML with a 200, which a crawler reads as "no rules". Permissive is not the same as absent: this one says so in plain text, to a crawler and to whoever curls it.
It is a middleware rather than a route so the answer does not depend on a dashboard build being embedded: an api-mode instance behind the same FQDN must give the same reply.
func SecurityHeaders ¶
SecurityHeaders hardens every response of the single control-plane port: the dashboard, /auth, the API and /metrics all pass through here.
The policy is written for the dashboard (the only HTML this port serves) and is harmless on JSON: a Content-Security-Policy on an API response constrains nothing — unless a bug ever makes the API reflect HTML, at which point it is exactly the net we want under it.
hsts is derived from the instance FQDN being set, like the Secure cookie flag: promising browsers "always HTTPS" on a plain-HTTP instance would lock the operator out of their own dashboard for the header's max-age.
Types ¶
type HealthCheck ¶
HealthCheck reports process health: nil means database reachable and master key loaded (instance-config §6.6).