httpserver

package
v0.0.0-...-6ba12e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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 New

func New(port int, handler http.Handler) *http.Server

New builds the HTTP server for the given port and handler.

func SecurityHeaders

func SecurityHeaders(hsts bool) func(http.Handler) http.Handler

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

type HealthCheck func(ctx context.Context) error

HealthCheck reports process health: nil means database reachable and master key loaded (instance-config §6.6).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL