From 1b6e3a60d8a90bb0f04af4e46ba0987cf942f3fc Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Thu, 26 Nov 2026 19:56:27 -0800 Subject: [PATCH 1/2] fix(proxy): reserve port 8080 in proxy.entrypoints Onebox's static configuration enables ping without naming an entrypoint, so Traefik opens its internal "traefik" entrypoint on :8080 for the health check. A proxy.entrypoints listener on 8080 passed validation and then made the managed proxy fail to start on the host with "address already in use". Refuse it at load time with an error that says why. The rendered static configuration and its digest are unchanged. Co-Authored-By: Claude Opus 5.5 --- internal/app/load_test.go | 2 ++ internal/app/validate.go | 14 ++++++++++++++ .../content/docs/docs/reference/project-file.mdx | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/internal/app/load_test.go b/internal/app/load_test.go index 002cf2f5..6c8006be 100644 --- a/internal/app/load_test.go +++ b/internal/app/load_test.go @@ -58,6 +58,8 @@ func TestProxyEntrypointsValidateNamesAndPorts(t *testing.T) { {"built-in port", "proxy: {entrypoints: {otlp: {port: 443}}}\n", "websecure"}, {"duplicate port", "proxy: {entrypoints: {otlp-grpc: {port: 4317}, otlp-http: {port: 4317}}}\n", "both publish port 4317"}, {"invalid port", "proxy: {entrypoints: {otlp: {port: 70000}}}\n", "proxy.entrypoints.otlp.port"}, + {"traefik ping port", "proxy: {entrypoints: {admin: {port: 8080}}}\n", "ping health check"}, + {"neighbour of ping port", "proxy: {entrypoints: {admin: {port: 8081}}}\n", ""}, } { t.Run(tc.name, func(t *testing.T) { _, err := loadFixtureBytes([]byte(min+tc.yaml), "ob.yml") diff --git a/internal/app/validate.go b/internal/app/validate.go index dc941a6b..dfde980b 100644 --- a/internal/app/validate.go +++ b/internal/app/validate.go @@ -74,6 +74,11 @@ func validateSpec(p *Spec) error { return validateTopLevel(p) } +// traefikInternalPort is where Traefik opens its internal "traefik" +// entrypoint when ping, the API or metrics are enabled without an explicit +// entryPoint, as Onebox's static configuration does for ping. +const traefikInternalPort = 8080 + func validateTopLevel(p *Spec) error { if err := checkEnum("proxy.kind", p.Proxy.Kind, eProxyKind); err != nil { return err @@ -111,6 +116,15 @@ func validateTopLevel(p *Spec) error { if err := checkPort(path+".port", port); err != nil { return err } + // Onebox's static configuration enables ping without naming an + // entrypoint, so Traefik serves it from its internal "traefik" + // entrypoint on :8080. A declared listener there cannot bind, and the + // proxy fails to start on the host rather than here. + if port == traefikInternalPort { + return errf("project_invalid", path+".port", "", + "proxy entrypoint %q cannot publish port %d: the managed Traefik already listens there for its ping health check (its internal \"traefik\" entrypoint); choose another port", + name, port) + } if previous, exists := seenEntrypointPorts[port]; exists { return errf("project_invalid", path+".port", "", "proxy entrypoints %q and %q both publish port %d", previous, name, port) diff --git a/site/src/content/docs/docs/reference/project-file.mdx b/site/src/content/docs/docs/reference/project-file.mdx index a84af00a..71caef9a 100644 --- a/site/src/content/docs/docs/reference/project-file.mdx +++ b/site/src/content/docs/docs/reference/project-file.mdx @@ -272,6 +272,10 @@ Each declared port is published on the host by the managed proxy. Use this for remote clients; workloads on the same host can communicate over Onebox's internal networks without opening another host port. The route's `port` is the workload's listening port, while `entrypoint` selects the proxy listener. +Ports `80` and `443` belong to `web` and `websecure`, and port `8080` is +reserved too: the managed Traefik serves its ping health check from its +internal `traefik` entrypoint there, so a declared listener on `8080` could +never bind. When Onebox writes the static proxy configuration, including when `proxy.config` contains only dynamic extensions, it also writes these named From 41b9f6c851b424bd46b001c42b2703a1b8b25c24 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Thu, 26 Nov 2026 19:57:55 -0800 Subject: [PATCH 2/2] fix(proxy): reserve the entrypoint name traefik Traefik names its internal entrypoint "traefik". Checked against traefik:v3.7 with ping enabled: declaring an entrypoint of that name does not fail; it silently becomes the internal entrypoint, so :8080 is no longer opened and the ping health check is served on the declared, published port. Refuse the name with an error that says so. Co-Authored-By: Claude Opus 5.5 --- internal/app/load_test.go | 1 + internal/app/validate.go | 12 ++++++++++++ .../src/content/docs/docs/reference/project-file.mdx | 3 +++ 3 files changed, 16 insertions(+) diff --git a/internal/app/load_test.go b/internal/app/load_test.go index 6c8006be..9dfa82c0 100644 --- a/internal/app/load_test.go +++ b/internal/app/load_test.go @@ -58,6 +58,7 @@ func TestProxyEntrypointsValidateNamesAndPorts(t *testing.T) { {"built-in port", "proxy: {entrypoints: {otlp: {port: 443}}}\n", "websecure"}, {"duplicate port", "proxy: {entrypoints: {otlp-grpc: {port: 4317}, otlp-http: {port: 4317}}}\n", "both publish port 4317"}, {"invalid port", "proxy: {entrypoints: {otlp: {port: 70000}}}\n", "proxy.entrypoints.otlp.port"}, + {"traefik internal name", "proxy: {entrypoints: {traefik: {port: 9000}}}\n", "reserved: Traefik uses it for its internal entrypoint"}, {"traefik ping port", "proxy: {entrypoints: {admin: {port: 8080}}}\n", "ping health check"}, {"neighbour of ping port", "proxy: {entrypoints: {admin: {port: 8081}}}\n", ""}, } { diff --git a/internal/app/validate.go b/internal/app/validate.go index dfde980b..0c5d7e3b 100644 --- a/internal/app/validate.go +++ b/internal/app/validate.go @@ -79,6 +79,9 @@ func validateSpec(p *Spec) error { // entryPoint, as Onebox's static configuration does for ping. const traefikInternalPort = 8080 +// traefikInternalEntrypoint is the name of that internal entrypoint. +const traefikInternalEntrypoint = "traefik" + func validateTopLevel(p *Spec) error { if err := checkEnum("proxy.kind", p.Proxy.Kind, eProxyKind); err != nil { return err @@ -112,6 +115,15 @@ func validateTopLevel(p *Spec) error { return errf("project_invalid", path, "", "proxy entrypoint %q is built in and cannot be redeclared", name) } + // Traefik gives this name to its internal entrypoint. Declaring it + // does not fail: it silently becomes that entrypoint, so the ping + // health check moves off :8080 onto the declared, published port and + // is served to the internet beside the routes. + if name == traefikInternalEntrypoint { + return errf("project_invalid", path, "", + "proxy entrypoint name %q is reserved: Traefik uses it for its internal entrypoint, which serves the managed proxy's ping health check, "+ + "and a declared one would publish that check on its port; choose another name", name) + } port := p.Proxy.Entrypoints[name].Port if err := checkPort(path+".port", port); err != nil { return err diff --git a/site/src/content/docs/docs/reference/project-file.mdx b/site/src/content/docs/docs/reference/project-file.mdx index 71caef9a..5241a3d1 100644 --- a/site/src/content/docs/docs/reference/project-file.mdx +++ b/site/src/content/docs/docs/reference/project-file.mdx @@ -276,6 +276,9 @@ Ports `80` and `443` belong to `web` and `websecure`, and port `8080` is reserved too: the managed Traefik serves its ping health check from its internal `traefik` entrypoint there, so a declared listener on `8080` could never bind. +The name `traefik` is reserved for the same reason: declaring it would +redefine that internal entrypoint and publish the health check on the declared +port. When Onebox writes the static proxy configuration, including when `proxy.config` contains only dynamic extensions, it also writes these named