fix(nix): force http:// scheme on bundled caddy site address (#2485)

A bare `host:port` site address lets Caddy pick the listener scheme by
port heuristic, which fights `auto_https off` and surfaces as TLS errors
when the browser hits plain HTTP on a non-standard port. Hardcode the
`http://` prefix in both the Home Manager and NixOS Caddyfile templates
— the bundled proxy is plaintext-only by design, so users who need TLS
run their own front-end with `webFrontend.enable = false`.
This commit is contained in:
Chris Tam 2026-05-20 22:44:51 -04:00 committed by GitHub
parent ce95266586
commit 7b1cc16988
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -54,6 +54,10 @@
# in browsers (same failure mode QUICKSTART.md calls out for # in browsers (same failure mode QUICKSTART.md calls out for
# nginx). # nginx).
# * generous read/write timeouts for long-running streams. # * generous read/write timeouts for long-running streams.
#
# Site address is explicitly `http://` — a bare `host:port` lets Caddy
# pick the listener scheme by port, which collides with `auto_https
# off` and surfaces as TLS errors when the browser hits plain HTTP.
caddyfile = pkgs.writeText "open-design-web.Caddyfile" '' caddyfile = pkgs.writeText "open-design-web.Caddyfile" ''
{ {
auto_https off auto_https off
@ -61,7 +65,7 @@
persist_config off persist_config off
} }
${cfg.webFrontend.host}:${toString cfg.webFrontend.port} { http://${cfg.webFrontend.host}:${toString cfg.webFrontend.port} {
handle /api/* { handle /api/* {
reverse_proxy 127.0.0.1:${toString cfg.port} { reverse_proxy 127.0.0.1:${toString cfg.port} {
flush_interval -1 flush_interval -1

View file

@ -41,7 +41,7 @@
persist_config off persist_config off
} }
${cfg.webFrontend.host}:${toString cfg.webFrontend.port} { http://${cfg.webFrontend.host}:${toString cfg.webFrontend.port} {
handle /api/* { handle /api/* {
reverse_proxy 127.0.0.1:${toString cfg.port} { reverse_proxy 127.0.0.1:${toString cfg.port} {
flush_interval -1 flush_interval -1