diff --git a/deployments/README.md b/deployments/README.md index 5a1fd1b23..dd97668e3 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -76,6 +76,14 @@ A non-loopback `[web].listen` requires a dashboard token (`-token`, or binding-dispatch loop in `archied` consumes what arrives from the shared State Store. +The dashboard speaks plain HTTP. A non-loopback bind therefore carries the +session cookie and the provider token in clear over the network, and +archie-ui warns about exactly that at startup. Terminate TLS in front of it +(a reverse proxy or the tunnel itself) and set +`[web].trust_forwarded_headers = true` to declare the proxy and silence the +warning; leaving it off while exposing the port directly is the case the +warning names. + Auth note: unlike `archied`, archie-ui has no secret registry -- `GATEWAY_TOKEN`/`STATE_STORE_TOKEN` resolve from its process environment only (or from `[services.*].target_token` in `config.toml`), so whatever diff --git a/internal/app/archieui/config.go b/internal/app/archieui/config.go index 4af7d41e0..28ecd4aef 100644 --- a/internal/app/archieui/config.go +++ b/internal/app/archieui/config.go @@ -176,7 +176,7 @@ func (o Options) validate() error { } if !webui.IsLoopback(o.Listen) && o.Token == "" { return fmt.Errorf( - "ui listen address %q is non-loopback; a reachable dashboard requires a token (-token) or a token file to mint one (-token-file) (docs/prds/ui-service-boundary.md, listen and authentication)", + "ui listen address %q is non-loopback; a reachable dashboard requires a token (-token) or a token file to mint one (-token-file) (deployments/README.md, running the dashboard)", o.Listen, ) } diff --git a/internal/app/archieui/run.go b/internal/app/archieui/run.go index bbea6abf4..9d6b7cd7d 100644 --- a/internal/app/archieui/run.go +++ b/internal/app/archieui/run.go @@ -54,6 +54,7 @@ func Run(ctx context.Context, options Options) error { if err != nil { return err } + warnPlainHTTP(log, opts) var cleanups []func() defer func() { for _, cleanup := range slices.Backward(cleanups) { @@ -132,6 +133,19 @@ func Run(ctx context.Context, options Options) error { return serve(ctx, listener, srv.Handler(), opts) } +// warnPlainHTTP names the exposure of a dashboard published off-host. The +// process serves plain HTTP, so the session cookie and the provider token +// cross the network in clear unless a TLS-terminating proxy sits in front of +// it -- which [web].trust_forwarded_headers declares. A loopback bind is +// reached over a tunnel or on the host, so it needs no warning. +func warnPlainHTTP(log *slog.Logger, opts Options) { + if webui.IsLoopback(opts.Listen) || opts.trustForwardedHeaders() { + return + } + log.Warn("dashboard is reachable off-host over plain HTTP; session and provider tokens travel in clear unless TLS terminates in front of it (set [web].trust_forwarded_headers behind a TLS proxy)", + "listen", opts.Listen) +} + // wireHarness attaches the setup terminal to the daemon's session contract // when the operator configured one, and registers its cleanup. func wireHarness(opts Options, srv *webui.Server, cleanups *[]func()) error {